diff mbox series

[v5,2/4] scan: Add options to disable 6GHz collocated scanning

Message ID 20220424095755.3379637-2-ilan.peer@intel.com
State Accepted
Headers show
Series [v5,1/4] nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan | expand

Commit Message

Ilan Peer April 24, 2022, 9:57 a.m. UTC
- 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@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(+)

Comments

Jouni Malinen May 7, 2022, 6:09 p.m. UTC | #1
On Sun, Apr 24, 2022 at 12:57:53PM +0300, Ilan Peer wrote:
> - Add a configuration option to disable 6GHz collocated scanning.
> - Add a parameter to the manual scan command to disable 6GHz
>   collocated scanning.

I still don't understand the use case for that configuration option, so
I'm dropping that part and consider only the SCAN command extension from
this patch.
Ilan Peer May 8, 2022, 7:41 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Jouni Malinen <j@w1.fi>
> Sent: Saturday, May 07, 2022 21:10
> To: Peer, Ilan <ilan.peer@intel.com>
> Cc: hostap@lists.infradead.org
> Subject: Re: [PATCH v5 2/4] scan: Add options to disable 6GHz collocated
> scanning
> 
> On Sun, Apr 24, 2022 at 12:57:53PM +0300, Ilan Peer wrote:
> > - Add a configuration option to disable 6GHz collocated scanning.
> > - Add a parameter to the manual scan command to disable 6GHz
> >   collocated scanning.
> 
> I still don't understand the use case for that configuration option, so I'm
> dropping that part and consider only the SCAN command extension from this
> patch.
> 

I have no objection. It can always be added later if there is a clear use case for this.

Regards,

Ilan.
diff mbox series

Patch

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 = &params;
 
 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 */