Message ID | 1402996581-10764-3-git-send-email-arend@broadcom.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
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
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
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
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 --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;