[wireless-regdb] [PATCH v3 4/6] cfg80211: Add an option to hint indoor operation
Luis R. Rodriguez
mcgrof at do-not-panic.com
Tue Feb 18 19:07:56 EST 2014
On Mon, Jan 27, 2014 at 12:21:56PM +0200, Ilan Peer wrote:
> @@ -1450,6 +1465,11 @@ __reg_process_hint_user(struct regulatory_request *user_request)
> {
> struct regulatory_request *lr = get_last_request();
>
> + if (reg_request_indoor(user_request)) {
> + reg_is_indoor = true;
> + return REG_REQ_ALREADY_SET;
Please use another return value here and document it. This would
enable other type of userspace hints and would not make this an
obscure thing.
> @@ -2014,6 +2047,8 @@ static void restore_regulatory_settings(bool reset_user)
>
> ASSERT_RTNL();
>
> + reg_is_indoor = false;
:D
> +
> reset_regdomains(true, &world_regdom);
> restore_alpha2(alpha2, reset_user);
>
> @@ -2515,6 +2550,19 @@ int cfg80211_get_unii(int freq)
> return -EINVAL;
> }
>
> +bool regulatory_ir_allowed(struct wiphy *wiphy, struct ieee80211_channel *chan)
> +{
> + if (config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) &&
> + !(wiphy->regulatory_flags & REGULATORY_DISABLE_RELAX_NO_IR) &&
Don't you want to make the flag REGULATORY_DISABLE_RELAX_NO_IR positive,
that is REGULATORY_ENABLE_RELAX_NO_IR as otherwise you'd require
everyone to disable it by default. I think we want to *disable* it by
default it and let drivers set it explicitly to declare support.
> + reg_is_indoor && (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
> + return true;
> +
> + if (chan->flags & IEEE80211_CHAN_NO_IR)
> + return false;
> + return true;
> +}
> +EXPORT_SYMBOL(regulatory_ir_allowed);
Please use EXPORT_SYMBOL_GPL() moving forward for regulatory core stuff.
Proprietary drivers can kiss my hairy ass.
Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/wireless-regdb/attachments/20140218/ead04b56/attachment.sig>
More information about the wireless-regdb
mailing list