[PATCH] Add NonColoc6GHz and 6GHzOnly flags in wpa_supplicant scan
Kaidong Wang
kaidong at chromium.org
Thu Oct 5 12:23:45 PDT 2023
Handler function for "Scan" method call of a network device doesn't set
non_coloc_6ghz, therefore wpa_supplicant doesn't scan non-PSC channels
on 6GHz band only if a co-located AP was reported on the channel.
Add NonColoc6GHz and 6GHzOnly flags to the wpas_dbus_handler_scan, so
that dBus scan requests can cover non-PSC channels and scan only 6 GHz
channels.
Signed-off-by: Kaidong Wang <kaidong at chromium.org>
---
wpa_supplicant/dbus/dbus_new_handlers.c | 39 ++++++++++++++++++++-----
1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 67ce970d0..ddcf478ed 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1594,10 +1594,10 @@ static int wpas_dbus_get_scan_channels(DBusMessage *message,
}
-static int wpas_dbus_get_scan_allow_roam(DBusMessage *message,
- DBusMessageIter *var,
- dbus_bool_t *allow,
- DBusMessage **reply)
+static int wpas_dbus_get_scan_boolean(DBusMessage *message,
+ DBusMessageIter *var,
+ dbus_bool_t *allow,
+ DBusMessage **reply)
{
if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_BOOLEAN) {
wpa_printf(MSG_DEBUG, "%s[dbus]: Type must be a boolean",
@@ -1630,6 +1630,8 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
struct wpa_driver_scan_params params;
size_t i;
dbus_bool_t allow_roam = 1;
+ dbus_bool_t non_coloc_6ghz = 0;
+ dbus_bool_t scan_6ghz_only = 0;
os_memset(¶ms, 0, sizeof(params));
@@ -1661,10 +1663,22 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
¶ms, &reply) < 0)
goto out;
} else if (os_strcmp(key, "AllowRoam") == 0) {
- if (wpas_dbus_get_scan_allow_roam(message,
- &variant_iter,
- &allow_roam,
- &reply) < 0)
+ if (wpas_dbus_get_scan_boolean(message,
+ &variant_iter,
+ &allow_roam,
+ &reply) < 0)
+ goto out;
+ } else if (os_strcmp(key, "NonColoc6GHz") == 0) {
+ if (wpas_dbus_get_scan_boolean(message,
+ &variant_iter,
+ &non_coloc_6ghz,
+ &reply) < 0)
+ goto out;
+ } else if (os_strcmp(key, "6GHzOnly") == 0) {
+ if (wpas_dbus_get_scan_boolean(message,
+ &variant_iter,
+ &scan_6ghz_only,
+ &reply) < 0)
goto out;
} else {
wpa_printf(MSG_DEBUG, "%s[dbus]: Unknown argument %s",
@@ -1683,6 +1697,15 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
goto out;
}
+ if (non_coloc_6ghz) {
+ params.non_coloc_6ghz = 1;
+ }
+
+ if (scan_6ghz_only && params.freqs == NULL) {
+ wpa_add_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211A, ¶ms,
+ true, false, false);
+ }
+
if (os_strcmp(type, "passive") == 0) {
if (params.num_ssids || params.extra_ies_len) {
wpa_printf(MSG_DEBUG,
--
2.42.0.609.gbb76f46606-goog
More information about the Hostap
mailing list