diff mbox series

[v3,03/11] wifi: ath12k: fix struct hal_rx_ppdu_end_user_stats

Message ID 20241016065700.1090-4-quic_kangyang@quicinc.com (mailing list archive)
State Superseded
Delegated to: Jeff Johnson
Headers show
Series wifi: ath12k: some fixes and clean up for monitor mode | expand

Commit Message

Kang Yang Oct. 16, 2024, 6:56 a.m. UTC
Current struct hal_rx_ppdu_end_user_stats in hal_rx.h is not matched
with hardware descriptor definition.

So update this structure and related code.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 10 +++++-----
 drivers/net/wireless/ath/ath12k/hal_rx.h | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

Comments

Kalle Valo Oct. 21, 2024, 8:45 a.m. UTC | #1
Kang Yang <quic_kangyang@quicinc.com> writes:

> Current struct hal_rx_ppdu_end_user_stats in hal_rx.h is not matched
> with hardware descriptor definition.
>
> So update this structure and related code.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>

What about QCN9274? The commit message doesn't mention anything about
that.
Kalle Valo Oct. 21, 2024, 8:50 a.m. UTC | #2
Kalle Valo <kvalo@kernel.org> writes:

> Kang Yang <quic_kangyang@quicinc.com> writes:
>
>> Current struct hal_rx_ppdu_end_user_stats in hal_rx.h is not matched
>> with hardware descriptor definition.
>>
>> So update this structure and related code.
>>
>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>>
>> Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
>
> What about QCN9274? The commit message doesn't mention anything about
> that.

I have the same question for patches 3-6. Also I would like to
understand the backwards compatibility with older WCN7850 firmwares.
Kang Yang Oct. 21, 2024, 9:32 a.m. UTC | #3
On 10/21/2024 4:50 PM, Kalle Valo wrote:
> Kalle Valo <kvalo@kernel.org> writes:
> 
>> Kang Yang <quic_kangyang@quicinc.com> writes:
>>
>>> Current struct hal_rx_ppdu_end_user_stats in hal_rx.h is not matched
>>> with hardware descriptor definition.
>>>
>>> So update this structure and related code.
>>>
>>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>>>
>>> Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
>>
>> What about QCN9274? The commit message doesn't mention anything about
>> that.
> 
> I have the same question for patches 3-6. Also I would like to
> understand the backwards compatibility with older WCN7850 firmwares.

For QCN9274, we reuse the same struct for them.
WIN team already checked them during internal review.

The struct definitions in patch 3-6 are hardware descriptor definition, 
won't be affected by firmware and host. They are fixed.

>
Kalle Valo Oct. 28, 2024, 7:16 a.m. UTC | #4
Kang Yang <quic_kangyang@quicinc.com> writes:

> On 10/21/2024 4:50 PM, Kalle Valo wrote:
>> Kalle Valo <kvalo@kernel.org> writes:
>> 
>>> Kang Yang <quic_kangyang@quicinc.com> writes:
>>>
>>>> Current struct hal_rx_ppdu_end_user_stats in hal_rx.h is not matched
>>>> with hardware descriptor definition.
>>>>
>>>> So update this structure and related code.
>>>>
>>>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>>>>
>>>> Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
>>>
>>> What about QCN9274? The commit message doesn't mention anything about
>>> that.
>> I have the same question for patches 3-6. Also I would like to
>> understand the backwards compatibility with older WCN7850 firmwares.
>
> For QCN9274, we reuse the same struct for them.
> WIN team already checked them during internal review.
>
> The struct definitions in patch 3-6 are hardware descriptor
> definition, won't be affected by firmware and host. They are fixed.

Please always include this information to the commit message so that we
know that you have done the research properly and the patch is not
breaking other hardware. ath12k is not only about WCN7850.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 5c6749bc4039..8d0d3c849c90 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -21,20 +21,20 @@  static void ath12k_dp_mon_rx_handle_ofdma_info(void *rx_tlv,
 		__le32_to_cpu(ppdu_end_user->usr_resp_ref_ext);
 }
 
-static void
+static inline void
 ath12k_dp_mon_rx_populate_byte_count(const struct hal_rx_ppdu_end_user_stats *stats,
 				     void *ppduinfo,
 				     struct hal_rx_user_status *rx_user_status)
 {
-	u32 mpdu_ok_byte_count = __le32_to_cpu(stats->mpdu_ok_cnt);
-	u32 mpdu_err_byte_count = __le32_to_cpu(stats->mpdu_err_cnt);
+	u32 mpdu_ok_byte_count = __le32_to_cpu(stats->info7);
+	u32 mpdu_err_byte_count = __le32_to_cpu(stats->info8);
 
 	rx_user_status->mpdu_ok_byte_count =
 		u32_get_bits(mpdu_ok_byte_count,
-			     HAL_RX_PPDU_END_USER_STATS_MPDU_DELIM_OK_BYTE_COUNT);
+			     HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT);
 	rx_user_status->mpdu_err_byte_count =
 		u32_get_bits(mpdu_err_byte_count,
-			     HAL_RX_PPDU_END_USER_STATS_MPDU_DELIM_ERR_BYTE_COUNT);
+			     HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT);
 }
 
 static void
diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.h b/drivers/net/wireless/ath/ath12k/hal_rx.h
index 095216eabc01..837ba4adba88 100644
--- a/drivers/net/wireless/ath/ath12k/hal_rx.h
+++ b/drivers/net/wireless/ath/ath12k/hal_rx.h
@@ -1,7 +1,7 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH12K_HAL_RX_H
@@ -240,13 +240,13 @@  struct hal_rx_ppdu_start {
 	__le32 ppdu_start_ts;
 } __packed;
 
-#define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR	GENMASK(25, 16)
+#define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR	GENMASK(26, 16)
 
-#define HAL_RX_PPDU_END_USER_STATS_INFO1_MPDU_CNT_FCS_OK	GENMASK(8, 0)
-#define HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID		BIT(9)
-#define HAL_RX_PPDU_END_USER_STATS_INFO1_QOS_CTRL_VALID		BIT(10)
-#define HAL_RX_PPDU_END_USER_STATS_INFO1_HT_CTRL_VALID		BIT(11)
-#define HAL_RX_PPDU_END_USER_STATS_INFO1_PKT_TYPE		GENMASK(23, 20)
+#define HAL_RX_PPDU_END_USER_STATS_INFO1_MPDU_CNT_FCS_OK	GENMASK(10, 0)
+#define HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID		BIT(11)
+#define HAL_RX_PPDU_END_USER_STATS_INFO1_QOS_CTRL_VALID		BIT(12)
+#define HAL_RX_PPDU_END_USER_STATS_INFO1_HT_CTRL_VALID		BIT(13)
+#define HAL_RX_PPDU_END_USER_STATS_INFO1_PKT_TYPE              GENMASK(24, 21)
 
 #define HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX		GENMASK(15, 0)
 #define HAL_RX_PPDU_END_USER_STATS_INFO2_FRAME_CTRL		GENMASK(31, 16)
@@ -262,8 +262,8 @@  struct hal_rx_ppdu_start {
 #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_MPDU_DELIM_OK_BYTE_COUNT	GENMASK(24, 0)
-#define HAL_RX_PPDU_END_USER_STATS_MPDU_DELIM_ERR_BYTE_COUNT	GENMASK(24, 0)
+#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)
 
 struct hal_rx_ppdu_end_user_stats {
 	__le32 rsvd0[2];
@@ -278,9 +278,9 @@  struct hal_rx_ppdu_end_user_stats {
 	__le32 usr_resp_ref;
 	__le32 info6;
 	__le32 rsvd3[4];
-	__le32 mpdu_ok_cnt;
+	__le32 info7;
 	__le32 rsvd4;
-	__le32 mpdu_err_cnt;
+	__le32 info8;
 	__le32 rsvd5[2];
 	__le32 usr_resp_ref_ext;
 	__le32 rsvd6;