[PATCH 1/3] nl80211: Only do station mode fallback for -EOPNOTSUPP
Benjamin Berg
benjamin at sipsolutions.net
Thu Oct 16 07:37:52 PDT 2025
From: Benjamin Berg <benjamin.berg at intel.com>
If the AP interface does not support scanning (or if
NL80211_SCAN_FLAG_AP is not set), then mac80211 will report -EOPNOTSUPP.
Only in this case it makes sense to try switching the interface type. So
change the restriction and drop the now unreachable code. Note that in
the case of MLD we will still never try to do an interface switch as
there is a check for valid_links later on.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
src/drivers/driver_nl80211_scan.c | 39 +++----------------------------
1 file changed, 3 insertions(+), 36 deletions(-)
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 6fa99f45b6..b39943f60d 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -420,43 +420,10 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss,
if (ret) {
wpa_printf(MSG_DEBUG, "nl80211: Scan trigger failed: ret=%d "
"(%s)", ret, strerror(-ret));
- if (drv->hostapd && is_ap_interface(drv->nlmode)) {
-#ifdef CONFIG_IEEE80211BE
- /* For multi link BSS, retry scan if any other links
- * are busy scanning. */
- if (ret == -EBUSY &&
- nl80211_link_valid(bss->valid_links,
- params->link_id)) {
- struct i802_bss *link_bss;
- u8 link_id;
-
- wpa_printf(MSG_DEBUG,
- "nl80211: Scan trigger on multi link BSS failed (requested link=%d on interface %s)",
- params->link_id, bss->ifname);
-
- for (link_bss = drv->first_bss; link_bss;
- link_bss = link_bss->next) {
- if (link_bss->scan_link)
- break;
- }
-
- if (!link_bss) {
- wpa_printf(MSG_DEBUG,
- "nl80211: BSS information already running scan not available");
- goto fail;
- }
-
- link_id = nl80211_get_link_id_from_link(
- link_bss, link_bss->scan_link);
- wpa_printf(MSG_DEBUG,
- "nl80211: Scan already running on interface %s link %d",
- link_bss->ifname, link_id);
- goto fail;
- }
-#endif /* CONFIG_IEEE80211BE */
-
+ if (ret == -EOPNOTSUPP &&
+ drv->hostapd && is_ap_interface(drv->nlmode)) {
/*
- * mac80211 does not allow scan requests in AP mode, so
+ * mac80211 may not allow scan requests in AP mode, so
* try to do this in station mode. Do so only if there
* are not active links in the AP MLD.
*/
--
2.51.0
More information about the Hostap
mailing list