ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ath11k: add sta_statistics callback
@ 2019-05-23 10:44 John Crispin
  2019-05-23 10:44 ` [PATCH 2/2] ath11k: properly convert bw John Crispin
  2019-05-29 15:08 ` [PATCH 1/2] ath11k: add sta_statistics callback Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: John Crispin @ 2019-05-23 10:44 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Shashidhar Lakkavalli, ath11k, John Crispin

Add the callback allowing us to pass the rates to userland for iw tool
to display.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 1bdb6c949585..5bac07ce18bf 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5023,6 +5023,33 @@ static int ath11k_get_survey(struct ieee80211_hw *hw, int idx,
 	return ret;
 }
 
+static void ath11k_sta_statistics(struct ieee80211_hw *hw,
+				  struct ieee80211_vif *vif,
+				  struct ieee80211_sta *sta,
+				  struct station_info *sinfo)
+{
+	struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
+
+	sinfo->rx_duration = arsta->rx_duration;
+	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
+
+	if (!arsta->txrate.legacy && !arsta->txrate.nss)
+		return;
+
+	if (arsta->txrate.legacy) {
+		sinfo->txrate.legacy = arsta->txrate.legacy;
+	} else {
+		sinfo->txrate.mcs = arsta->txrate.mcs;
+		sinfo->txrate.nss = arsta->txrate.nss;
+		sinfo->txrate.bw = arsta->txrate.bw;
+		sinfo->txrate.he_gi = arsta->txrate.he_gi;
+		sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
+		sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
+	}
+	sinfo->txrate.flags = arsta->txrate.flags;
+	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+}
+
 static const struct ieee80211_ops ath11k_ops = {
 	.tx				= ath11k_mac_op_tx,
 	.start                          = ath11k_start,
@@ -5053,6 +5080,7 @@ static const struct ieee80211_ops ath11k_ops = {
 	.set_bitrate_mask		= ath11k_mac_op_set_bitrate_mask,
 	.get_survey			= ath11k_get_survey,
 	.flush				= ath11k_flush,
+	.sta_statistics			= ath11k_sta_statistics,
 	CFG80211_TESTMODE_CMD(ath11k_tm_cmd)
 #ifdef CONFIG_MAC80211_DEBUGFS
 	.sta_add_debugfs		= ath11k_sta_add_debugfs,
-- 
2.20.1


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

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

* [PATCH 2/2] ath11k: properly convert bw
  2019-05-23 10:44 [PATCH 1/2] ath11k: add sta_statistics callback John Crispin
@ 2019-05-23 10:44 ` John Crispin
  2019-05-29 15:08 ` [PATCH 1/2] ath11k: add sta_statistics callback Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: John Crispin @ 2019-05-23 10:44 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Shashidhar Lakkavalli, ath11k, John Crispin

The bandwidth inside the TX reporting code is not properly converted from
ath11k values to the rate_info ones.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 71d385cf55d7..38cc787671ee 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -954,7 +954,7 @@ ath11k_update_per_peer_tx_stats(struct ath11k *ar,
 	}
 
 	arsta->txrate.nss = nss;
-	arsta->txrate.bw = bw;
+	arsta->txrate.bw = ath11k_bw_to_mac80211_bw(bw);
 	arsta->tx_info.status.rates[0].flags |= ath11k_bw_to_mac80211_bwflags(bw);
 
 	memcpy(&arsta->last_txrate, &arsta->txrate, sizeof(struct rate_info));
-- 
2.20.1


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

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

* Re: [PATCH 1/2] ath11k: add sta_statistics callback
  2019-05-23 10:44 [PATCH 1/2] ath11k: add sta_statistics callback John Crispin
  2019-05-23 10:44 ` [PATCH 2/2] ath11k: properly convert bw John Crispin
@ 2019-05-29 15:08 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-05-29 15:08 UTC (permalink / raw)
  To: John Crispin; +Cc: ath11k, Shashidhar Lakkavalli

John Crispin <john@phrozen.org> wrote:

> Add the callback allowing us to pass the rates to userland for iw tool
> to display.
> 
> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
> Signed-off-by: John Crispin <john@phrozen.org>

2 patches applied to ath.git, thanks.

4ae8ed9835a0 ath11k: add sta_statistics callback
d9a34e89f148 ath11k: properly convert bw

-- 
https://patchwork.kernel.org/patch/10957381/

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


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

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

end of thread, other threads:[~2019-05-29 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-23 10:44 [PATCH 1/2] ath11k: add sta_statistics callback John Crispin
2019-05-23 10:44 ` [PATCH 2/2] ath11k: properly convert bw John Crispin
2019-05-29 15:08 ` [PATCH 1/2] ath11k: add sta_statistics callback Kalle Valo

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