linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: Ilan Peer <ilan.peer@intel.com>
Cc: linux-wireless@vger.kernel.org, wireless-regdb@lists.infradead.org
Subject: Re: [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation
Date: Fri, 24 Jan 2014 16:20:05 -0800	[thread overview]
Message-ID: <20140125002002.GB28512@garbanzo.do-not-panic.com> (raw)
In-Reply-To: <1389801162-14488-5-git-send-email-ilan.peer@intel.com>

On Wed, Jan 15, 2014 at 05:52:40PM +0200, Ilan Peer wrote:
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 212b5c2..0361035 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -110,6 +110,14 @@ const struct ieee80211_regdomain __rcu *cfg80211_regdomain;
>   */
>  static int reg_num_devs_support_basehint;
>  
> +/*
> + * State variable indicating if the platform on which the devices
> + * are attached is operating in an indoor environment. The state variable
> + * is relevant for all registered devices.
> + * Note: currently not protected by any synchronization primitive.
> + */
> +static bool reg_is_indoor;
> +

See if it makes sense to instead start building up a single reg
data structure that has a slew of members. That's welcomed as a
separate patch later...

> @@ -1475,6 +1493,11 @@ reg_process_hint_user(struct regulatory_request *user_request)
>  		return treatment;
>  	}
>  
> +	if (reg_request_indoor(user_request) && treatment == REG_REQ_OK) {
> +		reg_is_indoor = true;
> +		return REG_REQ_OK;
> +	}
> +

Are you setting this to false when we disconnect (reset regulatory)?
You should.

> @@ -1658,9 +1681,6 @@ static void reg_process_hint(struct regulatory_request *reg_request)
>  	struct wiphy *wiphy = NULL;
>  	enum reg_request_treatment treatment;
>  
> -	if (WARN_ON(!reg_request->alpha2))
> -		return;
> -

last_request checks for the alpha2 are abundent... you'd
have to go review such use cases... One strategy might be
to not treat this as a pure regulatory request but rather
a hint of information, ie, not override last_request for
this type of request.

> @@ -2482,6 +2518,19 @@ int cfg80211_get_unii(int freq)
>  	return -EINVAL;
>  }
>  
> +bool regulatory_ir_allowed(struct ieee80211_channel *chan)
> +{
> +#ifdef CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS
> +	if (reg_is_indoor && (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
> +		return true;
> +#endif /* CONFIG_CFG80211_REG_SOFT_CONFIGURATIONS */

config_enabled() would make this look sexier.

> @@ -2502,6 +2551,8 @@ int __init regulatory_init(void)
>  	user_alpha2[0] = '9';
>  	user_alpha2[1] = '7';
>  
> +	reg_is_indoor = false;

Yeah this is not needed as during init this will be false, but you
do want to ensure you set this to flase during reset of regulatory.

  Luis

  reply	other threads:[~2014-01-25  0:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 15:52 [PATCH v2 0/6] Enable additional channels for use Ilan Peer
2014-01-15 15:52 ` [PATCH v2 1/6] cfg80211: Add indoor only and GO concurrent channel attributes Ilan Peer
2014-01-15 15:52 ` [PATCH v2 2/6] cfg80211: Add Kconfig option for cellular BS hints Ilan Peer
2014-01-15 15:52 ` [PATCH v2 3/6] cfg80211: Enable GO operation on additional channels Ilan Peer
2014-01-25  0:09   ` Luis R. Rodriguez
2014-01-26 22:03     ` Peer, Ilan
2014-01-26 22:21     ` Peer, Ilan
2014-01-27  8:41     ` Peer, Ilan
2014-01-15 15:52 ` [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation Ilan Peer
2014-01-25  0:20   ` Luis R. Rodriguez [this message]
2014-01-26 22:11     ` Peer, Ilan
2014-02-18 22:22       ` Luis R. Rodriguez
2014-01-15 15:52 ` [PATCH v2 5/6] cfg80211: Enable GO operation on indoor channels Ilan Peer
2014-01-15 15:52 ` [PATCH v2 6/6] mac80211: Enable initiating radiation " Ilan Peer
2014-01-25  0:21   ` Luis R. Rodriguez
2014-01-25  0:24 ` [PATCH v2 0/6] Enable additional channels for use Luis R. Rodriguez
2014-01-26 22:13   ` Peer, Ilan
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 19:16 Ilan Peer
2013-12-03 19:16 ` [PATCH v2 4/6] cfg80211: Add an option to hint indoor operation Ilan Peer

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=20140125002002.GB28512@garbanzo.do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=ilan.peer@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wireless-regdb@lists.infradead.org \
    /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).