]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
scan: Add option to disable 6 GHz collocated scanning
authorIlan Peer <ilan.peer@intel.com>
Sun, 24 Apr 2022 09:57:53 +0000 (12:57 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 7 May 2022 18:37:08 +0000 (21:37 +0300)
Add a parameter (non_coloc_6ghz=1) to the manual scan command to disable
6 GHz collocated scanning.

This option can be used to disable 6 GHz collocated scan logic. Note
that due to limitations on Probe Request frame transmissions on the 6
GHz band mandated in IEEE Std 802.11ax-2021 it is very likely that
non-PSC channels would be scanned passively and this can take a
significant amount of time.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/scan.c
wpa_supplicant/wpa_supplicant_i.h

index ab8a624a5d04031da0317222327b6a085a207520..3d8e6630bf30c5f0d44d5a339057f431415daf78 100644 (file)
@@ -8838,6 +8838,7 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params,
        unsigned int manual_scan_only_new = 0;
        unsigned int scan_only = 0;
        unsigned int scan_id_count = 0;
+       unsigned int manual_non_coloc_6ghz = 0;
        int scan_id[MAX_SCAN_ID];
        void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
                                 struct wpa_scan_results *scan_res);
@@ -8915,6 +8916,10 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params,
                                os_strstr(params, "wildcard_ssid=1") != NULL;
                }
 
+               pos = os_strstr(params, "non_coloc_6ghz=");
+               if (pos)
+                       manual_non_coloc_6ghz = !!atoi(pos + 15);
+
                pos = params;
                while (pos && *pos != '\0') {
                        if (os_strncmp(pos, "ssid ", 5) == 0) {
@@ -8984,6 +8989,7 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params,
                wpa_s->manual_scan_use_id = manual_scan_use_id;
                wpa_s->manual_scan_only_new = manual_scan_only_new;
                wpa_s->scan_id_count = scan_id_count;
+               wpa_s->manual_non_coloc_6ghz = manual_non_coloc_6ghz;
                os_memcpy(wpa_s->scan_id, scan_id, scan_id_count * sizeof(int));
                wpa_s->scan_res_handler = scan_res_handler;
                os_free(wpa_s->manual_scan_freqs);
@@ -9007,6 +9013,7 @@ static void wpas_ctrl_scan(struct wpa_supplicant *wpa_s, char *params,
                wpa_s->manual_scan_use_id = manual_scan_use_id;
                wpa_s->manual_scan_only_new = manual_scan_only_new;
                wpa_s->scan_id_count = scan_id_count;
+               wpa_s->manual_non_coloc_6ghz = manual_non_coloc_6ghz;
                os_memcpy(wpa_s->scan_id, scan_id, scan_id_count * sizeof(int));
                wpa_s->scan_res_handler = scan_res_handler;
                os_free(wpa_s->manual_scan_freqs);
index ce29d9953f20cd4dcc03336c7518478359be0e3f..102c544d4f75e96876dc0df6229f323816b37dc6 100644 (file)
@@ -1328,6 +1328,12 @@ ssid_list_set:
                }
        }
 
+       if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
+           wpa_s->manual_non_coloc_6ghz) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "Collocated 6 GHz logic is disabled");
+               params.non_coloc_6ghz = 1;
+       }
+
        scan_params = &params;
 
 scan:
index 4dd9dd8b5ec0c3d7270f25c92f57724edd4acc7f..b4af76ed8d14a41dc8dbb8d09def380cadc32a54 100644 (file)
@@ -884,6 +884,7 @@ struct wpa_supplicant {
        unsigned int own_scan_requested:1;
        unsigned int own_scan_running:1;
        unsigned int clear_driver_scan_cache:1;
+       unsigned int manual_non_coloc_6ghz:1;
        unsigned int manual_scan_id;
        int scan_interval; /* time in sec between scans to find suitable AP */
        int normal_scans; /* normal scans run before sched_scan */