Search Linux Wireless

[PATCH] mac80211: ethtool: check link sta if deflink sta not found.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Greear <greearb@xxxxxxxxxxxxxxx>

While testing with wifi-7 radio put into AX mode, link-0 is created.
sdata->deflink.u.mgd.bssid was 00 in this case, so sta was not
found.

Use link-0 for sta if it is available to do a better job of reporting
ethtool stats.

Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx>
---
 net/mac80211/ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index 6bd7fba8a867..1b58304fc68a 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -96,6 +96,7 @@ static void ieee80211_get_stats2(struct net_device *dev,
 	struct ieee80211_local *local = sdata->local;
 	struct station_info sinfo;
 	struct survey_info survey;
+	struct ieee80211_link_data *link;
 	int i, q;
 	int z;
 #define STA_STATS_SURVEY_LEN 7
@@ -128,6 +129,12 @@ static void ieee80211_get_stats2(struct net_device *dev,
 	if (sdata->vif.type == NL80211_IFTYPE_STATION) {
 		sta = sta_info_get_bss(sdata, sdata->deflink.u.mgd.bssid);
 
+		if (!sta) {
+			link = sdata_dereference(sdata->link[0], sdata);
+			if (link)
+				sta = sta_info_get_bss(sdata, link->u.mgd.bssid);
+		}
+
 		if (!(sta && !WARN_ON(sta->sdata->dev != dev)))
 			goto do_survey;
 
-- 
2.40.0




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux