On Thu, 2025-07-10 at 09:47 +0200, Martin Kaistra wrote: > Hi, > > when trying to use monitor mode with either rtl8xxxu or rtlwifi driver I get a > "Failed check-sdata-in-driver check" warning in > ieee80211_link_info_change_notify(). Aside from the warning, monitor mode seems > to work fine. This might also affect other drivers, I just don't have the > hardware to test. > > I bisected and found that the warning started with c4382d5ca1af ("wifi: > mac80211: update the right link for tx power"). > > I can make the warning go away when I add WANT_MONITOR_VIF to the driver, but > the real fix should probably go in mac80211. Strange, I'm not sure I see the relation with the commit you mention. Either way though, given NO_VIRTUAL_MONITOR and WANT_MONITOR_VIF we probably have to catch it in the code, perhaps like the below? But I'm not sure it handles NO_VIRTUAL_MONITOR correctly? Hm. johannes diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 351564360c26..bf338024b5d5 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -408,9 +408,20 @@ void ieee80211_link_info_change_notify(struct ieee80211_sub_if_data *sdata, WARN_ON_ONCE(changed & BSS_CHANGED_VIF_CFG_FLAGS); - if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN) + if (!changed) return; + switch (sdata->vif.type) + case NL80211_IFTYPE_AP_VLAN: + return; + case NL80211_IFTYPE_MONITOR: + if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) + return; + break; + default: + break; + } + if (!check_sdata_in_driver(sdata)) return;