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

login
register
mail settings
Submitter Bing Zhao
Date Nov. 12, 2012, 10:06 p.m.
Message ID <1352757977-11659-1-git-send-email-bzhao@marvell.com>
Download mbox | patch
Permalink /patch/198485/
State Accepted
Commit 368b1957a61bd0c2932c7532660dff770960047c
Headers show

Comments

Bing Zhao - Nov. 12, 2012, 10:06 p.m.
From: Amitkumar Karwar <akarwar@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@marvell.com>
Signed-off-by: Bing Zhao <bzhao@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(-)
Jouni Malinen - Nov. 24, 2012, 4:10 p.m.
On Mon, Nov 12, 2012 at 02:06:17PM -0800, Bing Zhao wrote:
> We will enable this feature for non-SME drivers as well if
> they explicitely indicate need for it.

Thanks, applied.

Patch

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;