Skip to contentSkip to conversation

wifi: mac80211: Report bss-color in ethtool stats.

PATCH New [email protected] 1 participant 1 message Mar 7, 2024 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mac80211: Report bss-color in ethtool stats.

From: Ben Greear <[email protected]>

Provide efficient way to read current bss color.

---
 net/mac80211/ethtool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
net/mac80211/ethtool.c +7 -1
index 99f6174a9d69..6058834db228 100644
@@ -51,7 +51,8 @@ static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
 	"rx_duplicates", "rx_fragments", "rx_dropped",
 	"tx_packets", "tx_bytes",
 	"tx_filtered", "tx_retry_failed", "tx_retries",
-	"sta_state", "txrate", "rxrate", "signal",
+	"sta_state", "txrate", "rxrate", "signal", "bss_color",
+	/* Add new stats above here, channel and others go below */
 	"channel", "noise", "ch_time", "ch_time_busy",
 	"ch_time_ext_busy", "ch_time_rx", "ch_time_tx"
 };
@@ -151,6 +152,11 @@ static void ieee80211_get_stats(struct net_device *dev,
 		}
 	}
 
+	if (sdata->vif.bss_conf.he_bss_color.enabled)
+		data[i++] = sdata->vif.bss_conf.he_bss_color.color;
+	else
+		data[i++] = 0;
+
 do_survey:
 	i = STA_STATS_LEN - STA_STATS_SURVEY_LEN;
 	/* Get survey stats for current channel */
Signature · 1 line
2.42.0