diff mbox series

nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan

Message ID 20211130153943.3531922-1-andrei.otcheretianski@intel.com
State Changes Requested
Headers show
Series nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan | expand

Commit Message

Andrei Otcheretianski Nov. 30, 2021, 3:39 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.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 src/drivers/driver_nl80211_scan.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen Dec. 11, 2021, 11:21 a.m. UTC | #1
On Tue, Nov 30, 2021 at 05:39:43PM +0200, Andrei Otcheretianski 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.

> diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
> @@ -300,6 +300,9 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
> +	/* scan for 6ghz colocated APs that reported by other APs */
> +	scan_flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
> +
>  	if (scan_flags &&
>  	    nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, scan_flags))

Is it really correct to do this unconditionally? Wouldn't this result in
undesired extra latency in scanning when the 6 GHz band is not used
(e.g., for most P2P use cases) or when there is an explicit
configuration (e.g., SETBAND) to disable use of the 6 GHz band?
Peer, Ilan Dec. 14, 2021, 6:38 a.m. UTC | #2
Hi,

> -----Original Message-----
> From: Hostap <hostap-bounces@lists.infradead.org> On Behalf Of Jouni
> Malinen
> Sent: Saturday, December 11, 2021 13:21
> To: Otcheretianski, Andrei <andrei.otcheretianski@intel.com>
> Cc: hostap@lists.infradead.org; Mussai, Tova <tova.mussai@intel.com>
> Subject: Re: [PATCH] nl80211: set NL80211_SCAN_FLAG_COLOCATED_6GHZ
> in scan
> 
> On Tue, Nov 30, 2021 at 05:39:43PM +0200, Andrei Otcheretianski 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.
> 
> > diff --git a/src/drivers/driver_nl80211_scan.c
> > b/src/drivers/driver_nl80211_scan.c
> > @@ -300,6 +300,9 @@ nl80211_scan_common(struct i802_bss *bss, u8
> cmd,
> > +	/* scan for 6ghz colocated APs that reported by other APs */
> > +	scan_flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
> > +
> >  	if (scan_flags &&
> >  	    nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, scan_flags))
> 
> Is it really correct to do this unconditionally? Wouldn't this result in undesired
> extra latency in scanning when the 6 GHz band is not used (e.g., for most P2P
> use cases) or when there is an explicit configuration (e.g., SETBAND) to
> disable use of the 6 GHz band?
> 

Without this flag, when user space requests the kernel to scan 6GHz channels, the 6GHz
non-PSC channels would be scanned passively which is not desired. Setting this flag
instructs the kernel to only scan non-PSC channels if relevant information was found in the
RNR elements on previously found BSSs (e.g., matching SSID etc.). Thus, I think that this
flag should always be set if not scanning passively. I'll prepare a fix that does not set this flag
for passive scan.

As for use cases that 6GHz are not used, additional logic is indeed needed to avoid scanning
these channels.

Regards,

Ilan.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 1316084805..356fbcebfa 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -300,6 +300,9 @@  nl80211_scan_common(struct i802_bss *bss, u8 cmd,
 			NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION;
 	}
 
+	/* scan for 6ghz colocated APs that reported by other APs */
+	scan_flags |= NL80211_SCAN_FLAG_COLOCATED_6GHZ;
+
 	if (scan_flags &&
 	    nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, scan_flags))
 		goto fail;