From ed6d027b27056c26ced6b0183339516dd89eecc2 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 15 Apr 2019 12:13:24 +0530 Subject: [PATCH] qcacld-3.0: Populate rx mpdu count and fcs count in stainfo Currently rxmpdu count and fcs count is not getting populated in station info, add support to populate rx mpdu count and fcs count in station info and send to user space with get_station command. Change-Id: I5ae3c4c1e5647ad0b4777440ce0a1226ba4f373e CRs-fixed: 2438671 --- core/hdd/src/wlan_hdd_stats.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index f4c14a67fa33..83002d694c87 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -4368,6 +4368,22 @@ void hdd_wlan_fill_per_chain_rssi_stats(struct station_info *sinfo, #endif +#if defined(CFG80211_RX_FCS_ERROR_REPORTING_SUPPORT) +static void hdd_fill_fcs_and_mpdu_count(struct hdd_adapter *adapter, + struct station_info *sinfo) +{ + sinfo->rx_mpdu_count = adapter->hdd_stats.peer_stats.rx_count; + sinfo->fcs_err_count = adapter->hdd_stats.peer_stats.fcs_count; + hdd_debug("RX mpdu count %d fcs_err_count %d", + sinfo->rx_mpdu_count, sinfo->fcs_err_count); +} +#else +static void hdd_fill_fcs_and_mpdu_count(struct hdd_adapter *adapter, + struct station_info *sinfo) +{ +} +#endif + /** * wlan_hdd_get_sta_stats() - get aggregate STA stats * @wiphy: wireless phy @@ -4550,8 +4566,10 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy, wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat, sinfo); sinfo->tx_bytes = adapter->stats.tx_bytes; - sinfo->rx_bytes = adapter->hdd_stats.peer_stats.rx_bytes; - sinfo->rx_packets = adapter->hdd_stats.peer_stats.rx_count; + sinfo->rx_bytes = adapter->stats.rx_bytes; + sinfo->rx_packets = adapter->stats.rx_packets; + + hdd_fill_fcs_and_mpdu_count(adapter, sinfo); qdf_mem_copy(&sta_ctx->conn_info.txrate, &sinfo->txrate, sizeof(sinfo->txrate));