From patchwork Mon Nov 12 22:06:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 198485 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 56C962C0081 for ; Tue, 13 Nov 2012 09:06:43 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9A4E29C15F; Mon, 12 Nov 2012 17:06:39 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 79RKLDgTtDHU; Mon, 12 Nov 2012 17:06:39 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 367599C165; Mon, 12 Nov 2012 17:06:35 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2133B9C165 for ; Mon, 12 Nov 2012 17:06:34 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vOnf8ZAY9NeA for ; Mon, 12 Nov 2012 17:06:30 -0500 (EST) Received: from na3sys009aog126.obsmtp.com (na3sys009aog126.obsmtp.com [74.125.149.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 5B9829C15F for ; Mon, 12 Nov 2012 17:06:26 -0500 (EST) Received: from MSI-MTA.marvell.com ([65.219.4.132]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUKFy4DrDo58rFEHXHkzPH4fHH+5iPnrk@postini.com; Mon, 12 Nov 2012 14:06:30 PST Received: from maili.marvell.com ([10.68.76.210]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Nov 2012 14:06:24 -0800 Received: from localhost.localdomain (unknown [10.80.114.125]) by maili.marvell.com (Postfix) with ESMTP id 5EE2A4E510; Mon, 12 Nov 2012 14:06:24 -0800 (PST) From: Bing Zhao To: hostap@lists.shmoo.com Subject: [PATCH v3] Allow OBSS scan and 20/40 coex reports to non-SME drivers Date: Mon, 12 Nov 2012 14:06:17 -0800 Message-Id: <1352757977-11659-1-git-send-email-bzhao@marvell.com> X-Mailer: git-send-email 1.7.0.2 X-OriginalArrivalTime: 12 Nov 2012 22:06:24.0206 (UTC) FILETIME=[F4669EE0:01CDC121] Cc: Jouni Malinen , Johannes Berg , Amitkumar Karwar , Bing Zhao X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Amitkumar Karwar We will enable this feature for non-SME drivers as well if they explicitely indicate need for it. Signed-off-by: Amitkumar Karwar Signed-off-by: Bing Zhao --- 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;