diff mbox series

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

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

Commit Message

Ilan Peer April 10, 2022, 7:51 a.m. UTC
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@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 +++++++
 5 files changed, 20 insertions(+)

Comments

Ben Greear April 10, 2022, 8:25 p.m. UTC | #1
On 4/10/22 12:51 AM, Ilan Peer wrote:
> This configuration option can be used to disable 6GHz collocated scan
> logic which would result with passively scanning 6GHz non PSC channels.

It would be nice if you could add the example config option to wpa_supplicant.conf
with appropriate comments about acceptable values and what it means.

Otherwise, a user has to get lucky reading code to even know the option is
available.

Also, even if this fixes the ax210 5.18 patch that causes the regression
(and I have not yet had time to test this), then you should probably revert
that ax210 patch so that it works with older supplicants?  It often takes a long
time to get supplicant updated in standard OS distributions.

Thanks,
Ben

> 
> 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/p2p_supplicant.c | 1 +
>   wpa_supplicant/scan.c           | 7 +++++++
>   5 files changed, 20 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 2dd586391e..9641656b14 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 = &params;
>   
>   scan:
>
Ilan Peer April 11, 2022, 1:24 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Ben Greear <greearb@candelatech.com>
> Sent: Sunday, April 10, 2022 23:26
> To: Peer, Ilan <ilan.peer@intel.com>; hostap@lists.infradead.org
> Subject: Re: [PATCH v3 2/4] scan: Add a configuration option to disable 6GHz
> collocated scanning
> 
> On 4/10/22 12:51 AM, Ilan Peer wrote:
> > This configuration option can be used to disable 6GHz collocated scan
> > logic which would result with passively scanning 6GHz non PSC channels.
> 
> It would be nice if you could add the example config option to
> wpa_supplicant.conf with appropriate comments about acceptable values
> and what it means.
> 
> Otherwise, a user has to get lucky reading code to even know the option is
> available.
>

Updated the patch set.
 
> Also, even if this fixes the ax210 5.18 patch that causes the regression (and I
> have not yet had time to test this), then you should probably revert that
> ax210 patch so that it works with older supplicants?  It often takes a long time
> to get supplicant updated in standard OS distributions.
> 

I'll consider it. The main problem reverting this logic is that scans might take very
long time (up to 30 seconds in some cases)  do to passively scanning all the non PSC
channels. 

Regards,

Ilan.
Ben Greear April 11, 2022, 2:06 p.m. UTC | #3
On 4/11/22 6:24 AM, Peer, Ilan wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Ben Greear <greearb@candelatech.com>
>> Sent: Sunday, April 10, 2022 23:26
>> To: Peer, Ilan <ilan.peer@intel.com>; hostap@lists.infradead.org
>> Subject: Re: [PATCH v3 2/4] scan: Add a configuration option to disable 6GHz
>> collocated scanning
>>
>> On 4/10/22 12:51 AM, Ilan Peer wrote:
>>> This configuration option can be used to disable 6GHz collocated scan
>>> logic which would result with passively scanning 6GHz non PSC channels.
>>
>> It would be nice if you could add the example config option to
>> wpa_supplicant.conf with appropriate comments about acceptable values
>> and what it means.
>>
>> Otherwise, a user has to get lucky reading code to even know the option is
>> available.
>>
> 
> Updated the patch set.
>   
>> Also, even if this fixes the ax210 5.18 patch that causes the regression (and I
>> have not yet had time to test this), then you should probably revert that
>> ax210 patch so that it works with older supplicants?  It often takes a long time
>> to get supplicant updated in standard OS distributions.
>>
> 
> I'll consider it. The main problem reverting this logic is that scans might take very
> long time (up to 30 seconds in some cases)  do to passively scanning all the non PSC
> channels.

It takes way longer than that when it doesn't work at all.

Maybe toggle between the two modes if user space does not provide guidance (try fast way first, then slow if
fast didn't find anything), and have the supplicant send down explicit request for each behaviour so that in the
driver you know if supplicant is up to date or not?

Thanks,
Ben

> 
> Regards,
> 
> Ilan.
>
diff mbox series

Patch

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 2dd586391e..9641656b14 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 = &params;
 
 scan: