[PATCH 2/3] nl80211: Support scanning as AP when not beaconing
Benjamin Berg
benjamin at sipsolutions.net
Thu Oct 16 07:37:53 PDT 2025
From: Ilan Peer <ilan.peer at intel.com>
If the kernel indicated support for scanning on AP interface,
set NL80211_SCAN_FLAG_AP in the scan request when the interface is not
yet beaconing. In that case, it is possible to do a scan without
interfering with normal AP operation so it is safe to set the flag.
This is important because otherwise it may not be possible to do the
appropriate scans required to bring up an interface that is part of an
MLD.
type=feature
ticket=none
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_capa.c | 5 +++++
src/drivers/driver_nl80211_scan.c | 8 ++++++++
3 files changed, 14 insertions(+)
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 3d5eb493d6..df97658332 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -210,6 +210,7 @@ struct wpa_driver_nl80211_data {
unsigned int puncturing:1;
unsigned int qca_ap_allowed_freqs:1;
unsigned int connect_ext_vendor_cmd_avail:1;
+ unsigned int support_ap_scan:1;
u8 extra_bss_membership_selectors[8];
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 2aba1f9a42..aed2774dce 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -82,6 +82,7 @@ struct wiphy_info_data {
unsigned int update_ft_ies_supported:1;
unsigned int has_key_mgmt:1;
unsigned int has_key_mgmt_iftype:1;
+ unsigned int support_ap_scan:1;
};
@@ -789,6 +790,9 @@ static void wiphy_info_feature_flags(struct wiphy_info_data *info,
if (flags & NL80211_FEATURE_FULL_AP_CLIENT_STATE)
capa->flags |= WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE;
+
+ if (flags & NL80211_FEATURE_AP_SCAN)
+ info->support_ap_scan = 1;
}
@@ -1583,6 +1587,7 @@ int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
if (info.set_qos_map_supported)
drv->capa.flags |= WPA_DRIVER_FLAGS_QOS_MAPPING;
drv->have_low_prio_scan = info.have_low_prio_scan;
+ drv->support_ap_scan = info.support_ap_scan;
/*
* If the driver doesn't support data TX status, we won't get TX
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index b39943f60d..3931d56b11 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -272,6 +272,14 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
scan_flags |= NL80211_SCAN_FLAG_AP;
}
+ if (drv->support_ap_scan && is_ap_interface(drv->nlmode) &&
+ !nl80211_get_link(bss, params->link_id)->beacon_set) {
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Add NL80211_SCAN_FLAG_AP for scan for link %d that is not beaconing",
+ params->link_id);
+ scan_flags |= NL80211_SCAN_FLAG_AP;
+ }
+
if (params->only_new_results) {
wpa_printf(MSG_DEBUG, "nl80211: Add NL80211_SCAN_FLAG_FLUSH");
scan_flags |= NL80211_SCAN_FLAG_FLUSH;
--
2.51.0
More information about the Hostap
mailing list