From patchwork Tue Jun 17 09:16:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 4365231 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E30EABEEAA for ; Tue, 17 Jun 2014 09:16:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DA8F20204 for ; Tue, 17 Jun 2014 09:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 251C4200E5 for ; Tue, 17 Jun 2014 09:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932775AbaFQJQt (ORCPT ); Tue, 17 Jun 2014 05:16:49 -0400 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:36040 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932664AbaFQJQr (ORCPT ); Tue, 17 Jun 2014 05:16:47 -0400 X-IronPort-AV: E=Sophos;i="5.01,493,1400050800"; d="scan'208";a="35094933" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 17 Jun 2014 02:33:29 -0700 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 17 Jun 2014 02:16:46 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.174.1; Tue, 17 Jun 2014 02:16:46 -0700 Received: from arend-vb-dev (unknown [10.176.68.141]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 435E327A82; Tue, 17 Jun 2014 02:16:46 -0700 (PDT) Received: from arend by arend-vb-dev with local (Exim 4.82) (envelope-from ) id 1WwpVV-0002oQ-20; Tue, 17 Jun 2014 11:16:45 +0200 From: Arend van Spriel To: Johannes Berg , "John W. Linville" CC: , Arend van Spriel Subject: [RFC 2/3] cfg80211: expose cfg80211_disable_40mhz_24ghz module parameter Date: Tue, 17 Jun 2014 11:16:20 +0200 Message-ID: <1402996581-10764-3-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1402996581-10764-1-git-send-email-arend@broadcom.com> References: <1402996581-10764-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Drivers may need to know this variable value for configuring the device they are controlling. It can be determined indirectly by setting IEEE80211_HT_CAP_SUP_WIDTH_20_40 flag in the field ieee80211_sta_htcap::cap of 2G band. During the wiphy_register() call cfg80211 will clear that bit if the module parameter is true. However, brcmfmac for one needs to know the value to determine its custom regulatory domain which must be applied before doing the wiphy_register(). Reviewed-by: Hante Meuleman Reviewed-by: Daniel (Deognyoun) Kim Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel --- include/net/cfg80211.h | 9 +++++++++ net/wireless/core.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e46c437..47a0310 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -3172,6 +3172,15 @@ static inline const char *wiphy_name(const struct wiphy *wiphy) struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv); /** + * wiphy_is_40mhz_24ghz_disabled - check whether 40MHz bandwidth in 2.4G + * + * @wiphy: The wiphy to check. + * + * Return: true is 40MHz is disabled in 2.4G band. + */ +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy); + +/** * wiphy_register - register a wiphy with cfg80211 * * @wiphy: The wiphy to register. diff --git a/net/wireless/core.c b/net/wireless/core.c index a1c4065..428f370 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -408,6 +408,12 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv) } EXPORT_SYMBOL(wiphy_new); +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy) +{ + return cfg80211_disable_40mhz_24ghz; +} +EXPORT_SYMBOL(wiphy_is_40mhz_24ghz_disabled); + static int wiphy_verify_combinations(struct wiphy *wiphy) { const struct ieee80211_iface_combination *c;