mirror of https://lore.kernel.org/ath12k/
 help / color / mirror / Atom feed
* [PATCH ath-next] wifi: ath12k: Fix NSS value update in ext_rx_stats
@ 2025-07-25  8:44 Thiraviyam Mariyappan
  2025-09-20 15:55 ` Jeff Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Thiraviyam Mariyappan @ 2025-07-25  8:44 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Thiraviyam Mariyappan

Currently, in ext_rx_stats, the NSS value is taken directly from
the firmware, which results in incorrect mapping:
        4x4, 3x3, 2x2, 1x1 SS are incorrectly updated as 3x3, 2x2,
1x1, 0x0 SS respectively.

Fix the issue by incrementing the NSS value by 1 while updating
the PPDU info to ensure accurate spatial stream statistics.

Remove the redundant +1 increment in the radiotap header when monitor
mode is enabled to prevent double counting.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1

Signed-off-by: Thiraviyam Mariyappan <thiraviyam.mariyappan@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 8189e52ed007..4bf21286b95c 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -105,7 +105,7 @@ static void ath12k_dp_mon_parse_vht_sig_a(const struct hal_rx_vht_sig_a_info *vh
 	if (ppdu_info->is_stbc && nsts > 0)
 		nsts = ((nsts + 1) >> 1) - 1;
 
-	ppdu_info->nss = u32_get_bits(nsts, VHT_SIG_SU_NSS_MASK);
+	ppdu_info->nss = u32_get_bits(nsts, VHT_SIG_SU_NSS_MASK) + 1;
 	ppdu_info->bw = u32_get_bits(info0, HAL_RX_VHT_SIG_A_INFO_INFO0_BW);
 	ppdu_info->beamformed = u32_get_bits(info1,
 					     HAL_RX_VHT_SIG_A_INFO_INFO1_BEAMFORMED);
@@ -129,7 +129,7 @@ static void ath12k_dp_mon_parse_ht_sig(const struct hal_rx_ht_sig_info *ht_sig,
 	ppdu_info->is_stbc = u32_get_bits(info1, HAL_RX_HT_SIG_INFO_INFO1_STBC);
 	ppdu_info->ldpc = u32_get_bits(info1, HAL_RX_HT_SIG_INFO_INFO1_FEC_CODING);
 	ppdu_info->gi = u32_get_bits(info1, HAL_RX_HT_SIG_INFO_INFO1_GI);
-	ppdu_info->nss = (ppdu_info->mcs >> 3);
+	ppdu_info->nss = (ppdu_info->mcs >> 3) + 1;
 }
 
 static void ath12k_dp_mon_parse_l_sig_b(const struct hal_rx_lsig_b_info *lsigb,
@@ -233,7 +233,8 @@ ath12k_dp_mon_parse_he_sig_b2_ofdma(const struct hal_rx_he_sig_b2_ofdma_info *of
 	value = value << HE_STA_ID_SHIFT;
 	ppdu_info->he_data4 |= value;
 
-	ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_NSTS);
+	ppdu_info->nss = u32_get_bits(info0,
+				      HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_NSTS) + 1;
 	ppdu_info->beamformed = u32_get_bits(info0,
 					     HAL_RX_HE_SIG_B2_OFDMA_INFO_INFO0_STA_TXBF);
 }
@@ -261,7 +262,7 @@ ath12k_dp_mon_parse_he_sig_b2_mu(const struct hal_rx_he_sig_b2_mu_info *he_sig_b
 	value = value << HE_STA_ID_SHIFT;
 	ppdu_info->he_data4 |= value;
 
-	ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS);
+	ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_B2_MU_INFO_INFO0_STA_NSTS) + 1;
 }
 
 static void
@@ -553,7 +554,7 @@ static void ath12k_dp_mon_parse_he_sig_su(const struct hal_rx_he_sig_a_su_info *
 	ppdu_info->is_stbc = u32_get_bits(info1, HAL_RX_HE_SIG_A_SU_INFO_INFO1_STBC);
 	ppdu_info->beamformed = u32_get_bits(info1, HAL_RX_HE_SIG_A_SU_INFO_INFO1_TXBF);
 	dcm = u32_get_bits(info0, HAL_RX_HE_SIG_A_SU_INFO_INFO0_DCM);
-	ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS);
+	ppdu_info->nss = u32_get_bits(info0, HAL_RX_HE_SIG_A_SU_INFO_INFO0_NSTS) + 1;
 	ppdu_info->dcm = dcm;
 }
 
@@ -2155,7 +2156,7 @@ static void ath12k_dp_mon_update_radiotap(struct ath12k *ar,
 
 	rxs->flag |= RX_FLAG_MACTIME_START;
 	rxs->signal = ppduinfo->rssi_comb + noise_floor;
-	rxs->nss = ppduinfo->nss + 1;
+	rxs->nss = ppduinfo->nss;
 
 	if (ppduinfo->userstats[ppduinfo->userid].ampdu_present) {
 		rxs->flag |= RX_FLAG_AMPDU_DETAILS;

base-commit: d29591d5b52eaa62bc8c07ec83fe63018b5546ea
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next] wifi: ath12k: Fix NSS value update in ext_rx_stats
  2025-07-25  8:44 [PATCH ath-next] wifi: ath12k: Fix NSS value update in ext_rx_stats Thiraviyam Mariyappan
@ 2025-09-20 15:55 ` Jeff Johnson
  2025-10-07 13:31   ` Thiraviyam Mariyappan
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Johnson @ 2025-09-20 15:55 UTC (permalink / raw)
  To: Thiraviyam Mariyappan, ath12k; +Cc: linux-wireless

On 7/25/2025 1:44 AM, Thiraviyam Mariyappan wrote:
> Currently, in ext_rx_stats, the NSS value is taken directly from
> the firmware, which results in incorrect mapping:
>         4x4, 3x3, 2x2, 1x1 SS are incorrectly updated as 3x3, 2x2,
> 1x1, 0x0 SS respectively.
> 
> Fix the issue by incrementing the NSS value by 1 while updating
> the PPDU info to ensure accurate spatial stream statistics.
> 
> Remove the redundant +1 increment in the radiotap header when monitor
> mode is enabled to prevent double counting.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Thiraviyam Mariyappan <thiraviyam.mariyappan@oss.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath12k/dp_mon.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)

This patch no longer cleanly applies to ath/main:
Applying: wifi: ath12k: Fix NSS value update in ext_rx_stats
Using index info to reconstruct a base tree...
M       drivers/net/wireless/ath/ath12k/dp_mon.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/ath/ath12k/dp_mon.c
CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath12k/dp_mon.c

Please rebase. And when you do so, please follow current legal guidance and
replace the existing QUIC copyright with the new QTI one.

/jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH ath-next] wifi: ath12k: Fix NSS value update in ext_rx_stats
  2025-09-20 15:55 ` Jeff Johnson
@ 2025-10-07 13:31   ` Thiraviyam Mariyappan
  0 siblings, 0 replies; 3+ messages in thread
From: Thiraviyam Mariyappan @ 2025-10-07 13:31 UTC (permalink / raw)
  To: Jeff Johnson, ath12k; +Cc: linux-wireless



On 9/20/2025 9:25 PM, Jeff Johnson wrote:
> On 7/25/2025 1:44 AM, Thiraviyam Mariyappan wrote:
>> Currently, in ext_rx_stats, the NSS value is taken directly from
>> the firmware, which results in incorrect mapping:
>>         4x4, 3x3, 2x2, 1x1 SS are incorrectly updated as 3x3, 2x2,
>> 1x1, 0x0 SS respectively.
>>
>> Fix the issue by incrementing the NSS value by 1 while updating
>> the PPDU info to ensure accurate spatial stream statistics.
>>
>> Remove the redundant +1 increment in the radiotap header when monitor
>> mode is enabled to prevent double counting.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Thiraviyam Mariyappan <thiraviyam.mariyappan@oss.qualcomm.com>
>> ---
>>  drivers/net/wireless/ath/ath12k/dp_mon.c | 13 +++++++------
>>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> This patch no longer cleanly applies to ath/main:
> Applying: wifi: ath12k: Fix NSS value update in ext_rx_stats
> Using index info to reconstruct a base tree...
> M       drivers/net/wireless/ath/ath12k/dp_mon.c
> Falling back to patching base and 3-way merge...
> Auto-merging drivers/net/wireless/ath/ath12k/dp_mon.c
> CONFLICT (content): Merge conflict in drivers/net/wireless/ath/ath12k/dp_mon.c
> 
> Please rebase. And when you do so, please follow current legal guidance and
> replace the existing QUIC copyright with the new QTI one.

WIll rebase and update the copyright in the next version.
> 
> /jeff

Thanks,
Thiraviyam M



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-07 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25  8:44 [PATCH ath-next] wifi: ath12k: Fix NSS value update in ext_rx_stats Thiraviyam Mariyappan
2025-09-20 15:55 ` Jeff Johnson
2025-10-07 13:31   ` Thiraviyam Mariyappan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox