ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] wifi: ath11k: Fix incorrect signal avg in station dump on WCN6750
@ 2023-04-04  7:22 Youghandhar Chintala
  2023-04-04  7:22 ` [PATCH 1/3] wifi: ath11k: Use proper API to get peer id for WCN6750 Youghandhar Chintala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Youghandhar Chintala @ 2023-04-04  7:22 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless, linux-kernel, quic_mpubbise, Youghandhar Chintala

Currently on WCN6750, the average signal printed in the station dump
has invalid values. This is happening because of multiple reasons
in the driver.

This patches fixes this problem.

Station dump without fixes:

iw dev wlan0 station dump
Station 2c:30:33:d2:93:3f (on wlan0)
	inactive time:  16428 ms
	rx bytes:       91417
	rx packets:     642
	tx bytes:       4715
	tx packets:     31
	tx retries:     59
	tx failed:      0
	beacon loss:    0
	beacon rx:      294
	rx drop misc:   22
	signal:         -16 [-21, -20] dBm
	signal avg:     -95 dBm
	beacon signal avg:      -15 dBm
	tx bitrate:     650.0 MBit/s VHT-MCS 7 80MHz short GI VHT-NSS 2
	tx duration:    0 us
	rx bitrate:     6.0 MBit/s
	rx duration:    0 us
	authorized:     yes
	authenticated:  yes
	associated:     yes
	preamble:       long
	WMM/WME:        yes
	MFP:            no
	TDLS peer:      no
	DTIM period:    2
	beacon interval:100
	short slot time:yes
	connected time: 64 seconds

Station dump with fixes:
iw wlan0 station dump
Station 2c:30:33:d2:93:3f (on wlan0)
	inactive time:  4328 ms
	rx bytes:       10245
	rx packets:     3211
	tx bytes:       10245
	tx packets:     102
	tx retries:     72
	tx failed:      0
	beacon loss:    0
	beacon rx:      1506
	rx drop misc:   29
	signal:         -36 [-37, -45] dBm
	signal avg:     -37 dBm
	beacon signal avg:      -34 dBm
	tx bitrate:     866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
	tx duration:    0 us
	rx duration:    512633 us
	authorized:     yes
	authenticated:  yes
	associated:     yes
	preamble:       long
	WMM/WME:        yes
	MFP:            no
	TDLS peer:      no
	DTIM period:    2
	beacon interval:100
	short slot time:yes

Youghandhar Chintala (3):
  wifi: ath11k: Use proper API to get peer id for WCN6750
  wifi: ath11k: Align RX MPDU info with the hardware for WCN6750
  wifi: ath11k: Populate the signal average field properly

 drivers/net/wireless/ath/ath11k/hal_rx.h |  4 ++--
 drivers/net/wireless/ath/ath11k/hw.c     |  2 +-
 drivers/net/wireless/ath/ath11k/mac.c    | 11 +++++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

-- 
2.38.0


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* [PATCH 1/3] wifi: ath11k: Use proper API to get peer id for WCN6750
  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 ` 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 ` [PATCH 3/3] wifi: ath11k: Populate the signal average field properly Youghandhar Chintala
  2 siblings, 0 replies; 4+ messages in thread
From: Youghandhar Chintala @ 2023-04-04  7:22 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless, linux-kernel, quic_mpubbise, Youghandhar Chintala

Currently on WCN6750, we are seeing an issue where signal average field
value in station dump is incorrect. This is because of registering an
incorrect mpdu_info_get_peerid() API for WCN6750. Due to this, we get an
invalid peer id while processing the peer stats, and the signal average
field will have invalid values in station dump.

Fix this by registering correct mpdu_info_get_peerid() API for WCN6750.

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/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/hw.c b/drivers/net/wireless/ath/ath11k/hw.c
index 60ac215e0678..9321613721a0 100644
--- a/drivers/net/wireless/ath/ath11k/hw.c
+++ b/drivers/net/wireless/ath/ath11k/hw.c
@@ -1122,7 +1122,7 @@ const struct ath11k_hw_ops wcn6750_ops = {
 	.rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
 	.rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
 	.reo_setup = ath11k_hw_wcn6855_reo_setup,
-	.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
+	.mpdu_info_get_peerid = ath11k_hw_wcn6855_mpdu_info_get_peerid,
 	.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
 	.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
 	.get_ring_selector = ath11k_hw_wcn6750_get_tcl_ring_selector,
-- 
2.38.0


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* [PATCH 2/3] wifi: ath11k: Align RX MPDU info with the hardware for WCN6750
  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 ` Youghandhar Chintala
  2023-04-04  7:22 ` [PATCH 3/3] wifi: ath11k: Populate the signal average field properly Youghandhar Chintala
  2 siblings, 0 replies; 4+ messages in thread
From: Youghandhar Chintala @ 2023-04-04  7:22 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless, linux-kernel, quic_mpubbise, Youghandhar Chintala

Currently on WCN6750, we are seeing an issue where signal average field
value in station dump is incorrect. This is because RX MPDU info fields
in the driver are not properly aligned with the hardware. Due to this,
we get an invalid peer id while processing the peer stats, and the
signal avg value will not be updated.

Fix this by aligning the RX MPDU info in the driver with the hardware.
Change is applicable for WCN6855 as well.

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/hal_rx.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.h b/drivers/net/wireless/ath/ath11k/hal_rx.h
index f6bae07abfd3..1d5f92611b85 100644
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
@@ -414,9 +414,9 @@ struct hal_rx_mpdu_info {
 } __packed;
 
 struct hal_rx_mpdu_info_wcn6855 {
-	__le32 rsvd0[8];
+	__le32 rsvd0[10];
 	__le32 info0;
-	__le32 rsvd1[14];
+	__le32 rsvd1[12];
 } __packed;
 
 #define HAL_RX_PPDU_END_DURATION	GENMASK(23, 0)
-- 
2.38.0


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

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

* [PATCH 3/3] wifi: ath11k: Populate the signal average field properly
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Youghandhar Chintala @ 2023-04-04  7:22 UTC (permalink / raw)
  To: ath11k; +Cc: linux-wireless, linux-kernel, quic_mpubbise, Youghandhar Chintala

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

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

end of thread, other threads:[~2023-04-04  7:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 3/3] wifi: ath11k: Populate the signal average field properly Youghandhar Chintala

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