From e661127fa12fd195215926021dd3c444f3df6bd1 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Mon, 22 Apr 2019 18:38:51 +0800 Subject: [PATCH] qcacmn: fix incorrect NSS value in host RX stats Revert change "Limit maxinum nss number as 2 for MCL platform" and align with WIN function: hal_rx_msdu_start_nss_get_8074v2(). besides, only increase rx.nss[NSS - 1] when NSS is > 0 and rx packet type is 11N/AC/AX. Change-Id: I0a64f00a3d252c806216cc3196e71290f111c88a CRs-Fixed: 2429329 --- dp/wifi3.0/dp_rx.c | 10 +++++++++- hal/wifi3.0/qca6390/hal_6390_rx.h | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index c0378ccf3d..888bdb4c13 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1429,7 +1429,15 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc, pkt_type = hal_rx_msdu_start_get_pkt_type(rx_tlv_hdr); DP_STATS_INC(peer, rx.bw[bw], 1); - DP_STATS_INC(peer, rx.nss[nss], 1); + /* + * only if nss > 0 and pkt_type is 11N/AC/AX, + * then increase index [nss - 1] in array counter. + */ + if (nss > 0 && (pkt_type == DOT11_N || + pkt_type == DOT11_AC || + pkt_type == DOT11_AX)) + DP_STATS_INC(peer, rx.nss[nss - 1], 1); + DP_STATS_INC(peer, rx.sgi_count[sgi], 1); DP_STATS_INCC(peer, rx.err.mic_err, 1, hal_rx_mpdu_end_mic_err_get(rx_tlv_hdr)); diff --git a/hal/wifi3.0/qca6390/hal_6390_rx.h b/hal/wifi3.0/qca6390/hal_6390_rx.h index 3a61762457..c0eb007655 100644 --- a/hal/wifi3.0/qca6390/hal_6390_rx.h +++ b/hal/wifi3.0/qca6390/hal_6390_rx.h @@ -55,16 +55,11 @@ hal_rx_msdu_start_nss_get_6390(uint8_t *buf) struct rx_msdu_start *msdu_start = &pkt_tlvs->msdu_start_tlv.rx_msdu_start; uint8_t mimo_ss_bitmap; - uint32_t ss_index; mimo_ss_bitmap = HAL_RX_MSDU_START_MIMO_SS_BITMAP(msdu_start); - ss_index = qdf_get_hweight8(mimo_ss_bitmap); - /* Hot fix only, maxinum nss number for MCL set to 1 (nss 2)*/ - if ((ss_index > 1) && (ss_index <= 3)) - ss_index = 1; + return qdf_get_hweight8(mimo_ss_bitmap); - return ss_index; } /**