Search Linux Wireless

Re: WARNING check-sdata-in-driver in ieee80211_link_info_change_notify

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

 



Hi Johannes,

Am 22.07.25 um 14:11 schrieb Johannes Berg:
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.

Before the mentioned commit __ieee80211_recalc_txpower() returns false and so ieee80211_link_info_change_notify() doesn't get called.


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.

I can confirm that with the code snippet (with an added curly brace) I don't get the warning anymore.

martin


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;





[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