diff mbox series

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

Message ID 20240307182024.3224197-1-greearb@candelatech.com
State New
Headers show
Series wifi: mac80211: Report bss-color in ethtool stats. | expand

Commit Message

Ben Greear March 7, 2024, 6:20 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Provide efficient way to read current bss color.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/ethtool.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index 99f6174a9d69..6058834db228 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -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 */