diff mbox series

[v4,1/4] nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan

Message ID 20220411142201.2770618-1-ilan.peer@intel.com
State Changes Requested
Headers show
Series [v4,1/4] nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan | expand

Commit Message

Ilan Peer April 11, 2022, 2:21 p.m. UTC
From: Tova Mussai <tova.mussai@intel.com>

Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in the scan params to enable
scanning for co-located AP's found in 2.4/5 GHz bands when
not scanning passively. Do so only when collocated scanning
is not disabled by higher layer logic.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 src/drivers/driver.h              | 10 ++++++++++
 src/drivers/driver_nl80211_scan.c | 11 +++++++++++
 wpa_supplicant/scan.c             |  1 +
 3 files changed, 22 insertions(+)

Comments

Jouni Malinen April 18, 2022, 3:15 p.m. UTC | #1
On Mon, Apr 11, 2022 at 05:21:58PM +0300, Ilan Peer wrote:
> Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in the scan params to enable
> scanning for co-located AP's found in 2.4/5 GHz bands when
> not scanning passively. Do so only when collocated scanning
> is not disabled by higher layer logic.

Where does this "not scanning passively" part comes from? nl80211.h
documents this flag in the following way:

"NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported by
2.4/5 GHz APs"

Is that incorrect or just incomplete? They way I read that nl80211.h
comment is that this flag is or adding some additional steps to
scanning, but the comment in this proposed hostap.git change says
following:

> diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
> @@ -203,6 +203,17 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
> +		/*
> +		 * If allowed, scan for 6GHz APs that are reported by other
> +		 * APs. If the flag is not set and 6GHz channels are to be
> +		 * scanned, they will be scanned passively.
> +		 */
> +		wpa_printf(MSG_DEBUG, "nl80211: non_coloc_6ghz=%u",
> +			   params->non_coloc_6ghz);
> +
> +		if (!params->non_coloc_6ghz)
> +			scan_flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;

This seems to imply that if the flag is there, there would actually be
less scanning rather than the other way around..

What exactly is the expected behavior here? What is that "6 GHz channels
are to be scanned" referring to?

Should the nl80211.h documentation be extended to cover all the details
that this flag is really doing? I cannot really figure out whether this
proposed hostap.git patch is doing what the flag is supposed to do..

Is this somehow connected to the preferred scanning channels (PSC)?
Ilan Peer April 20, 2022, 6:32 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Jouni Malinen <j@w1.fi>
> Sent: Monday, April 18, 2022 18:16
> To: Peer, Ilan <ilan.peer@intel.com>
> Cc: hostap@lists.infradead.org; Mussai, Tova <tova.mussai@intel.com>;
> Otcheretianski, Andrei <andrei.otcheretianski@intel.com>; Stern, Avraham
> <avraham.stern@intel.com>
> Subject: Re: [PATCH v4 1/4] nl80211: set
> NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan
> 
> On Mon, Apr 11, 2022 at 05:21:58PM +0300, Ilan Peer wrote:
> > Set NL80211_SCAN_FLAG_COLOCATED_6GHZ in the scan params to enable
> > scanning for co-located AP's found in 2.4/5 GHz bands when not
> > scanning passively. Do so only when collocated scanning is not
> > disabled by higher layer logic.
> 
> Where does this "not scanning passively" part comes from? nl80211.h
> documents this flag in the following way:
> 
> "NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported
> by
> 2.4/5 GHz APs"
> 
> Is that incorrect or just incomplete? They way I read that nl80211.h comment
> is that this flag is or adding some additional steps to scanning, but the
> comment in this proposed hostap.git change says
> following:
> 
> > diff --git a/src/drivers/driver_nl80211_scan.c
> > b/src/drivers/driver_nl80211_scan.c
> > @@ -203,6 +203,17 @@ nl80211_scan_common(struct i802_bss *bss, u8
> cmd,
> > +		/*
> > +		 * If allowed, scan for 6GHz APs that are reported by other
> > +		 * APs. If the flag is not set and 6GHz channels are to be
> > +		 * scanned, they will be scanned passively.
> > +		 */
> > +		wpa_printf(MSG_DEBUG, "nl80211: non_coloc_6ghz=%u",
> > +			   params->non_coloc_6ghz);
> > +
> > +		if (!params->non_coloc_6ghz)
> > +			scan_flags |=
> NL80211_SCAN_FLAG_COLOCATED_6GHZ;
> 
> This seems to imply that if the flag is there, there would actually be less
> scanning rather than the other way around..
> 
> What exactly is the expected behavior here? What is that "6 GHz channels
> are to be scanned" referring to?
> 
> Should the nl80211.h documentation be extended to cover all the details that
> this flag is really doing? I cannot really figure out whether this proposed
> hostap.git patch is doing what the flag is supposed to do..
> 
> Is this somehow connected to the preferred scanning channels (PSC)?
> 

The scan procedures defined in Draft P802.11ax_D8.0 section 27. 17.2.3, limit the
transmissions of probe requests on the 6GHz channels such that a non-AP station
is allowed to transmit a probe requests only if there is information that there is
an AP operating on the channel. For non PSC channels, this information is expected
to be available based on information obtained from RNR elements (found in
beacons/probe responses received on the 2/5GHz channels) which indicate the presence
of collocated APs on 6GHz channels.

Without enabling collocated scan logic, i.e., using the information obtained from the scan
on the 2/5GHz bands, a non-AP station is very limited in the active scanning it can perform
on non-PSC channels which would mean that in practice it would need to passively scan
these channels.

With collocated scanning enabled, the non-AP station would both limit the
scan for channels on which APs are expected to be operating and also be able to transmit
probe requests, thus shortening the overall scan time.

I think that the nl80211 API documentation can be extended to describe the expected outcome
of setting (and not setting) the NL80211_SCAN_FLAG_COLOCATED_6GHZ flag, so the implications
on the scan would be clear. I can also further clarify this patch.

Hope this clarifies things.

Regards,

Ilan.
diff mbox series

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 111e7e4081..0e31d6e3fc 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -651,6 +651,16 @@  struct wpa_driver_scan_params {
 	 */
 	unsigned int p2p_include_6ghz:1;
 
+	/**
+	 * non_coloc_6ghz - force scanning non-PSC 6GHz channels
+	 *
+	 * If this is set, the driver should scan non-PSC channels from the
+	 * scan request even if no co-located AP was reported on these channels.
+	 * The default is to scan non-PSC channels only if a co-located AP was
+	 * reported on the channel.
+	 */
+	unsigned int non_coloc_6ghz:1;
+
 	/*
 	 * NOTE: Whenever adding new parameters here, please make sure
 	 * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 1316084805..31e3308081 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -203,6 +203,17 @@  nl80211_scan_common(struct i802_bss *bss, u8 cmd,
 				goto fail;
 		}
 		nla_nest_end(msg, ssids);
+
+		/*
+		 * If allowed, scan for 6GHz APs that are reported by other
+		 * APs. If the flag is not set and 6GHz channels are to be
+		 * scanned, they will be scanned passively.
+		 */
+		wpa_printf(MSG_DEBUG, "nl80211: non_coloc_6ghz=%u",
+			   params->non_coloc_6ghz);
+
+		if (!params->non_coloc_6ghz)
+			scan_flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
 	} else {
 		wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested");
 	}
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index b0094ca6ca..31b694713b 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2872,6 +2872,7 @@  wpa_scan_clone_params(const struct wpa_driver_scan_params *src)
 	params->duration = src->duration;
 	params->duration_mandatory = src->duration_mandatory;
 	params->oce_scan = src->oce_scan;
+	params->non_coloc_6ghz = src->non_coloc_6ghz;
 
 	if (src->sched_scan_plans_num > 0) {
 		params->sched_scan_plans =