3edc3fc956cfc97c1b06a298e3eb131ed2cd25df
[openwrt/staging/ansuel.git] /
1 From 7791487cd16cafd018cba0bf73789111a9f16843 Mon Sep 17 00:00:00 2001
2 From: Muna Sinada <quic_msinada@quicinc.com>
3 Date: Sat, 26 Aug 2023 08:42:46 +0300
4 Subject: [PATCH] wifi: ath11k: fix tid bitmap is 0 in peer rx mu stats
5
6 Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect
7 offset caused peer rx mu stats tid bitmap to always be zero. This
8 correction is in the software context and does not affect the
9 firmware interface.
10
11 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
12
13 Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
14 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
15 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
16 Link: https://lore.kernel.org/r/1692827868-15667-2-git-send-email-quic_msinada@quicinc.com
17 ---
18 drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++-----
19 drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++--------
20 2 files changed, 14 insertions(+), 13 deletions(-)
21
22 --- a/drivers/net/wireless/ath/ath11k/hal_rx.c
23 +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
24 @@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx
25
26 rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
27
28 - rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
29 + rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info10);
30 }
31
32 static inline void
33 @@ -826,10 +826,10 @@ ath11k_hal_rx_populate_byte_count(void *
34
35 rx_user_status->mpdu_ok_byte_count =
36 FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
37 - __le32_to_cpu(ppdu_end_user->info7));
38 + __le32_to_cpu(ppdu_end_user->info8));
39 rx_user_status->mpdu_err_byte_count =
40 FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
41 - __le32_to_cpu(ppdu_end_user->info8));
42 + __le32_to_cpu(ppdu_end_user->info9));
43 }
44
45 static inline void
46 @@ -903,8 +903,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
47 FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX,
48 __le32_to_cpu(eu_stats->info2));
49 ppdu_info->tid =
50 - ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP,
51 - __le32_to_cpu(eu_stats->info6))) - 1;
52 + ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP,
53 + __le32_to_cpu(eu_stats->info7))) - 1;
54 ppdu_info->tcp_msdu_count =
55 FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT,
56 __le32_to_cpu(eu_stats->info4));
57 --- a/drivers/net/wireless/ath/ath11k/hal_rx.h
58 +++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
59 @@ -149,7 +149,7 @@ struct hal_rx_mon_ppdu_info {
60 u8 beamformed;
61 u8 rssi_comb;
62 u8 rssi_chain_pri20[HAL_RX_MAX_NSS];
63 - u8 tid;
64 + u16 tid;
65 u16 ht_flags;
66 u16 vht_flags;
67 u16 he_flags;
68 @@ -219,11 +219,11 @@ struct hal_rx_ppdu_start {
69 #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT GENMASK(15, 0)
70 #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT GENMASK(31, 16)
71
72 -#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0)
73 -#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16)
74 +#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP GENMASK(15, 0)
75 +#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_EOSP_BITMAP GENMASK(31, 16)
76
77 -#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
78 -#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
79 +#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
80 +#define HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
81
82 struct hal_rx_ppdu_end_user_stats {
83 __le32 rsvd0[2];
84 @@ -236,12 +236,13 @@ struct hal_rx_ppdu_end_user_stats {
85 __le32 info4;
86 __le32 info5;
87 __le32 info6;
88 - __le32 rsvd2[5];
89 __le32 info7;
90 - __le32 rsvd3;
91 + __le32 rsvd2[4];
92 __le32 info8;
93 - __le32 rsvd3[2];
94 + __le32 rsvd3;
95 __le32 info9;
96 + __le32 rsvd4[2];
97 + __le32 info10;
98 } __packed;
99
100 struct hal_rx_ppdu_end_user_stats_ext {