* [PATCH wireless-next] wifi: mac80211: fix WARN_ON for monitor mode on some devices
@ 2025-07-22 15:25 Johannes Berg
2025-07-22 20:27 ` kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2025-07-22 15:25 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Martin Kaistra
From: Johannes Berg <johannes.berg@intel.com>
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: Martin Kaistra <martin.kaistra@linutronix.de>
Link: https://lore.kernel.org/r/a9de62a0-28f1-4981-84df-253489da74ed@linutronix.de/
Fixes: c4382d5ca1af ("wifi: mac80211: update the right link for tx power")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/main.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 6b6de43d9420..63393eabc501 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -407,9 +407,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;
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH wireless-next] wifi: mac80211: fix WARN_ON for monitor mode on some devices
2025-07-22 15:25 [PATCH wireless-next] wifi: mac80211: fix WARN_ON for monitor mode on some devices Johannes Berg
@ 2025-07-22 20:27 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-07-22 20:27 UTC (permalink / raw)
To: Johannes Berg, linux-wireless
Cc: oe-kbuild-all, Johannes Berg, Martin Kaistra
Hi Johannes,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.16-rc7 next-20250722]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Johannes-Berg/wifi-mac80211-fix-WARN_ON-for-monitor-mode-on-some-devices/20250722-233552
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/r/20250722152517.30340-2-johannes%40sipsolutions.net
patch subject: [PATCH wireless-next] wifi: mac80211: fix WARN_ON for monitor mode on some devices
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20250723/202507230413.YIpXeSjn-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250723/202507230413.YIpXeSjn-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507230413.YIpXeSjn-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
net/mac80211/main.c: In function 'ieee80211_link_info_change_notify':
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_UNSPECIFIED' not handled in switch [-Wswitch]
414 | switch (sdata->vif.type)
| ^~~~~~
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_ADHOC' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_STATION' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_AP' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_WDS' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_MONITOR' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_MESH_POINT' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_P2P_CLIENT' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_P2P_GO' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_P2P_DEVICE' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_OCB' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_NAN' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NUM_NL80211_IFTYPES' not handled in switch [-Wswitch]
>> net/mac80211/main.c:414:9: warning: enumeration value 'NL80211_IFTYPE_MAX' not handled in switch [-Wswitch]
>> net/mac80211/main.c:417:9: error: case label not within a switch statement
417 | case NL80211_IFTYPE_MONITOR:
| ^~~~
>> net/mac80211/main.c:420:17: error: break statement not within loop or switch
420 | break;
| ^~~~~
>> net/mac80211/main.c:421:9: error: 'default' label not within a switch statement
421 | default:
| ^~~~~~~
net/mac80211/main.c:422:17: error: break statement not within loop or switch
422 | break;
| ^~~~~
net/mac80211/main.c: At top level:
>> net/mac80211/main.c:425:9: error: expected identifier or '(' before 'if'
425 | if (!check_sdata_in_driver(sdata))
| ^~
In file included from net/mac80211/main.c:30:
>> net/mac80211/driver-ops.h:22:2: error: expected identifier or '(' before ')' token
22 | })
| ^
net/mac80211/main.c:425:14: note: in expansion of macro 'check_sdata_in_driver'
425 | if (!check_sdata_in_driver(sdata))
| ^~~~~~~~~~~~~~~~~~~~~
>> net/mac80211/main.c:428:49: error: expected ')' before '->' token
428 | drv_link_info_changed(local, sdata, link->conf, link->link_id, changed);
| ^~
| )
net/mac80211/main.c:429:1: error: expected identifier or '(' before '}' token
429 | }
| ^
vim +417 net/mac80211/main.c
402
403 void ieee80211_link_info_change_notify(struct ieee80211_sub_if_data *sdata,
404 struct ieee80211_link_data *link,
405 u64 changed)
406 {
407 struct ieee80211_local *local = sdata->local;
408
409 WARN_ON_ONCE(changed & BSS_CHANGED_VIF_CFG_FLAGS);
410
411 if (!changed)
412 return;
413
> 414 switch (sdata->vif.type)
415 case NL80211_IFTYPE_AP_VLAN:
416 return;
> 417 case NL80211_IFTYPE_MONITOR:
418 if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
419 return;
> 420 break;
> 421 default:
422 break;
423 }
424
> 425 if (!check_sdata_in_driver(sdata))
426 return;
427
> 428 drv_link_info_changed(local, sdata, link->conf, link->link_id, changed);
> 429 }
430
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-22 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 15:25 [PATCH wireless-next] wifi: mac80211: fix WARN_ON for monitor mode on some devices Johannes Berg
2025-07-22 20:27 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox