qcacld-3.0: Get evm inforation of each antenna in groups

User layer need to get evm info of each groups of antenna.
Host first get this info by WMI command and then transfer
it to user layer by netlink.

Change-Id: I6e15b85962d06718799f91b86f07ddd8762adb5c
CRs-Fixed: 2381569
This commit is contained in:
stonez 2019-01-16 12:29:16 +08:00 committed by nshrivas
parent 08c92b51ae
commit 396a973271
3 changed files with 31 additions and 12 deletions

View File

@ -11446,6 +11446,7 @@ static int hdd_post_get_chain_rssi_rsp(struct hdd_context *hdd_ctx,
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy,
(sizeof(result->chain_rssi) + NLA_HDRLEN) +
(sizeof(result->chain_evm) + NLA_HDRLEN) +
(sizeof(result->ant_id) + NLA_HDRLEN) +
NLMSG_HDRLEN);
@ -11455,15 +11456,22 @@ static int hdd_post_get_chain_rssi_rsp(struct hdd_context *hdd_ctx,
}
if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_CHAIN_RSSI,
sizeof(result->chain_rssi),
result->chain_rssi)) {
sizeof(result->chain_rssi),
result->chain_rssi)) {
hdd_err("put fail");
goto nla_put_failure;
}
if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_CHAIN_EVM,
sizeof(result->chain_evm),
result->chain_evm)) {
hdd_err("put fail");
goto nla_put_failure;
}
if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_ANTENNA_INFO,
sizeof(result->ant_id),
result->ant_id)) {
sizeof(result->ant_id),
result->ant_id)) {
hdd_err("put fail");
goto nla_put_failure;
}

View File

@ -5989,12 +5989,14 @@ struct sir_rssi_disallow_lst {
* struct chain_rssi_result - chain rssi result
* num_chains_valid: valid chain num
* @chain_rssi: chain rssi result as dBm unit
* @chain_evm: error vector magnitude
* @ant_id: antenna id
*/
#define CHAIN_MAX_NUM 8
struct chain_rssi_result {
uint32_t num_chains_valid;
uint32_t chain_rssi[CHAIN_MAX_NUM];
int32_t chain_evm[CHAIN_MAX_NUM];
uint32_t ant_id[CHAIN_MAX_NUM];
};

View File

@ -5535,6 +5535,8 @@ int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
return -EINVAL;
}
qdf_mem_zero(&chain_rssi_result, sizeof(chain_rssi_result));
WMI_MAC_ADDR_TO_CHAR_ARRAY(&event->macaddr, macaddr);
WMA_LOGD(FL("macaddr: " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(macaddr));
@ -5542,25 +5544,32 @@ int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf,
chain_rssi_result.num_chains_valid = event->num_chains_valid;
qdf_mem_copy(chain_rssi_result.chain_rssi, event->chain_rssi,
sizeof(event->chain_rssi));
for (i = 0; i < event->num_chains_valid; i++) {
WMA_LOGD(FL("chain_rssi: %d, ant_id: %d"),
event->chain_rssi[i], event->ant_id[i]);
sizeof(event->chain_rssi));
qdf_mem_copy(chain_rssi_result.chain_evm, event->chain_evm,
sizeof(event->chain_evm));
qdf_mem_copy(chain_rssi_result.ant_id, event->ant_id,
sizeof(event->ant_id));
for (i = 0; i < chain_rssi_result.num_chains_valid; i++) {
WMA_LOGD(FL("chain_rssi: %d, chain_evm: %d,ant_id: %d"),
chain_rssi_result.chain_rssi[i],
chain_rssi_result.chain_evm[i],
chain_rssi_result.ant_id[i]);
if (!wmi_service_enabled(wma->wmi_handle,
wmi_service_hw_db2dbm_support)) {
if (chain_rssi_result.chain_rssi[i] !=
WMA_INVALID_PER_CHAIN_SNR)
chain_rssi_result.chain_rssi[i] +=
WMA_TGT_NOISE_FLOOR_DBM;
WMA_TGT_NOISE_FLOOR_DBM;
else
chain_rssi_result.chain_rssi[i] =
WMA_INVALID_PER_CHAIN_RSSI;
}
}
qdf_mem_copy(chain_rssi_result.ant_id, event->ant_id,
sizeof(event->ant_id));
pmac->sme.get_chain_rssi_cb(pmac->sme.get_chain_rssi_context,
&chain_rssi_result);