diff mbox series

[2/2] wifi: ath11k: fix tid bitmap is 0 in peer rx mu stats

Message ID 1692827868-15667-2-git-send-email-quic_msinada@quicinc.com
State New
Headers show
Series [1/2] wifi: ath11k: move references from rsvd2 to info fields | expand

Commit Message

Muna Sinada Aug. 23, 2023, 9:57 p.m. UTC
Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect
offset caused peer rx mu stats tid bitmap to always be zero. This
correction is in the software context and does not affect the
firmware interface.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++-----
 drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++--------
 2 files changed, 14 insertions(+), 13 deletions(-)

Comments

Jeff Johnson Aug. 24, 2023, 12:39 a.m. UTC | #1
On 8/23/2023 2:57 PM, Muna Sinada wrote:
> Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect
> offset caused peer rx mu stats tid bitmap to always be zero. This
> correction is in the software context and does not affect the
> firmware interface.
> 
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>

> ---
>   drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++-----
>   drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++--------
>   2 files changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c
> index 1103d922320e..8c36a43af63e 100644
> --- a/drivers/net/wireless/ath/ath11k/hal_rx.c
> +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
> @@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx_tlv,
>   
>   	rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
>   
> -	rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
> +	rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info10);
>   }
>   
>   static inline void
> @@ -826,10 +826,10 @@ ath11k_hal_rx_populate_byte_count(void *rx_tlv, void *ppduinfo,
>   
>   	rx_user_status->mpdu_ok_byte_count =
>   		FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
> -			  __le32_to_cpu(ppdu_end_user->info7));
> +			  __le32_to_cpu(ppdu_end_user->info8));
>   	rx_user_status->mpdu_err_byte_count =
>   		FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
> -			  __le32_to_cpu(ppdu_end_user->info8));
> +			  __le32_to_cpu(ppdu_end_user->info9));
>   }
>   
>   static inline void
> @@ -903,8 +903,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab,
>   			FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX,
>   				  __le32_to_cpu(eu_stats->info2));
>   		ppdu_info->tid =
> -			ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP,
> -				      __le32_to_cpu(eu_stats->info6))) - 1;
> +			ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP,
> +				      __le32_to_cpu(eu_stats->info7))) - 1;
>   		ppdu_info->tcp_msdu_count =
>   			FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT,
>   				  __le32_to_cpu(eu_stats->info4));
> diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.h b/drivers/net/wireless/ath/ath11k/hal_rx.h
> index 833440df7d5c..472a52cf5889 100644
> --- a/drivers/net/wireless/ath/ath11k/hal_rx.h
> +++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
> @@ -149,7 +149,7 @@ struct hal_rx_mon_ppdu_info {
>   	u8 beamformed;
>   	u8 rssi_comb;
>   	u8 rssi_chain_pri20[HAL_RX_MAX_NSS];
> -	u8 tid;
> +	u16 tid;
>   	u16 ht_flags;
>   	u16 vht_flags;
>   	u16 he_flags;
> @@ -219,11 +219,11 @@ struct hal_rx_ppdu_start {
>   #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT		GENMASK(15, 0)
>   #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT	GENMASK(31, 16)
>   
> -#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP		GENMASK(15, 0)
> -#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP	GENMASK(31, 16)
> +#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP		GENMASK(15, 0)
> +#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_EOSP_BITMAP	GENMASK(31, 16)
>   
> -#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT	GENMASK(24, 0)
> -#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT	GENMASK(24, 0)
> +#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT	GENMASK(24, 0)
> +#define HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT	GENMASK(24, 0)
>   
>   struct hal_rx_ppdu_end_user_stats {
>   	__le32 rsvd0[2];
> @@ -236,12 +236,13 @@ struct hal_rx_ppdu_end_user_stats {
>   	__le32 info4;
>   	__le32 info5;
>   	__le32 info6;
> -	__le32 rsvd2[5];
>   	__le32 info7;
> -	__le32 rsvd3;
> +	__le32 rsvd2[4];
>   	__le32 info8;
> -	__le32 rsvd3[2];
> +	__le32 rsvd3;
>   	__le32 info9;
> +	__le32 rsvd4[2];
> +	__le32 info10;
>   } __packed;
>   
>   struct hal_rx_ppdu_end_user_stats_ext {
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.c b/drivers/net/wireless/ath/ath11k/hal_rx.c
index 1103d922320e..8c36a43af63e 100644
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
@@ -814,7 +814,7 @@  ath11k_hal_rx_handle_ofdma_info(void *rx_tlv,
 
 	rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
 
-	rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
+	rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info10);
 }
 
 static inline void
@@ -826,10 +826,10 @@  ath11k_hal_rx_populate_byte_count(void *rx_tlv, void *ppduinfo,
 
 	rx_user_status->mpdu_ok_byte_count =
 		FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
-			  __le32_to_cpu(ppdu_end_user->info7));
+			  __le32_to_cpu(ppdu_end_user->info8));
 	rx_user_status->mpdu_err_byte_count =
 		FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
-			  __le32_to_cpu(ppdu_end_user->info8));
+			  __le32_to_cpu(ppdu_end_user->info9));
 }
 
 static inline void
@@ -903,8 +903,8 @@  ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab,
 			FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX,
 				  __le32_to_cpu(eu_stats->info2));
 		ppdu_info->tid =
-			ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP,
-				      __le32_to_cpu(eu_stats->info6))) - 1;
+			ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP,
+				      __le32_to_cpu(eu_stats->info7))) - 1;
 		ppdu_info->tcp_msdu_count =
 			FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT,
 				  __le32_to_cpu(eu_stats->info4));
diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.h b/drivers/net/wireless/ath/ath11k/hal_rx.h
index 833440df7d5c..472a52cf5889 100644
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
@@ -149,7 +149,7 @@  struct hal_rx_mon_ppdu_info {
 	u8 beamformed;
 	u8 rssi_comb;
 	u8 rssi_chain_pri20[HAL_RX_MAX_NSS];
-	u8 tid;
+	u16 tid;
 	u16 ht_flags;
 	u16 vht_flags;
 	u16 he_flags;
@@ -219,11 +219,11 @@  struct hal_rx_ppdu_start {
 #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT		GENMASK(15, 0)
 #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT	GENMASK(31, 16)
 
-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP		GENMASK(15, 0)
-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP	GENMASK(31, 16)
+#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP		GENMASK(15, 0)
+#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_EOSP_BITMAP	GENMASK(31, 16)
 
-#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT	GENMASK(24, 0)
-#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT	GENMASK(24, 0)
+#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT	GENMASK(24, 0)
+#define HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT	GENMASK(24, 0)
 
 struct hal_rx_ppdu_end_user_stats {
 	__le32 rsvd0[2];
@@ -236,12 +236,13 @@  struct hal_rx_ppdu_end_user_stats {
 	__le32 info4;
 	__le32 info5;
 	__le32 info6;
-	__le32 rsvd2[5];
 	__le32 info7;
-	__le32 rsvd3;
+	__le32 rsvd2[4];
 	__le32 info8;
-	__le32 rsvd3[2];
+	__le32 rsvd3;
 	__le32 info9;
+	__le32 rsvd4[2];
+	__le32 info10;
 } __packed;
 
 struct hal_rx_ppdu_end_user_stats_ext {