[PATCH v3] Allow OBSS scan and 20/40 coex reports to non-SME drivers

Bing Zhao bzhao
Mon Nov 12 14:06:17 PST 2012


From: Amitkumar Karwar <akarwar at marvell.com>

We will enable this feature for non-SME drivers as well if
they explicitely indicate need for it.

Signed-off-by: Amitkumar Karwar <akarwar at marvell.com>
Signed-off-by: Bing Zhao <bzhao at marvell.com>
---
v3: use a better constant name NL80211_FEATURE_NEED_OBSS_SCAN.
    (Johannes Berg)

v2: add nl80211 advertisement for this feature.
"[PATCH] nl/cfg80211: advertise OBSS scan offload capability" is required.
    (Jouni Malinen)

 src/drivers/driver.h         |  2 ++
 src/drivers/driver_nl80211.c |  3 +++
 wpa_supplicant/sme.c         | 11 ++++++++---
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index e07df86..7f73dfe 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -840,6 +840,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_AP_MLME			0x01000000
 /* Driver supports SAE with user space SME */
 #define WPA_DRIVER_FLAGS_SAE				0x02000000
+/* Driver makes use of OBSS scan mechanism in wpa_supplicant */
+#define WPA_DRIVER_FLAGS_OBSS_SCAN			0x04000000
 	unsigned int flags;
 
 	int max_scan_ssids;
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b86bc5a..90067e9 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2621,6 +2621,9 @@ broken_combination:
 
 		if (flags & NL80211_FEATURE_SAE)
 			capa->flags |= WPA_DRIVER_FLAGS_SAE;
+
+		if (flags & NL80211_FEATURE_NEED_OBSS_SCAN)
+			capa->flags |= WPA_DRIVER_FLAGS_OBSS_SCAN;
 	}
 
 	if (tb[NL80211_ATTR_PROBE_RESP_OFFLOAD]) {
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index f6e106c..c065098 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -1033,9 +1033,14 @@ void sme_sched_obss_scan(struct wpa_supplicant *wpa_s, int enable)
 	if (!enable)
 		return;
 
-	if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) || ssid == NULL ||
-	    ssid->mode != IEEE80211_MODE_INFRA)
-		return; /* Not using station SME in wpa_supplicant */
+	/*
+	 * Schedule obss scan if driver is using station SME in wpa_supplicant
+	 * or it expects obss scan to be performed by wpa_supplicant.
+	 */
+	if (!((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) ||
+	      (wpa_s->drv_flags & WPA_DRIVER_FLAGS_OBSS_SCAN)) ||
+	    ssid == NULL || ssid->mode != IEEE80211_MODE_INFRA)
+		return;
 
 	if (!wpa_s->hw.modes)
 		return;
-- 
1.8.0




More information about the Hostap mailing list