[PATCH v4 2/4] scan: Add a configuration option to disable 6GHz collocated scanning

Ilan Peer ilan.peer at intel.com
Mon Apr 11 07:21:59 PDT 2022


This configuration option can be used to disable 6GHz collocated scan
logic which would result with passively scanning 6GHz non PSC channels.

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/p2p_supplicant.c    | 1 +
 wpa_supplicant/scan.c              | 7 +++++++
 wpa_supplicant/wpa_supplicant.conf | 7 +++++++
 6 files changed, 27 insertions(+)

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 58ed8bc0ae..5b9c9ed7df 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -5265,6 +5265,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 9e71185323..0ab588b40f 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1559,6 +1559,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/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 31b694713b..d7c73883e9 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1328,6 +1328,13 @@ ssid_list_set:
 		}
 	}
 
+	if (!params.non_coloc_6ghz && wpa_s->conf->non_coloc_6ghz) {
+		wpa_dbg(wpa_s, MSG_DEBUG,
+			"Collocated 6GHz logic is disabled in configuration");
+
+		params.non_coloc_6ghz = 1;
+	}
+
 	scan_params = ¶ms;
 
 scan:
diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf
index 6619d6ba7f..1f7537cb66 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
-- 
2.25.1




More information about the Hostap mailing list