Commit c57e5b98 authored by Johannes Berg's avatar Johannes Berg
Browse files

wifi: mac80211: fix WARN_ON for monitor mode on some devices



On devices without WANT_MONITOR_VIF (and probably without
channel context support) we get a WARN_ON for changing the
per-link setting of a monitor interface.

Since we already skip AP_VLAN interfaces and MONITOR with
WANT_MONITOR_VIF and/or NO_VIRTUAL_MONITOR should update
the settings, catch this in the link change code instead
of the warning.

Reported-by: default avatarMartin Kaistra <martin.kaistra@linutronix.de>
Link: https://lore.kernel.org/r/a9de62a0-28f1-4981-84df-253489da74ed@linutronix.de/


Fixes: c4382d5c ("wifi: mac80211: update the right link for tx power")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 204bb852
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -408,8 +408,19 @@ 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;