diff mbox

[v5,5/5] cfg80211: Enable GO operation on indoor channels

Message ID 1392896671-4288-6-git-send-email-ilan.peer@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Peer, Ilan Feb. 20, 2014, 11:44 a.m. UTC
Allow GO operation on a channel marked with IEEE80211_CHAN_INDOOR_ONLY
iff there is a user hint indicating that the platform is operating in
an indoor environment, i.e., the platform is a printer or media center
device.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 net/wireless/chan.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Luis R. Rodriguez Feb. 22, 2014, 12:09 a.m. UTC | #1
On Thu, Feb 20, 2014 at 3:44 AM, Ilan Peer <ilan.peer@intel.com> wrote:
> Allow GO operation on a channel marked with IEEE80211_CHAN_INDOOR_ONLY
> iff there is a user hint indicating that the platform is operating in
> an indoor environment, i.e., the platform is a printer or media center
> device.
>
> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
> ---
>  net/wireless/chan.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index 1d8c990..b18367d 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -611,6 +611,8 @@ EXPORT_SYMBOL(cfg80211_chandef_usable);
>   * IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface
>   * associated to an AP on the same channel or on the same UNII band
>   * (assuming that the AP is an authorized master).
> + * In addition allow the GO to operate on a channel on which indoor operation is
> + * allowed, iff we are currently operating in an indoor environment.
>   */
>  static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
>                                         struct ieee80211_channel *chan)
> @@ -621,8 +623,14 @@ static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
>         ASSERT_RTNL();
>
>         if (!config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) ||
> -           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR) ||
> -           !(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
> +           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
> +               return false;
> +
> +       if (regulatory_indoor_allowed() &&
> +           (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
> +               return true;
> +
> +       if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
>                 return false;

Shouldn't this check go before the indoor one?

  Luis
--
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
Peer, Ilan Feb. 22, 2014, 7:54 p.m. UTC | #2
> >  static bool cfg80211_go_permissive_chan(struct

> cfg80211_registered_device *rdev,

> >                                         struct ieee80211_channel

> > *chan) @@ -621,8 +623,14 @@ static bool

> cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,

> >         ASSERT_RTNL();

> >

> >         if (!config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) ||

> > -           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR)

> ||

> > -           !(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))

> > +           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))

> > +               return false;

> > +

> > +       if (regulatory_indoor_allowed() &&

> > +           (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))

> > +               return true;

> > +

> > +       if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))

> >                 return false;

> 

> Shouldn't this check go before the indoor one?

> 


I do not think so, as this relaxations is orthogonal to the GO concurrent one. It means that If a channel is enabled but only under indoor and indoor operation is hinted the relaxation removes the NO_IR restriction if such exists (without the relaxation indoor operation would be  allowed but not  for GO).

Regards,

Ilan.
Luis R. Rodriguez Feb. 22, 2014, 9:08 p.m. UTC | #3
On Sat, Feb 22, 2014 at 11:54 AM, Peer, Ilan <ilan.peer@intel.com> wrote:
>> >  static bool cfg80211_go_permissive_chan(struct
>> cfg80211_registered_device *rdev,
>> >                                         struct ieee80211_channel
>> > *chan) @@ -621,8 +623,14 @@ static bool
>> cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
>> >         ASSERT_RTNL();
>> >
>> >         if (!config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) ||
>> > -           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR)
>> ||
>> > -           !(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
>> > +           !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
>> > +               return false;
>> > +
>> > +       if (regulatory_indoor_allowed() &&
>> > +           (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
>> > +               return true;
>> > +
>> > +       if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
>> >                 return false;
>>
>> Shouldn't this check go before the indoor one?
>>
>
> I do not think so, as this relaxations is orthogonal to the GO concurrent one. It means that If a channel is enabled but only under indoor and indoor operation is hinted the relaxation removes the NO_IR restriction if such exists (without the relaxation indoor operation would be  allowed but not  for GO).

Ah yes, the first check remains as this then though:

if (!config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) ||
   !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
             return false;

That seems wrong for the general case.

  Luis
--
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
Peer, Ilan Feb. 23, 2014, 7:21 a.m. UTC | #4
PiBPbiBTYXQsIEZlYiAyMiwgMjAxNCBhdCAxMTo1NCBBTSwgUGVlciwgSWxhbiA8aWxhbi5wZWVy
QGludGVsLmNvbT4gd3JvdGU6DQo+ID4+ID4gIHN0YXRpYyBib29sIGNmZzgwMjExX2dvX3Blcm1p
c3NpdmVfY2hhbihzdHJ1Y3QNCj4gPj4gY2ZnODAyMTFfcmVnaXN0ZXJlZF9kZXZpY2UgKnJkZXYs
DQo+ID4+ID4gICAgICAgIC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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/net/wireless/chan.c b/net/wireless/chan.c
index 1d8c990..b18367d 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -611,6 +611,8 @@  EXPORT_SYMBOL(cfg80211_chandef_usable);
  * IEEE80211_CHAN_GO_CONCURRENT and there is an additional station interface
  * associated to an AP on the same channel or on the same UNII band
  * (assuming that the AP is an authorized master).
+ * In addition allow the GO to operate on a channel on which indoor operation is
+ * allowed, iff we are currently operating in an indoor environment.
  */
 static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
 					struct ieee80211_channel *chan)
@@ -621,8 +623,14 @@  static bool cfg80211_go_permissive_chan(struct cfg80211_registered_device *rdev,
 	ASSERT_RTNL();
 
 	if (!config_enabled(CONFIG_CFG80211_REG_RELAX_NO_IR) ||
-	    !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR) ||
-	    !(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
+	    !(wiphy->regulatory_flags & REGULATORY_ENABLE_RELAX_NO_IR))
+		return false;
+
+	if (regulatory_indoor_allowed() &&
+	    (chan->flags & IEEE80211_CHAN_INDOOR_ONLY))
+		return true;
+
+	if (!(chan->flags & IEEE80211_CHAN_GO_CONCURRENT))
 		return false;
 
 	list_for_each_entry(wdev_iter, &rdev->wdev_list, list) {