[PATCH v5 2/4] scan: Add options to disable 6GHz collocated scanning
Ilan Peer
ilan.peer at intel.com
Sun Apr 24 02:57:53 PDT 2022
- Add a configuration option to disable 6GHz collocated scanning.
- Add a parameter to the manual scan command to disable 6GHz
collocated scanning.
These options can be used to disable 6GHz collocated scan logic.
Note that due to limitations on probe request transmissions mandated
in Draft P802.11ax_D8.0 it is very likely that non PSC channels
would be scanned passively.
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
wpa_supplicant/config.c | 1 +
wpa_supplicant/config.h | 9 +++++++++
wpa_supplicant/config_file.c | 2 ++
wpa_supplicant/ctrl_iface.c | 7 +++++++
wpa_supplicant/p2p_supplicant.c | 1 +
wpa_supplicant/scan.c | 7 +++++++
wpa_supplicant/wpa_supplicant.conf | 7 +++++++
wpa_supplicant/wpa_supplicant_i.h | 1 +
8 files changed, 35 insertions(+)
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 782bb2197d..5a4a9732df 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -5287,6 +5287,7 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(pasn_corrupt_mic, 0, 1), 0 },
#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_PASN */
+ { INT(non_coloc_6ghz), 0 },
};
#undef FUNC
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index d22ef05fb8..721e214953 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -1699,6 +1699,15 @@ struct wpa_config {
#endif /* CONFIG_TESTING_OPTIONS */
#endif /* CONFIG_PASN*/
+
+ /**
+ * non_coloc_6ghz - Whether to follow 6GHz collocated scan logic or not
+ *
+ * This parameter can be used to disable collocated 6GHz scan logic,
+ * resulting with passively scanning non PSC channels. By default, 6GHz
+ * collocated scan logic is enabled.
+ */
+ int non_coloc_6ghz;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 163b480731..cf693baed9 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1556,6 +1556,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->wowlan_disconnect_on_deinit)
fprintf(f, "wowlan_disconnect_on_deinit=%d\n",
config->wowlan_disconnect_on_deinit);
+ if (config->non_coloc_6ghz)
+ fprintf(f, "non_coloc_6ghz=%d\n", config->non_coloc_6ghz);
}
#endif /* CONFIG_NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 70538b578b..d1e0dc2eac 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -8837,6 +8837,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);
@@ -8914,6 +8915,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) {
@@ -8983,6 +8988,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);
@@ -9006,6 +9012,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);
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a996b436b4..80ef2a9e4d 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -2188,6 +2188,7 @@ do { \
d->go_venue_group = s->go_venue_group;
d->go_venue_type = s->go_venue_type;
d->p2p_add_cli_chan = s->p2p_add_cli_chan;
+ d->non_coloc_6ghz = s->non_coloc_6ghz;
}
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index bdee538181..60c68e737a 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1328,6 +1328,13 @@ ssid_list_set:
}
}
+ if (wpa_s->conf->non_coloc_6ghz ||
+ (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
+ wpa_s->manual_non_coloc_6ghz)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Collocated 6GHz logic is disabled");
+ params.non_coloc_6ghz = 1;
+ }
+
scan_params = ¶ms;
scan:
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index a1dc769c94..c34a9fc219 100644
--- a/wpa_supplicant/wpa_supplicant.conf
+++ b/wpa_supplicant/wpa_supplicant.conf
@@ -132,6 +132,13 @@ ap_scan=1
# 1: Do passive scans.
#passive_scan=0
+# Whether to disable 6GHz collocates scan logic
+#
+# This parameter can be used to disable collocated 6GHz scan logic,
+# resulting with passively scanning non PSC channels. By default, 6GHz
+# collocated scan logic is enabled.
+#non_coloc_6ghz=0
+
# MPM residency
# By default, wpa_supplicant implements the mesh peering manager (MPM) for an
# open mesh. However, if the driver can implement the MPM, you may set this to
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index da3c36166a..e0c0dc06fc 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -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 */
--
2.25.1
More information about the Hostap
mailing list