ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Shashidhar Lakkavalli <slakkavalli@datto.com>,
	ath11k@lists.infradead.org, John Crispin <john@phrozen.org>
Subject: [PATCH V6 09/11] ath11k: add sta_statistics callback
Date: Tue, 28 May 2019 08:48:01 +0200	[thread overview]
Message-ID: <20190528064803.24419-10-john@phrozen.org> (raw)
In-Reply-To: <20190528064803.24419-1-john@phrozen.org>

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 68bfd46a9776..06fc62307f4e 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -5002,6 +5002,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,
@@ -5032,6 +5059,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

  parent reply	other threads:[~2019-05-28  6:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28  6:47 [PATCH V6 00/11] ath11k: add HE support John Crispin
2019-05-28  6:47 ` [PATCH V6 01/11] mac80211: propagate HE operation info into bss_conf John Crispin
2019-05-28  6:47 ` [PATCH V6 02/11] ath11k: fix some whitespace errors John Crispin
2019-05-28  6:47 ` [PATCH V6 03/11] ath11k: move phymode selection from function to array lookup John Crispin
2019-05-29 15:47   ` Kalle Valo
2019-05-28  6:47 ` [PATCH V6 04/11] ath11k: add HE handling to the debug code John Crispin
2019-05-28  6:47 ` [PATCH V6 05/11] ath11k: extend reading of FW capabilities John Crispin
2019-05-28  6:47 ` [PATCH V6 06/11] ath11k: add defines for max MCS rates per phymode John Crispin
2019-05-28  6:47 ` [PATCH V6 07/11] ath11k: handle rx status for HE frames John Crispin
2019-05-28  6:48 ` [PATCH V6 08/11] ath11k: add HE support John Crispin
2019-05-28  6:48 ` John Crispin [this message]
2019-05-29 15:30   ` [PATCH V6 09/11] ath11k: add sta_statistics callback Kalle Valo
2019-05-28  6:48 ` [PATCH V6 10/11] ath11k: properly convert bw John Crispin
2019-05-29 15:31   ` Kalle Valo
2019-05-28  6:48 ` [PATCH V6 11/11] ath11k: add HE rate reporting John Crispin

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=20190528064803.24419-10-john@phrozen.org \
    --to=john@phrozen.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --cc=slakkavalli@datto.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