731a763e17ce7574564e4adc6121cd18a5677fa0
[openwrt/staging/ansuel.git] /
1 From 5bd2ced044bb95029d5c44cf7d23ced73e0fc05b 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: move references from rsvd2 to info fields
5
6 Remove references to reserved fields and add new info fields for
7 struct hal_rx_ppdu_end_user_stats. Reserved fields should not be
8 accessed, therefore existing references to it are to be changed to
9 referencing specific info fields.
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-1-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 | 11 ++++++++---
20 2 files changed, 13 insertions(+), 8 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->rsvd2[10]);
29 + rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
30 }
31
32 static inline void
33 @@ -825,11 +825,11 @@ ath11k_hal_rx_populate_byte_count(void *
34 (struct hal_rx_ppdu_end_user_stats *)rx_tlv;
35
36 rx_user_status->mpdu_ok_byte_count =
37 - FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT,
38 - __le32_to_cpu(ppdu_end_user->rsvd2[6]));
39 + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
40 + __le32_to_cpu(ppdu_end_user->info7));
41 rx_user_status->mpdu_err_byte_count =
42 - FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT,
43 - __le32_to_cpu(ppdu_end_user->rsvd2[8]));
44 + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
45 + __le32_to_cpu(ppdu_end_user->info8));
46 }
47
48 static inline void
49 --- a/drivers/net/wireless/ath/ath11k/hal_rx.h
50 +++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
51 @@ -222,8 +222,8 @@ struct hal_rx_ppdu_start {
52 #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0)
53 #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16)
54
55 -#define HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
56 -#define HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
57 +#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
58 +#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
59
60 struct hal_rx_ppdu_end_user_stats {
61 __le32 rsvd0[2];
62 @@ -236,7 +236,12 @@ struct hal_rx_ppdu_end_user_stats {
63 __le32 info4;
64 __le32 info5;
65 __le32 info6;
66 - __le32 rsvd2[11];
67 + __le32 rsvd2[5];
68 + __le32 info7;
69 + __le32 rsvd3;
70 + __le32 info8;
71 + __le32 rsvd3[2];
72 + __le32 info9;
73 } __packed;
74
75 struct hal_rx_ppdu_end_user_stats_ext {