From: Youghandhar Chintala <quic_youghand@quicinc.com>
To: <ath11k@lists.infradead.org>
Cc: <linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<quic_mpubbise@quicinc.com>,
Youghandhar Chintala <quic_youghand@quicinc.com>
Subject: [PATCH 3/3] wifi: ath11k: Populate the signal average field properly
Date: Tue, 4 Apr 2023 12:52:34 +0530 [thread overview]
Message-ID: <20230404072234.18503-4-quic_youghand@quicinc.com> (raw)
In-Reply-To: <20230404072234.18503-1-quic_youghand@quicinc.com>
Currently on WCN6750, we are seeing an issue where signal average field
value in station dump is incorrect. Signal average field is populated
without checking for dB to dBm conversion. For WCN6750 devices, the
signal average value is already in dBm units, so no need to convert it
again.
If signal average is valid, then fill it based on dB to dBm conversion
condition to fix this.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com>
---
drivers/net/wireless/ath/ath11k/mac.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index cad832e0e6b8..531a881d8623 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -8278,7 +8278,7 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
{
struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
struct ath11k *ar = arsta->arvif->ar;
- s8 signal;
+ s8 signal, signal_avg;
bool db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
ar->ab->wmi_ab.svc_map);
@@ -8330,9 +8330,12 @@ 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->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
+ signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi);
+ if (signal_avg) {
+ sinfo->signal_avg = db2dbm ? signal_avg : signal_avg + ATH11K_DEFAULT_NOISE_FLOOR;
+ sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
+ }
+
}
#if IS_ENABLED(CONFIG_IPV6)
--
2.38.0
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
prev parent reply other threads:[~2023-04-04 7:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 7:22 [PATCH 0/3] wifi: ath11k: Fix incorrect signal avg in station dump on WCN6750 Youghandhar Chintala
2023-04-04 7:22 ` [PATCH 1/3] wifi: ath11k: Use proper API to get peer id for WCN6750 Youghandhar Chintala
2023-04-04 7:22 ` [PATCH 2/3] wifi: ath11k: Align RX MPDU info with the hardware " Youghandhar Chintala
2023-04-04 7:22 ` Youghandhar Chintala [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230404072234.18503-4-quic_youghand@quicinc.com \
--to=quic_youghand@quicinc.com \
--cc=ath11k@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_mpubbise@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox