From: Lingbo Kong Date: Sat, 9 Mar 2024 12:11:29 +0000 (+0800) Subject: wifi: ath11k: modify the calculation of the average signal strength in station mode X-Git-Tag: v6.11-rc1~163^2~49^2~44^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aadeee47e9d7ae98f7116f63fa63fcceffffc65c;p=thirdparty%2Fkernel%2Flinux.git wifi: ath11k: modify the calculation of the average signal strength in station mode 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 Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://patch.msgid.link/20240309121129.5379-1-quic_lingbok@quicinc.com --- diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index bb56160048ba5..779009774567f 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -8984,8 +8984,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); }