diff mbox series

wifi: ath11k: modify the calculation of the average signal strength in station mode

Message ID 20240309121129.5379-1-quic_lingbok@quicinc.com (mailing list archive)
State Accepted
Commit aadeee47e9d7ae98f7116f63fa63fcceffffc65c
Delegated to: Kalle Valo
Headers show
Series wifi: ath11k: modify the calculation of the average signal strength in station mode | expand

Commit Message

Lingbo Kong March 9, 2024, 12:11 p.m. UTC
Currently, the calculation of the average signal strength in station mode
is incorrect.

This is because before calculating the average signal strength, ath11k need
to determine whether the hardware and firmware support db2dbm, if the
hardware and firmware support db2dbm, do not need to add noise floor,
otherwise, need to add noise floor.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23

Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)


base-commit: 7a5ed5a3801e9b6cf7bafbb0a05c70cef620b22a

Comments

Jeff Johnson March 11, 2024, 6:18 p.m. UTC | #1
On 3/9/2024 4:11 AM, Lingbo Kong wrote:
> Currently, the calculation of the average signal strength in station mode
> is incorrect.
> 
> This is because before calculating the average signal strength, ath11k need
> to determine whether the hardware and firmware support db2dbm, if the
> hardware and firmware support db2dbm, do not need to add noise floor,
> otherwise, need to add noise floor.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Kalle Valo March 13, 2024, 4:20 p.m. UTC | #2
Lingbo Kong <quic_lingbok@quicinc.com> wrote:

> Currently, the calculation of the average signal strength in station mode
> is incorrect.
> 
> This is because before calculating the average signal strength, ath11k need
> to determine whether the hardware and firmware support db2dbm, if the
> hardware and firmware support db2dbm, do not need to add noise floor,
> otherwise, need to add noise floor.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

What about AP chipsets like QCN9074, do they also work similarly?
Lingbo Kong March 21, 2024, 2:55 a.m. UTC | #3
On 2024/3/14 0:20, Kalle Valo wrote:
> Lingbo Kong <quic_lingbok@quicinc.com> wrote:
> 
>> Currently, the calculation of the average signal strength in station mode
>> is incorrect.
>>
>> This is because before calculating the average signal strength, ath11k need
>> to determine whether the hardware and firmware support db2dbm, if the
>> hardware and firmware support db2dbm, do not need to add noise floor,
>> otherwise, need to add noise floor.
>>
>> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
>>
>> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> 
> What about AP chipsets like QCN9074, do they also work similarly?
> 

yes, i asked WIN's colleague Ashok Raj Nagarajan for helping to test 
this patch.
they work similarly.

Best regards
Lingbo Kong
Lingbo Kong April 14, 2024, 1:33 p.m. UTC | #4
On 2024/3/14 0:20, Kalle Valo wrote:
> Lingbo Kong <quic_lingbok@quicinc.com> wrote:
> 
>> Currently, the calculation of the average signal strength in station mode
>> is incorrect.
>>
>> This is because before calculating the average signal strength, ath11k need
>> to determine whether the hardware and firmware support db2dbm, if the
>> hardware and firmware support db2dbm, do not need to add noise floor,
>> otherwise, need to add noise floor.
>>
>> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
>>
>> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> 
> What about AP chipsets like QCN9074, do they also work similarly?
> 
Hi, kalle,

I observe this patch's status is deferred.
https://patchwork.kernel.org/project/linux-wireless/patch/20240309121129.5379-1-quic_lingbok@quicinc.com/

I think it belongs to bug-fix, so, could you please merge it? :)

Best regards
Lingbo Kong
Kalle Valo April 15, 2024, 4:09 p.m. UTC | #5
Lingbo Kong <quic_lingbok@quicinc.com> writes:

> On 2024/3/14 0:20, Kalle Valo wrote:
>> Lingbo Kong <quic_lingbok@quicinc.com> wrote:
>> 
>>> Currently, the calculation of the average signal strength in station mode
>>> is incorrect.
>>>
>>> This is because before calculating the average signal strength, ath11k need
>>> to determine whether the hardware and firmware support db2dbm, if the
>>> hardware and firmware support db2dbm, do not need to add noise floor,
>>> otherwise, need to add noise floor.
>>>
>>> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
>>>
>>> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
>>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
>> What about AP chipsets like QCN9074, do they also work similarly?
>> 
> Hi, kalle,
>
> I observe this patch's status is deferred.
> https://patchwork.kernel.org/project/linux-wireless/patch/20240309121129.5379-1-quic_lingbok@quicinc.com/
>
> I think it belongs to bug-fix, so, could you please merge it? :)

I need to test it first which takes time.
Kalle Valo June 19, 2024, 2 p.m. UTC | #6
Lingbo Kong <quic_lingbok@quicinc.com> wrote:

> Currently, the calculation of the average signal strength in station mode
> is incorrect.
> 
> This is because before calculating the average signal strength, ath11k need
> to determine whether the hardware and firmware support db2dbm, if the
> hardware and firmware support db2dbm, do not need to add noise floor,
> otherwise, need to add noise floor.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

aadeee47e9d7 wifi: ath11k: modify the calculation of the average signal strength in station mode
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index a6a37d67a50a..1f9cf7a42ba8 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8976,8 +8976,11 @@  static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
 		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
 	}
 
-	sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi) +
-		ATH11K_DEFAULT_NOISE_FLOOR;
+	sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi);
+
+	if (!db2dbm)
+		sinfo->signal_avg += ATH11K_DEFAULT_NOISE_FLOOR;
+
 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
 }