diff mbox

[RFC,2/3] cfg80211: expose cfg80211_disable_40mhz_24ghz module parameter

Message ID 1402996581-10764-3-git-send-email-arend@broadcom.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Arend van Spriel June 17, 2014, 9:16 a.m. UTC
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(+)

Comments

Johannes Berg June 23, 2014, 9:34 a.m. UTC | #1
On Tue, 2014-06-17 at 11:16 +0200, Arend van Spriel wrote:

>  /**
> + * wiphy_is_40mhz_24ghz_disabled - check whether 40MHz bandwidth in 2.4G

that seems incomplete :)

> + * @wiphy: The wiphy to check.
> + *
> + * Return: true is 40MHz is disabled in 2.4G band.
> + */
> +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy);

Why should that have a wiphy argument?

Might also be simpler to just export the variable?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel June 24, 2014, 5:21 p.m. UTC | #2
On 23-06-14 11:34, Johannes Berg wrote:
> On Tue, 2014-06-17 at 11:16 +0200, Arend van Spriel wrote:
>
>>   /**
>> + * wiphy_is_40mhz_24ghz_disabled - check whether 40MHz bandwidth in 2.4G
>
> that seems incomplete :)

No. It *is* incomplete ;-)

>> + * @wiphy: The wiphy to check.
>> + *
>> + * Return: true is 40MHz is disabled in 2.4G band.
>> + */
>> +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy);
>
> Why should that have a wiphy argument?

It is up to cfg80211 to determine the logic behind the function. It is 
just context supplied by the caller. The fact that it is determined by a 
module parameter is internal cfg80211 stuff.

> Might also be simpler to just export the variable?

Either way is pretty simple I guess.

Gr. AvS
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Berg June 25, 2014, 3:57 p.m. UTC | #3
On Tue, 2014-06-24 at 19:21 +0200, Arend van Spriel wrote:

> >> + * @wiphy: The wiphy to check.
> >> + *
> >> + * Return: true is 40MHz is disabled in 2.4G band.
> >> + */
> >> +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy);
> >
> > Why should that have a wiphy argument?
> 
> It is up to cfg80211 to determine the logic behind the function. It is 
> just context supplied by the caller. The fact that it is determined by a 
> module parameter is internal cfg80211 stuff.

I just don't really see any way it would ever be per wiphy?

> > Might also be simpler to just export the variable?
> 
> Either way is pretty simple I guess.

Yeah, dunno. I guess exporting the function at least makes sure nobody
will try to set the variable, so that's somewhat useful...

I'd prefer to remove the wiphy argument though (and fix the kernel-doc)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arend van Spriel June 25, 2014, 4:50 p.m. UTC | #4
On 25-06-14 17:57, Johannes Berg wrote:
> On Tue, 2014-06-24 at 19:21 +0200, Arend van Spriel wrote:
>
>>>> + * @wiphy: The wiphy to check.
>>>> + *
>>>> + * Return: true is 40MHz is disabled in 2.4G band.
>>>> + */
>>>> +bool wiphy_is_40mhz_24ghz_disabled(struct wiphy *wiphy);
>>>
>>> Why should that have a wiphy argument?
>>
>> It is up to cfg80211 to determine the logic behind the function. It is
>> just context supplied by the caller. The fact that it is determined by a
>> module parameter is internal cfg80211 stuff.
>
> I just don't really see any way it would ever be per wiphy?

Maybe you are right. By the way, is OBSS support a requirement to do 
40MHz in 2.4G?

>>> Might also be simpler to just export the variable?
>>
>> Either way is pretty simple I guess.
>
> Yeah, dunno. I guess exporting the function at least makes sure nobody
> will try to set the variable, so that's somewhat useful...
>
> I'd prefer to remove the wiphy argument though (and fix the kernel-doc)

No problem. Will do.

Gr. AvS

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;