summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Qian <zhangq@codeaurora.org>2017-02-08 11:01:54 +0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-19 19:25:43 -0800
commitb48ae46554e295b6b446dd33ffa52892b1de7da6 (patch)
treea5528f04a5b9ad6b9b64cea6774d8ae40c7e3996
parent7e27b9769c7a02d4aabd4aab24c7f4ccb4e36536 (diff)
qcacld-2.0: Add MAC address in vendor event for each peer
In MAC counters, there is only peer ID for each peer which is not convenient for user layer APP. MAC address for each peer is added in the vendor event to USER layer. Change-Id: I11b1101e2ffda25e30a9b30c14fb77172ae28d17 CRs-Fixed: 2003255
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c2
-rw-r--r--CORE/MAC/inc/sirApi.h2
-rw-r--r--CORE/SERVICES/WMA/wma.c25
3 files changed, 29 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index f0b72106cdd1..0c362cfb800e 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -6998,6 +6998,8 @@ static int put_wifi_ll_ext_peer_info(struct sir_wifi_ll_ext_peer_stats *peers,
nla_put_u32(skb,
QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_RX_MGMT,
peers->rx_oth_mgmts) ||
+ nla_put(skb, QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_PEER_MAC_ADDRESS,
+ VOS_MAC_ADDR_SIZE, peers->mac_address) ||
put_wifi_signal_info(&peers->peer_signal_stats, skb)) {
hddLog(LOGE, FL("put peer signal attr failed"));
return -EINVAL;
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index dc01fa906f45..cd70cd3aa840 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -6537,6 +6537,7 @@ struct sir_wifi_ll_ext_wmm_ac_stats {
* struct sir_wifi_ll_ext_peer_stats - per peer stats
* @peer_id: peer ID
* @vdev_id: VDEV ID
+ * mac_address: MAC address
* @sta_ps_inds: how many times STAs go to sleep
* @sta_ps_durs: total sleep time of STAs (units in ms)
* @rx_probe_reqs: number of probe requests received
@@ -6548,6 +6549,7 @@ struct sir_wifi_ll_ext_wmm_ac_stats {
struct sir_wifi_ll_ext_peer_stats {
uint32_t peer_id;
uint32_t vdev_id;
+ tSirMacAddr mac_address;
uint32_t sta_ps_inds;
uint32_t sta_ps_durs;
uint32_t rx_probe_reqs;
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 9cffc5bfe543..646229fcd4b2 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -5735,6 +5735,8 @@ static int wma_ll_stats_evt_handler(void *handle, u_int8_t *event,
uint32_t i, peer_num, result_size, dst_len;
tpAniSirGlobal mac;
vos_msg_t vos_msg;
+ struct ol_txrx_peer_t *peer;
+ ol_txrx_pdev_handle pdev;
mac = (tpAniSirGlobal)vos_get_context(VOS_MODULE_ID_PE,
wma_handle->vos_context);
@@ -5748,6 +5750,12 @@ static int wma_ll_stats_evt_handler(void *handle, u_int8_t *event,
return -EINVAL;
}
+ pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma_handle->vos_context);
+ if (!pdev) {
+ WMA_LOGD("%s: NULL ol_txrx pdev ptr. Exiting", __func__);
+ return -EINVAL;
+ }
+
WMA_LOGD("%s: Posting MAC counters event to HDD", __func__);
param_buf = (WMI_REPORT_STATS_EVENTID_param_tlvs *)event;
@@ -5812,6 +5820,23 @@ static int wma_ll_stats_evt_handler(void *handle, u_int8_t *event,
} else {
WMA_LOGE(FL("Invalid length of PEER signal."));
}
+
+ peer = ol_txrx_peer_find_by_local_id(pdev,
+ wmi_peer_signal->peer_id);
+ if (!peer) {
+ WMA_LOGE(FL("Invalid Peer ID %d in FW message."),
+ wmi_peer_signal->peer_id);
+ } else {
+ vos_mem_copy(&peer_stats[i].mac_address,
+ &peer->mac_addr,
+ sizeof(peer_stats[i].mac_address));
+ WMA_LOGI("Peer %d mac address is: ",
+ wmi_peer_signal->peer_id);
+ WMA_LOGI("%2x:%2x:%2x:%2x:%2x:%2x.",
+ peer->mac_addr.raw[0], peer->mac_addr.raw[1],
+ peer->mac_addr.raw[2], peer->mac_addr.raw[3],
+ peer->mac_addr.raw[4], peer->mac_addr.raw[5]);
+ }
}
result += peer_num * sizeof(struct sir_wifi_ll_ext_peer_stats);