Skip to contentSkip to conversation

ath11k: Fix Rx signal strength reporting

PATCH In review Vasanthakumar Thiagarajan 3 participants 6 messages Jun 13, 2019 – Jun 20, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ath11k: Fix Rx signal strength reporting

Since rssi in not reported in MSDU_START tlv, current signal strength reporting is always wrong. Correct rssi is reported in PPDU_END tlv. Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in monitor status by default. Pass the sta's Rx signal strength to mac80211 in sta_statistics() ops. This patch also makes sure the default rx filter is always enabled whenever there is a call to reset the filter (from extd_rx_stats debugfs and config_filter path). Since some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

---

V2:

- Rebase on top of latest ath11k-bringup

 drivers/net/wireless/ath/ath11k/core.h   |  1 +
 drivers/net/wireless/ath/ath11k/debug.c  |  2 ++
 drivers/net/wireless/ath/ath11k/dp_rx.c  | 11 ++----
 drivers/net/wireless/ath/ath11k/dp_tx.c  |  2 ++
 drivers/net/wireless/ath/ath11k/hal_rx.c |  4 +++
 drivers/net/wireless/ath/ath11k/mac.c    | 60 ++++++++++++++++++++++++++------
 drivers/net/wireless/ath/ath11k/mac.h    |  2 ++
 7 files changed, 63 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +1 -0
index 038f905..dc5cf68 100644
@@ -237,6 +237,7 @@ struct ath11k_rx_peer_stats {
 	u64 tid_count[IEEE80211_NUM_TIDS + 1];
 	u64 pream_cnt[HAL_RX_PREAMBLE_MAX];
 	u64 reception_type[HAL_RX_RECEPTION_TYPE_MAX];
+	u32 rssi_comb;
 };
 
 struct ath11k_peer {
drivers/net/wireless/ath/ath11k/debug.c +2 -0
index e22e1c8..b1b4fcf 100644
@@ -828,6 +828,8 @@ static ssize_t ath11k_write_extd_rx_stats(struct file *file,
 		tlv_filter.pkt_filter_flags2 = HTT_RX_FP_CTRL_FILTER_FLASG2;
 		tlv_filter.pkt_filter_flags3 = HTT_RX_FP_CTRL_FILTER_FLASG3 |
 			HTT_RX_FP_DATA_FILTER_FLASG3;
+	} else {
+		tlv_filter = mon_status_filter_default;
 	}
 
 	ring_id = ar->dp.rx_mon_status_refill_ring.refill_buf_ring.ring_id;
drivers/net/wireless/ath/ath11k/dp_rx.c +3 -8
index 55148ff..fcb93a1 100644
@@ -1771,11 +1771,6 @@ static void ath11k_dp_rx_h_ppdu(struct ath11k *ar, void *rx_desc,
 
 	rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
-	/* TODO: Use real NF instead of default one */
-	rx_status->signal = ath11k_dp_rx_h_msdu_start_rssi(rx_desc) +
-			    ATH11K_DEFAULT_NOISE_FLOOR;
-	rx_status->flag &= ~RX_FLAG_NO_SIGNAL_VAL;
-
 	channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc);
 
 	if (channel_num >= 1 && channel_num <= 14) {
@@ -2162,6 +2157,8 @@ static void ath11k_dp_rx_update_peer_stats(struct ath11k_sta *arsta,
 
 	rx_stats->num_mpdu_fcs_ok += ppdu_info->num_mpdu_fcs_ok;
 	rx_stats->num_mpdu_fcs_err += ppdu_info->num_mpdu_fcs_err;
+
+	rx_stats->rssi_comb = ppdu_info->rssi_comb;
 }
 
 static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab,
@@ -2484,9 +2481,7 @@ static void ath11k_dp_rx_frag_h_mpdu(struct ath11k *ar,
 	rx_status->encoding = RX_ENC_LEGACY;
 	rx_status->bw = RATE_INFO_BW_20;
 
-	/* TODO: Use real NF instead of default one */
-	rx_status->signal = ath11k_dp_rx_h_msdu_start_rssi(rx_desc) +
-			    ATH11K_DEFAULT_NOISE_FLOOR;
+	rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL;
 
 	rx_channel = ath11k_dp_rx_h_msdu_start_freq(rx_desc);
 
drivers/net/wireless/ath/ath11k/dp_tx.c +2 -0
index 5670796..27ee47d 100644
@@ -931,6 +931,8 @@ int ath11k_dp_htt_monitor_mode_ring_config(struct ath11k *ar, bool reset)
 	if (!reset)
 		tlv_filter.rx_filter =
 				HTT_RX_MON_FILTER_TLV_FLAGS_MON_STATUS_RING;
+	else
+		tlv_filter = mon_status_filter_default;
 
 	ret = ath11k_dp_htt_rx_filter_setup(ar->ab, ring_id, dp->mac_id,
 					    HAL_RXDMA_MONITOR_STATUS,
drivers/net/wireless/ath/ath11k/hal_rx.c +4 -0
index c37340f..0308089 100644
@@ -1129,6 +1129,10 @@ void ath11k_hal_reo_hw_setup(struct ath11k_base *ab,
 		struct hal_rx_phyrx_rssi_legacy_info *rssi =
 			(struct hal_rx_phyrx_rssi_legacy_info *)tlv_data;
 
+		/* TODO: Please note that the combined rssi will not be accurate
+		 * in MU case. Rssi in MU needs to be retrieved from
+		 * PHYRX_OTHER_RECEIVE_INFO TLV.
+		 */
 		ppdu_info->rssi_comb =
 			FIELD_GET(HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO1_RSSI_COMB,
 				  __le32_to_cpu(rssi->info0));
drivers/net/wireless/ath/ath11k/mac.c +49 -11

106 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/mac.h +2 -0
index 586e016..c1a55a9 100644
@@ -164,6 +164,8 @@ struct ath11k_generic_iter {
 
 #define ATH11K_CHAN_WIDTH_NUM			8
 
+extern const struct htt_rx_ring_tlv_filter mon_status_filter_default;
+
 int ath11k_mac_create(struct ath11k_base *ab);
 void ath11k_mac_destroy(struct ath11k_base *ab);
 void ath11k_mac_unregister(struct ath11k_base *ab);
Signature · 7 lines
1.9.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 11 lines · Vasanthakumar Thiagarajan

Since rssi in not reported in MSDU_START tlv, current signal strength reporting is always wrong. Correct rssi is reported in PPDU_END tlv. Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in monitor status by default. Pass the sta's Rx signal strength to mac80211 in sta_statistics() ops. This patch also makes sure the default rx filter is always enabled whenever there is a call to reset the filter (from extd_rx_stats debugfs and config_filter path). Since some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

This had a conflict and 3-way merge didn't work as the SHA ids were not valid. Please always try to use ath11k-bringup branch as the baseline (and no extra patches), that helps my conflict resolution a lot.

Applied patch drivers/net/wireless/ath/ath11k/core.h cleanly. Applied patch drivers/net/wireless/ath/ath11k/debug.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/dp_rx.c cleanly. Applying patch drivers/net/wireless/ath/ath11k/dp_tx.c with 1 reject... Rejected hunk #1.
Applied patch drivers/net/wireless/ath/ath11k/hal_rx.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.h cleanly. Patch failed at 0001 ath11k: Fix Rx signal strength reporting

I fixed the conflict in dp_tx.c, that was pretty easy. Also I fixed one compilation error due to dp function renames. Also I removed ath11k_dp_rx_h_msdu_start_rssi() as GCC warned that it's unused.

Signature · 9 lines
https://patchwork.kernel.org/patch/10991095/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw
Quoted 28 lines · Kalle Valo
Quoted 11 lines · Vasanthakumar Thiagarajan

Since rssi in not reported in MSDU_START tlv, current signal strength reporting is always wrong. Correct rssi is reported in PPDU_END tlv. Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in monitor status by default. Pass the sta's Rx signal strength to mac80211 in sta_statistics() ops. This patch also makes sure the default rx filter is always enabled whenever there is a call to reset the filter (from extd_rx_stats debugfs and config_filter path). Since some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

This had a conflict and 3-way merge didn't work as the SHA ids were not valid. Please always try to use ath11k-bringup branch as the baseline (and no extra patches), that helps my conflict resolution a lot.

Applied patch drivers/net/wireless/ath/ath11k/core.h cleanly. Applied patch drivers/net/wireless/ath/ath11k/debug.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/dp_rx.c cleanly. Applying patch drivers/net/wireless/ath/ath11k/dp_tx.c with 1 reject... Rejected hunk #1.
Applied patch drivers/net/wireless/ath/ath11k/hal_rx.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.h cleanly. Patch failed at 0001 ath11k: Fix Rx signal strength reporting

Quoted 3 lines

I fixed the conflict in dp_tx.c, that was pretty easy. Also I fixed one compilation error due to dp function renames. Also I removed ath11k_dp_rx_h_msdu_start_rssi() as GCC warned that it's unused.

Oops, I forgot to add the link to the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending-ath11k&id=b36e8ecd8b4e7000a2844db022601890e0b1b39d

Please check carefully my changes.

Oh, and I also added mac_ prefix to mon_status_filter_default.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw

Kalle,

Thank for fixing things. It looks good. Sorry for the trouble, I'll be more careful next time.

Vasanth

-----Original Message-----
From: ath11k <[email protected]> On Behalf Of Kalle Valo
Sent: Monday, June 17, 2019 9:04 PM
To: [email protected]
Cc: [email protected]
Subject: [EXT] Re: [PATCH V2] ath11k: Fix Rx signal strength reporting

Quoted 28 lines · Kalle Valo
Quoted 11 lines · Vasanthakumar Thiagarajan

Since rssi in not reported in MSDU_START tlv, current signal strength
reporting is always wrong. Correct rssi is reported in PPDU_END tlv.
Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in
monitor status by default. Pass the sta's Rx signal strength to
mac80211 in sta_statistics() ops. This patch also makes sure the
default rx filter is always enabled whenever there is a call to reset
the filter (from extd_rx_stats debugfs and config_filter path). Since
some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

This had a conflict and 3-way merge didn't work as the SHA ids were not valid. Please always try to use ath11k-bringup branch as the baseline (and no extra patches), that helps my conflict resolution a lot.

Applied patch drivers/net/wireless/ath/ath11k/core.h cleanly. Applied patch drivers/net/wireless/ath/ath11k/debug.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/dp_rx.c cleanly. Applying patch drivers/net/wireless/ath/ath11k/dp_tx.c with 1 reject... Rejected hunk #1.
Applied patch drivers/net/wireless/ath/ath11k/hal_rx.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.h cleanly. Patch failed at 0001 ath11k: Fix Rx signal strength reporting

Quoted 3 lines

I fixed the conflict in dp_tx.c, that was pretty easy. Also I fixed one compilation error due to dp function renames. Also I removed ath11k_dp_rx_h_msdu_start_rssi() as GCC warned that it's unused.

Oops, I forgot to add the link to the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending-ath11k&id=b36e8ecd8b4e7000a2844db022601890e0b1b39d

Please check carefully my changes.

Oh, and I also added mac_ prefix to mon_status_filter_default.

--
Kalle Valo

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k

#4 lore raw
In reply to Kalle Valo
Quoted 34 lines · Kalle Valo
Quoted 28 lines · Kalle Valo
Quoted 11 lines · Vasanthakumar Thiagarajan

Since rssi in not reported in MSDU_START tlv, current signal strength reporting is always wrong. Correct rssi is reported in PPDU_END tlv. Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in monitor status by default. Pass the sta's Rx signal strength to mac80211 in sta_statistics() ops. This patch also makes sure the default rx filter is always enabled whenever there is a call to reset the filter (from extd_rx_stats debugfs and config_filter path). Since some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

This had a conflict and 3-way merge didn't work as the SHA ids were not valid. Please always try to use ath11k-bringup branch as the baseline (and no extra patches), that helps my conflict resolution a lot.

Applied patch drivers/net/wireless/ath/ath11k/core.h cleanly. Applied patch drivers/net/wireless/ath/ath11k/debug.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/dp_rx.c cleanly. Applying patch drivers/net/wireless/ath/ath11k/dp_tx.c with 1 reject... Rejected hunk #1.
Applied patch drivers/net/wireless/ath/ath11k/hal_rx.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.c cleanly. Applied patch drivers/net/wireless/ath/ath11k/mac.h cleanly. Patch failed at 0001 ath11k: Fix Rx signal strength reporting

Quoted 3 lines

I fixed the conflict in dp_tx.c, that was pretty easy. Also I fixed one compilation error due to dp function renames. Also I removed ath11k_dp_rx_h_msdu_start_rssi() as GCC warned that it's unused.

Quoted 7 lines

Oops, I forgot to add the link to the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending-ath11k&id=b36e8ecd8b4e7000a2844db022601890e0b1b39d

Please check carefully my changes.

Oh, and I also added mac_ prefix to mon_status_filter_default.

Actually, I changed the prefix ath11k_mac_ to make the style consistent.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#5 lore raw
In reply to Vasanthakumar Thiagarajan
Quoted 11 lines · Vasanthakumar Thiagarajan

Since rssi in not reported in MSDU_START tlv, current signal strength reporting is always wrong. Correct rssi is reported in PPDU_END tlv. Enable PPDU_END, PPDU_END_STATUS_DONE and MPDU_START tlv reporting in monitor status by default. Pass the sta's Rx signal strength to mac80211 in sta_statistics() ops. This patch also makes sure the default rx filter is always enabled whenever there is a call to reset the filter (from extd_rx_stats debugfs and config_filter path). Since some of the rx_stats are enabled by default, make memory allocation of arsta->rx_stats unconditional.

Patch applied to ath11k-bringup branch of ath.git, thanks.

ecdb3adeda5c ath11k: Fix Rx signal strength reporting

Signature · 9 lines
https://patchwork.kernel.org/patch/10991095/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k