diff mbox series

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

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

Commit Message

Peer, Ilan April 24, 2022, 9:57 a.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 | 15 +++++++++++++++
 wpa_supplicant/scan.c             |  1 +
 3 files changed, 26 insertions(+)

Comments

Jouni Malinen May 9, 2022, 8:48 a.m. UTC | #1
Thanks, applied patch 1..3 with 2 and 3 modified to include only the
SCAN command extensions.
Peer, Ilan May 9, 2022, 10:19 a.m. UTC | #2
> -----Original Message-----
> From: Jouni Malinen <j@w1.fi>
> Sent: Monday, May 09, 2022 11:48
> 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 v5 1/4] nl80211: set
> NL80211_SCAN_FLAG_COLOCATED_6GHZ in scan
> 
> Thanks, applied patch 1..3 with 2 and 3 modified to include only the SCAN
> command extensions.
> 

Thanks!

Ilan.
diff mbox series

Patch

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 31bf1407c0..80fec4c808 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..8f75eaaef3 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -203,6 +203,21 @@  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.
+		 * Note that if the flag is not set and 6GHz channels are
+		 * to be scanned, it is highly likely that non PSC channels
+		 * would be scanned passively (due to the probe request
+		 * transmission restrictions mandated by in Draft
+		 * P802.11ax_D8.0, section 27.17.2.3).
+		 */
+		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 abd48edb7a..bdee538181 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2885,6 +2885,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 =