Skip to contentSkip to conversation

ath11k: properly convert peer stats

PATCH New John Crispin 1 participant 1 message Dec 17, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath11k: properly convert peer stats

From: Venkateswara Naralasetty <[email protected]>

The bandwidth was not converted from mac80211 to ath11k values correctly. This patch adds a helper function to do it for us.

---
 drivers/net/wireless/ath/ath11k/debugfs_sta.c | 24 ++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/debugfs_sta.c +23 -1
index d851d87e8a37..1d562133ae1e 100644
@@ -11,6 +11,28 @@
 #include "dp_tx.h"
 #include "debug_htt_stats.h"
 
+static u8 mac80211_bw_to_ath11k_bw(u8 bw)
+{
+	u8 ret = 0;
+
+	switch (bw) {
+	case RATE_INFO_BW_20:
+		ret = ATH11K_BW_20;
+		break;
+	case RATE_INFO_BW_40:
+		ret = ATH11K_BW_40;
+		break;
+	case RATE_INFO_BW_80:
+		ret = ATH11K_BW_80;
+		break;
+	case RATE_INFO_BW_160:
+		ret = ATH11K_BW_160;
+		break;
+	}
+
+	return ret;
+}
+
 void
 ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
 				    struct ath11k_per_peer_tx_stats *peer_stats,
@@ -26,7 +48,7 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta,
 	tx_stats = arsta->tx_stats;
 	gi = FIELD_GET(RATE_INFO_FLAGS_SHORT_GI, arsta->txrate.flags);
 	mcs = txrate->mcs;
-	bw = txrate->bw;
+	bw = mac80211_bw_to_ath11k_bw(txrate->bw);
 	nss = txrate->nss - 1;
 
 #define STATS_OP_FMT(name) tx_stats->stats[ATH11K_STATS_TYPE_##name]
Signature · 7 lines
2.20.1


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