linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, Arend van Spriel <arend@broadcom.com>
Subject: [RFC 2/3] cfg80211: expose cfg80211_disable_40mhz_24ghz module parameter
Date: Tue, 17 Jun 2014 11:16:20 +0200	[thread overview]
Message-ID: <1402996581-10764-3-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1402996581-10764-1-git-send-email-arend@broadcom.com>

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 <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 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;
-- 
1.9.1


  parent reply	other threads:[~2014-06-17  9:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  9:16 [RFC 0/3] brcmfmac: provide band info upon wiphy registration Arend van Spriel
2014-06-17  9:16 ` [RFC 1/3] brcmfmac: move attach and detach functions in wl_cfg80211.c Arend van Spriel
2014-06-17  9:16 ` Arend van Spriel [this message]
2014-06-23  9:34   ` [RFC 2/3] cfg80211: expose cfg80211_disable_40mhz_24ghz module parameter Johannes Berg
2014-06-24 17:21     ` Arend van Spriel
2014-06-25 15:57       ` Johannes Berg
2014-06-25 16:50         ` Arend van Spriel
2014-06-17  9:16 ` [RFC 3/3] brcmfmac: update band and regulatory info before wiphy_register() Arend van Spriel
2014-06-23  9:37   ` Johannes Berg
2014-06-24 17:11     ` Arend van Spriel
2014-06-25 15:55       ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402996581-10764-3-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).