From 43cb55c5cfa164ecb913dab86087451d1cbd7c9b Mon Sep 17 00:00:00 2001 From: Venkata Sharath Chandra Manchala Date: Wed, 14 Mar 2018 00:04:22 -0700 Subject: [PATCH] qcacld-3.0: Enable Per Peer REO stats Add a command: iwpriv txrx_stats 28 for printing REO Queue statistics. Change-Id: Ic5001706a6682bec3e8170c1e96825161fb5fc9d CRs-Fixed: 2217833 --- core/hdd/src/wlan_hdd_hostapd.c | 2 -- core/hdd/src/wlan_hdd_hostapd_wext.c | 14 ++++++++++++++ core/hdd/src/wlan_hdd_wext.c | 16 +++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5fd339d0169d..24887323b021 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -56,7 +56,6 @@ #include "wlan_hdd_misc.h" #include #include "pld_common.h" - #include "wma.h" #ifdef WLAN_DEBUG #include "wma_api.h" @@ -2989,7 +2988,6 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit) phostapdBuf = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter); sme_set_curr_device_mode(hdd_ctx->mac_handle, adapter->device_mode); - /* Zero the memory. This zeros the profile structure. */ memset(phostapdBuf, 0, sizeof(struct hdd_hostapd_state)); diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index 653cb5b555e2..61c21c4e309d 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -200,6 +200,8 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev, struct cdp_pdev *pdev = NULL; void *soc = NULL; struct cdp_txrx_stats_req req = {0}; + uint8_t count = 0; + struct hdd_station_info *sta_info; hdd_enter_dev(dev); @@ -225,6 +227,18 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev, req.mac_id = value[2]; hdd_info("QCSAP_PARAM_SET_TXRX_STATS stats_id: %d mac_id: %d", req.stats, req.mac_id); + sta_info = adapter->sta_info; + if (value[1] == CDP_TXRX_STATS_28) { + for (count = 0; count < WLAN_MAX_STA_COUNT; count++) { + if (sta_info[count].in_use) { + hdd_debug("sta: %d: bss_id: %pM", + sta_info->sta_id, + (void *)&sta_info->sta_mac); + req.peer_addr = + (char *)&sta_info->sta_mac; + } + } + } ret = cdp_txrx_stats_request(soc, vdev, &req); break; } diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index b573700dc6d6..0af0641d2c13 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -3187,7 +3187,6 @@ static void hdd_display_stats_help(void) hdd_err(" 5 -- Flow control statistics"); hdd_err(" 6 -- Per Layer statistics"); hdd_err(" 7 -- Copy engine interrupt statistics"); - hdd_err(" 8 -- LRO statistics"); hdd_err(" 9 -- NAPI statistics"); } @@ -3208,27 +3207,33 @@ int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value) case CDP_TXRX_HIST_STATS: wlan_hdd_display_tx_rx_histogram(hdd_ctx); break; + case CDP_HDD_NETIF_OPER_HISTORY: wlan_hdd_display_netif_queue_history (hdd_ctx, QDF_STATS_VERBOSITY_LEVEL_HIGH); break; + case CDP_HIF_STATS: hdd_display_hif_stats(); break; + case CDP_LRO_STATS: hdd_lro_display_stats(hdd_ctx); break; + case CDP_NAPI_STATS: if (hdd_display_napi_stats()) { hdd_err("error displaying napi stats"); ret = EFAULT; } break; + case CDP_DISCONNECT_STATS: sme_display_disconnect_stats(hdd_ctx->mac_handle, adapter->session_id); break; + default: status = cdp_display_stats(cds_get_context(QDF_MODULE_ID_SOC), value, @@ -7112,6 +7117,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); mac_handle_t mac_handle; + struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); int sub_cmd; int *apps_args = (int *) extra; struct hdd_context *hdd_ctx; @@ -7353,6 +7359,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d", req.stats, req.mac_id); + if (apps_args[0] == CDP_TXRX_STATS_28) { + if (sta_ctx->conn_info.uIsAuthenticated) { + hdd_debug("ap mac addr: %pM", + (void *)&sta_ctx->conn_info.bssId); + req.peer_addr = + (char *)&sta_ctx->conn_info.bssId; + } + } ret = cdp_txrx_stats_request(soc, vdev, &req); break; }