]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: ethtool: add monitor channel reporting
authorDylan Eskew <dylan.eskew@candelatech.com>
Wed, 13 Nov 2024 14:46:08 +0000 (06:46 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 4 Dec 2024 15:39:06 +0000 (16:39 +0100)
When running ethtool on a monitor interface, the channel
wasn't reporting properly. This adds logic to properly report
the channel for monitor interfaces in ethtool.

Signed-off-by: Dylan Eskew <dylan.eskew@candelatech.com>
Link: https://patch.msgid.link/20241113144608.334060-1-dylan.eskew@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ethtool.c

index 069aa05139cd47af24badb0652fce8e27ba631b2..42f7ee142ce3f4dd5a4d50dcf59acb783fd7aaa7 100644 (file)
@@ -157,6 +157,10 @@ do_survey:
        chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
        if (chanctx_conf)
                channel = chanctx_conf->def.chan;
+       else if (local->open_count > 0 &&
+                local->open_count == local->monitors &&
+                sdata->vif.type == NL80211_IFTYPE_MONITOR)
+               channel = local->monitor_chanreq.oper.chan;
        else
                channel = NULL;
        rcu_read_unlock();