diff mbox

[3/3,RFC] cfg80211: Enable GO operation on additional channels

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

Commit Message

Peer, Ilan July 2, 2013, 12:28 p.m. UTC
From: David Spinadel <david.spinadel@intel.com>

Allow GO operation on a channel marked with
IEEE80211_CHAN_INDOOR_ONLY or IEEE80211_CHAN_GO_CONCURRENT
iff there is an active station interface that is associated to
an AP operating on this channel.

Note that this is a permissive approach to the FCC definitions,
that require a clear assessment that either the platform device
is an indoor device, or the device operating the AP is an indoor
device, i.e., AC powered.
It is assumed that these restrictions are enforced by user space.
Furthermore, it is assumed, that if the conditions that allowed for
the operation of the GO on such a channel change, it is the
responsibility of user space to evacuate the GO from the channel.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 include/net/cfg80211.h |    4 +-
 net/mac80211/ibss.c    |    2 +-
 net/wireless/Kconfig   |   10 +++++
 net/wireless/chan.c    |   98 ++++++++++++++++++++++++++++++++++++++++++++----
 net/wireless/mesh.c    |    2 +-
 net/wireless/nl80211.c |    8 ++--
 net/wireless/trace.h   |   11 ++++--
 7 files changed, 118 insertions(+), 17 deletions(-)

Comments

Jouni Malinen July 8, 2013, 10:04 a.m. UTC | #1
On Tue, Jul 02, 2013 at 03:28:15PM +0300, Ilan Peer wrote:
> Allow GO operation on a channel marked with
> IEEE80211_CHAN_INDOOR_ONLY or IEEE80211_CHAN_GO_CONCURRENT
> iff there is an active station interface that is associated to
> an AP operating on this channel.
> 
> Note that this is a permissive approach to the FCC definitions,
> that require a clear assessment that either the platform device
> is an indoor device, or the device operating the AP is an indoor
> device, i.e., AC powered.
> It is assumed that these restrictions are enforced by user space.

The introduction in 0/3 mentioned DFS, but I did not see it being
addressed in any of the actual changes. Is this only for indoors vs.
outdoors?

> Furthermore, it is assumed, that if the conditions that allowed for
> the operation of the GO on such a channel change, it is the
> responsibility of user space to evacuate the GO from the channel.

Do you have plans or changes to address this? I'd assume wpa_supplicant
could stop the group on channel list changes, but I don't think it does
that currently.
Luis R. Rodriguez July 8, 2013, 10:04 p.m. UTC | #2
On Tue, Jul 2, 2013 at 5:28 AM, Ilan Peer <ilan.peer@intel.com> wrote:
> From: David Spinadel <david.spinadel@intel.com>
>
> Allow GO operation on a channel marked with
> IEEE80211_CHAN_INDOOR_ONLY or IEEE80211_CHAN_GO_CONCURRENT
> iff there is an active station interface that is associated to
> an AP operating on this channel.
>
> Note that this is a permissive approach to the FCC definitions,
> that require a clear assessment that either the platform device
> is an indoor device, or the device operating the AP is an indoor
> device, i.e., AC powered.
> It is assumed that these restrictions are enforced by user space.
> Furthermore, it is assumed, that if the conditions that allowed for
> the operation of the GO on such a channel change, it is the
> responsibility of user space to evacuate the GO from the channel.

In the context of strict regulatory data we currently do not
differentiate specifically between a device that can initiate
radiation between AP and Group Owner (GO) but in your earlier patches
you proposed a way to do that. I reviewed feedback on that patch
there. It may make sense however to define clearly what you mean by
why the flag is being introduced by documenting the use case, ie what
you describe here. Other regulatory bodies may follow and it helps to
provide context here.

My review below.

> Signed-off-by: David Spinadel <david.spinadel@intel.com>
> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
> ---
>  include/net/cfg80211.h |    4 +-
>  net/mac80211/ibss.c    |    2 +-
>  net/wireless/Kconfig   |   10 +++++
>  net/wireless/chan.c    |   98 ++++++++++++++++++++++++++++++++++++++++++++----
>  net/wireless/mesh.c    |    2 +-
>  net/wireless/nl80211.c |    8 ++--
>  net/wireless/trace.h   |   11 ++++--
>  7 files changed, 118 insertions(+), 17 deletions(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index f0badeb..17d693d 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -4070,12 +4070,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
>   * cfg80211_reg_can_beacon - check if beaconing is allowed
>   * @wiphy: the wiphy
>   * @chandef: the channel definition
> + * @p2p_go: if the interface type is a P2P GO
>   *
>   * Return: %true if there is no secondary channel or the secondary channel(s)
>   * can be used for beaconing (i.e. is not a radar channel etc.)
>   */
>  bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
> -                            struct cfg80211_chan_def *chandef);
> +                            struct cfg80211_chan_def *chandef,
> +                            bool p2p_go);
>
>  /*
>   * cfg80211_ch_switch_notify - update wdev channel and notify userspace
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index ea7b9c2..1e0fac1 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -82,7 +82,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
>         sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
>
>         chandef = ifibss->chandef;
> -       if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
> +       if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef, false)) {
>                 chandef.width = NL80211_CHAN_WIDTH_20;
>                 chandef.center_freq1 = chan->center_freq;
>         }
> diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
> index de76078..d9e2be7 100644
> --- a/net/wireless/Kconfig
> +++ b/net/wireless/Kconfig
> @@ -102,6 +102,16 @@ config CFG80211_REG_CELLULAR_HINTS
>           This option adds support for drivers that can receive regulatory
>           hints from cellular base stations
>
> +config CFG80211_REG_SOFT_CONFIGURATIONS
> +       bool "cfg80211 support for GO operation on additional channels"
> +       depends on CFG80211 && CFG80211_CERTIFICATION_ONUS
> +       ---help---
> +         This option enables the operation of a P2P Group Owner on
> +         additional channels, if there is a clear assessment that
> +         the platform device operates in an indoor environment or
> +         in case that there is an additional BSS interface which is
> +         connected to an AP which is an indoor device.
> +

I like this approach, indeed this is great work and reflects usage of
the onus kconfig option appropriately in this case due dilligence
required more in part on userspace / other components for full
regulatory compliance.

>  config CFG80211_DEFAULT_PS
>         bool "enable powersave by default"
>         depends on CFG80211
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index 50f6195..92d9e3c 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -457,18 +457,102 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>  }
>  EXPORT_SYMBOL(cfg80211_chandef_usable);
>
> +#ifdef CPTCFG_CFG80211_REG_SOFT_CONFIGURATIONS
> +static int cfg80211_get_unii_band(int freq)
> +{
> +       /* UNII-1 */
> +       if (freq >= 5150 && freq <= 5250)
> +               return 0;
> +
> +       /* UNII-2 */
> +       if (freq > 5250 && freq <= 5350)
> +               return 1;
> +
> +       /* UNII-2E */
> +       if (freq >= 5470 && freq <= 5725)
> +               return 2;
> +
> +       /* UNII-3 */
> +       if (freq > 5725 && freq <= 5825)
> +               return 3;
> +
> +       WARN_ON(1);
> +       return -EINVAL;
> +}
> +#endif

#else?

Are you aware of UNII-1, UNII-2, UNII-2E, UNII-3 are specific world
regulatory language bands? When I last tried to look for a clear
definition I could not find a clear definition of them and its why on
the ath module on for QCA modules I state "we call these" in reference
to the UNII nomenclature. If we can get a clear resource for its
definition that would help here.

> +
> +/* For GO only, check if the channel can be used under permissive conditions
> + * mandated by the FCC, i.e., the channel is marked as:

Ah -- note - FCC, you are making an FCC specific rule global, that
doesn't seems right. The implementation should reflect that *some*
regulatory bodies are implicating software requirements for GO
operation and in that case this tries to implement such known current
interpretations.

Hope is that regulatory bodies will stick to this singular
interpretation / preference when required.

So my point: your code treats this appropriately as agnostic to the
regulatory body but your comments do not, just modify the comments
more to make it more agnostic.

> + * 1. Indoor only: a GO can be operational on such a channel, iff there is
> + *    clear assessment that the platform device is indoor.
> + * 2. Concurrent GO: a GO can be operational on such a channel, iff there is an
> + *    additional station interface connected to an AP on this channel.
> + *
> + * TODO: The function is too permissive, as it does not verify the platform
> + * device type is indeed indoor, or that the AP is indoor/AC powered.

So to do this properly we need an eventual userspace API to throw to
kernelspace if we are AC powered? We'll need this to enhance this
routine here?

> + */
> +static bool cfg80211_can_go_use_chan(struct cfg80211_registered_device *rdev,
> +                                    struct ieee80211_channel *chan)
> +{
> +#ifdef CPTCFG_CFG80211_REG_SOFT_CONFIGURATIONS
> +       struct wireless_dev *wdev_iter;
> +
> +       ASSERT_RTNL();
> +
> +       if (!(chan->flags & (IEEE80211_CHAN_INDOOR_ONLY |
> +                            IEEE80211_CHAN_GO_CONCURRENT)))
> +               return false;
> +
> +       if (chan->band == IEEE80211_BAND_60GHZ)
> +               return false;
> +
> +       list_for_each_entry(wdev_iter, &rdev->wdev_list, list) {
> +               struct ieee80211_channel *other_chan = NULL;
> +
> +               if (wdev_iter->iftype != NL80211_IFTYPE_STATION ||
> +                   (!netif_running(wdev_iter->netdev)))
> +                               continue;
> +
> +
> +               wdev_lock(wdev_iter);
> +               if (wdev_iter->current_bss)
> +                       other_chan = wdev_iter->current_bss->pub.channel;
> +               wdev_unlock(wdev_iter);
> +
> +               if (!other_chan)
> +                       continue;
> +
> +               if (chan == other_chan)
> +                       return true;
> +               else if ((chan->band == IEEE80211_BAND_5GHZ) &&
> +                        (cfg80211_get_unii_band(chan->center_freq) ==
> +                         cfg80211_get_unii_band(other_chan->center_freq)))
> +                       return true;
> +       }
> +#endif
> +       return false;
> +}

Please wrap code as follows:

#ifdef FOO
static int foo(void)
{
  return true;
}
#else
static int foo(void)
  return false;
}
#endif

In the meantime, while you get all your patch sets properly developed
I'd recommend to define the code returning false there strictly or
perhaps for any flag on the channel requiring DFS / no-ibss, or
passive scan. The stricter case, defining false always, seems to be
what you are suggesting here.

Do you have a white list that can exclude some channels for now
globally or somehow as all this lines up?

  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 July 9, 2013, 5:40 a.m. UTC | #3
> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Monday, July 08, 2013 13:04
> To: Peer, Ilan
> Cc: linux-wireless@vger.kernel.org; mcgrof@do-not-panic.com; Spinadel, David
> Subject: Re: [PATCH 3/3] [RFC] cfg80211: Enable GO operation on additional
> channels
> 
> On Tue, Jul 02, 2013 at 03:28:15PM +0300, Ilan Peer wrote:
> > Allow GO operation on a channel marked with
> IEEE80211_CHAN_INDOOR_ONLY
> > or IEEE80211_CHAN_GO_CONCURRENT iff there is an active station
> > interface that is associated to an AP operating on this channel.
> >
> > Note that this is a permissive approach to the FCC definitions, that
> > require a clear assessment that either the platform device is an
> > indoor device, or the device operating the AP is an indoor device,
> > i.e., AC powered.
> > It is assumed that these restrictions are enforced by user space.
> 
> The introduction in 0/3 mentioned DFS, but I did not see it being addressed in
> any of the actual changes. Is this only for indoors vs.
> outdoors?
>

The DFS was mentioned in 0/3 in the context of an example for a case where a device can support WFD on bands where an authorized master is operating. The example assumes that the master has radar detection capabilities and is able to evacuate its operating channel if needed (which must be followed by the device also evicting the WFD operation from this channel). 

The purpose of this patch was to allow the instantiation of a GO on channels marked as indoor/Concurrent GO assuming some conditions are met, ignoring the NO_IBSS and PASSIVE channels. I intend to implement to full restriction logic in the wpa_supplicant (based on the device type etc.), and also handle the actual indication that this channel can no longer be used, eviction and new channel selection in the wpa_supplicant.

> > Furthermore, it is assumed, that if the conditions that allowed for
> > the operation of the GO on such a channel change, it is the
> > responsibility of user space to evacuate the GO from the channel.
> 
> Do you have plans or changes to address this? I'd assume wpa_supplicant could
> stop the group on channel list changes, but I don't think it does that currently.

Yes. This is currently WIP :)
--
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 July 10, 2013, 10:47 a.m. UTC | #4
SGkgTHVpcywgDQoNClRoYW5rcyBmb3IgdGhlIHJldmlldyA6KQ0KDQpJbGFuLg0KDQo+ID4gTm90
ZSB0aGF0IHRoaXMgaXMgYSBwZXJtaXNzaXZlIGFwcHJvYWNoIHRvIHRoZSBGQ0MgZGVmaW5pdGlv
bnMsIHRoY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AgIGNvbnRpbnVlOw0KPiA+ICsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgIHdkZXZfbG9j
ayh3ZGV2X2l0ZXIpOw0KPiA+ICsgICAgICAgICAgICAgICBpZiAod2Rldl9pdGVyLT5jdXJyZW50
X2JzcykNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBvdGhlcl9jaGFuID0gd2Rldl9pdGVy
LT5jdXJyZW50X2Jzcy0+cHViLmNoYW5uZWw7DQo+ID4gKyAgICAgICAgICAgICAgIHdkZXZfdW5s
b2NrKHdkZXZfaXRlcik7DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBpZiAoIW90aGVyX2No
YW4pDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7DQo+ID4gKw0KPiA+ICsg
ICAgICAgICAgICAgICBpZiAoY2hhbiA9PSBvdGhlcl9jaGFuKQ0KPiA+ICsgICAgICAgICAgICAg
ICAgICAgICAgIHJldHVybiB0cnVlOw0KPiA+ICsgICAgICAgICAgICAgICBlbHNlIGlmICgoY2hh
bi0+YmFuZCA9PSBJRUVFODAyMTFfQkFORF81R0haKSAmJg0KPiA+ICsgICAgICAgICAgICAgICAg
ICAgICAgICAoY2ZnODAyMTFfZ2V0X3VuaWlfYmFuZChjaGFuLT5jZW50ZXJfZnJlcSkgPT0NCj4g
PiArICAgICAgICAgICAgICAgICAgICAgICAgIGNmZzgwMjExX2dldF91bmlpX2JhbmQob3RoZXJf
Y2hhbi0+Y2VudGVyX2ZyZXEpKSkNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4g
dHJ1ZTsNCj4gPiArICAgICAgIH0NCj4gPiArI2VuZGlmDQo+ID4gKyAgICAgICByZXR1cm4gZmFs
c2U7DQo+ID4gK30NCj4gDQo+IFBsZWFzZSB3cmFwIGNvZGUgYXMgZm9sbG93czoNCj4gDQo+ICNp
ZmRlZiBGT08NCj4gc3RhdGljIGludCBmb28odm9pZCkNCj4gew0KPiAg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HlvdSBwbGVhc2UgY2xhcmlmeSB0aGlzIHBvaW50Pw0K
--
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
Luis R. Rodriguez July 16, 2013, 8:57 p.m. UTC | #5
On Wed, Jul 10, 2013 at 3:47 AM, Peer, Ilan <ilan.peer@intel.com> wrote:
>> Are you aware of UNII-1, UNII-2, UNII-2E, UNII-3 are specific world regulatory
>> language bands? When I last tried to look for a clear definition I could not find
>> a clear definition of them and its why on the ath module on for QCA modules I
>> state "we call these" in reference to the UNII nomenclature. If we can get a
>> clear resource for its definition that would help here.
>>
>
> Maybe these link will help.
> http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/xml/CFR-2010-title47-vol1-part15.xml#seqnum15.403
> http://hraunfoss.fcc.gov/edocs_public/attachmatch/FCC-13-22A1.pdf
>
> Anyway, I will use your ''we call these" notation as well :)

No no, this is good, its just United States / FCC biased and I hadn't
seen the documentation you provided before. This confirms these are
official terms but still just US / FCC biased. My point was that we
should be careful to not make global statements on regulatory code
about things that are not global. If we know only the FCC calls this
UNII well lets document that and provide the reference you supplied. I
anticipated having to deal with special case regulatory code outside
of of what CRDA / wireless-regdb provides -- given that CRDA /
wireless-regdb were meant to be more RF agnostic anyway.

Given that other vendors may also want to get the UNII band can you
stuff instead cfg80211_get_unii_band() into reg.c and do the #ifdef
properly with the Kconfig, and export it as well, as well as document
it properly providing the reference you mentioned.

>> > + * 1. Indoor only: a GO can be operational on such a channel, iff there is
>> > + *    clear assessment that the platform device is indoor.
>> > + * 2. Concurrent GO: a GO can be operational on such a channel, iff there is
>> an
>> > + *    additional station interface connected to an AP on this channel.
>> > + *
>> > + * TODO: The function is too permissive, as it does not verify the
>> > + platform
>> > + * device type is indeed indoor, or that the AP is indoor/AC powered.
>>
>> So to do this properly we need an eventual userspace API to throw to
>> kernelspace if we are AC powered? We'll need this to enhance this routine
>> here?
>>
>
> Not sure about this point. I prefer leaving the exact knowledge of the device type, being AC Powered or not (and which type of AC power) etc. out side of the kernel. The approach I chose with this patch was to only allow to start a GO on such a channel, making the basic verification done above, assuming that the user space component guarantees that all the full restrictions are satisfied.

Fair enough. Seems we just need to zero in now on the requirement or
not on the extra flag you suggested.

>> In the meantime, while you get all your patch sets properly developed I'd
>> recommend to define the code returning false there strictly or perhaps for any
>> flag on the channel requiring DFS / no-ibss, or passive scan. The stricter case,
>> defining false always, seems to be what you are suggesting here.
>
> I do not think that this is needed here. Returning false, means that the code should test if the PASSIVE_SCAN and NO_IBSS are not set on the channel we want to start beaconing on.
>
>> Do you have a white list that can exclude some channels for now globally or
>> somehow as all this lines up?
>>
>
> Note sure I understood what you are looking for. Can you please clarify this point?

It was unclear for what exact channels you needed to deal with here.
Given review so far wouldn't it just be DFS flagged channels on some
UNII bands ? Then again if the indoor flag needs to be pegged to to a
specific UNII band and we can do that on wireless-regdb do we even
need the UNII band check routine helper?

  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 July 17, 2013, 7:15 p.m. UTC | #6
> On Wed, Jul 10, 2013 at 3:47 AM, Peer, Ilan <ilan.peer@intel.com> wrote:

> >> Are you aware of UNII-1, UNII-2, UNII-2E, UNII-3 are specific world

> >> regulatory language bands? When I last tried to look for a clear

> >> definition I could not find a clear definition of them and its why on

> >> the ath module on for QCA modules I state "we call these" in

> >> reference to the UNII nomenclature. If we can get a clear resource for its

> definition that would help here.

> >>

> >

> > Maybe these link will help.

> > http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/xml/CFR-2010-title4

> > 7-vol1-part15.xml#seqnum15.403

> > http://hraunfoss.fcc.gov/edocs_public/attachmatch/FCC-13-22A1.pdf

> >

> > Anyway, I will use your ''we call these" notation as well :)

> 

> No no, this is good, its just United States / FCC biased and I hadn't seen the

> documentation you provided before. This confirms these are official terms but

> still just US / FCC biased. My point was that we should be careful to not make

> global statements on regulatory code about things that are not global. If we

> know only the FCC calls this UNII well lets document that and provide the

> reference you supplied. I anticipated having to deal with special case

> regulatory code outside of of what CRDA / wireless-regdb provides -- given that

> CRDA / wireless-regdb were meant to be more RF agnostic anyway.

> 

> Given that other vendors may also want to get the UNII band can you stuff

> instead cfg80211_get_unii_band() into reg.c and do the #ifdef properly with the

> Kconfig, and export it as well, as well as document it properly providing the

> reference you mentioned.


Sure.

> 

> >> > + * 1. Indoor only: a GO can be operational on such a channel, iff there is

> >> > + *    clear assessment that the platform device is indoor.

> >> > + * 2. Concurrent GO: a GO can be operational on such a channel,

> >> > + iff there is

> >> an

> >> > + *    additional station interface connected to an AP on this channel.

> >> > + *

> >> > + * TODO: The function is too permissive, as it does not verify the

> >> > + platform

> >> > + * device type is indeed indoor, or that the AP is indoor/AC powered.

> >>

> >> So to do this properly we need an eventual userspace API to throw to

> >> kernelspace if we are AC powered? We'll need this to enhance this

> >> routine here?

> >>

> >

> > Not sure about this point. I prefer leaving the exact knowledge of the device

> type, being AC Powered or not (and which type of AC power) etc. out side of the

> kernel. The approach I chose with this patch was to only allow to start a GO on

> such a channel, making the basic verification done above, assuming that the

> user space component guarantees that all the full restrictions are satisfied.

> 

> Fair enough. Seems we just need to zero in now on the requirement or not on

> the extra flag you suggested.

> 

> >> In the meantime, while you get all your patch sets properly developed

> >> I'd recommend to define the code returning false there strictly or

> >> perhaps for any flag on the channel requiring DFS / no-ibss, or

> >> passive scan. The stricter case, defining false always, seems to be what you

> are suggesting here.

> >

> > I do not think that this is needed here. Returning false, means that the code

> should test if the PASSIVE_SCAN and NO_IBSS are not set on the channel we

> want to start beaconing on.

> >

> >> Do you have a white list that can exclude some channels for now

> >> globally or somehow as all this lines up?

> >>

> >


I'll try to provide such list ... 

> > Note sure I understood what you are looking for. Can you please clarify this

> point?

> 

> It was unclear for what exact channels you needed to deal with here.

> Given review so far wouldn't it just be DFS flagged channels on some UNII

> bands ? Then again if the indoor flag needs to be pegged to to a specific UNII

> band and we can do that on wireless-regdb do we even need the UNII band

> check routine helper?

> 


Generally it is possible that the indoor property is not pegged to the 'other_channel', or it is possible that it is pegged but they are not in the same UNII band, so the verification is still needed. I guess that once I get the list you requested things will be clearer :) 

Regards,

Ilan.
Luis R. Rodriguez July 18, 2013, 11:34 p.m. UTC | #7
On Wed, Jul 17, 2013 at 12:15 PM, Peer, Ilan <ilan.peer@intel.com> wrote:
>> It was unclear for what exact channels you needed to deal with here.
>> Given review so far wouldn't it just be DFS flagged channels on some UNII
>> bands ? Then again if the indoor flag needs to be pegged to to a specific UNII
>> band and we can do that on wireless-regdb do we even need the UNII band
>> check routine helper?
>>
>
> Generally it is possible that the indoor property is not pegged to the 'other_channel', or it is possible that it is pegged but they are not in the same UNII band, so the verification is still needed. I guess that once I get the list you requested things will be clearer :)

OK so there are exceptions to the indoor flag affecting GO under these
rules or not. Looking forward to the respin.

  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
Luis R. Rodriguez Oct. 4, 2013, 5:38 p.m. UTC | #8
On Thu, Jul 18, 2013 at 4:34 PM, Luis R. Rodriguez
<mcgrof@do-not-panic.com> wrote:
> On Wed, Jul 17, 2013 at 12:15 PM, Peer, Ilan <ilan.peer@intel.com> wrote:
>>> It was unclear for what exact channels you needed to deal with here.
>>> Given review so far wouldn't it just be DFS flagged channels on some UNII
>>> bands ? Then again if the indoor flag needs to be pegged to to a specific UNII
>>> band and we can do that on wireless-regdb do we even need the UNII band
>>> check routine helper?
>>>
>>
>> Generally it is possible that the indoor property is not pegged to the 'other_channel', or it is possible that it is pegged but they are not in the same UNII band, so the verification is still needed. I guess that once I get the list you requested things will be clearer :)
>
> OK so there are exceptions to the indoor flag affecting GO under these
> rules or not. Looking forward to the respin.

Anxiously looking forward to the respin :D

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to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Qgbm90IGdldCBhIGNoYW5jZSB0byB3b3JrIG9uIHRoaXMgaW4gdGhlIGxh
c3QgY291cGxlIG9mIG1vbnRocy4gSG9wZSBJJ2xsIGdldCB0byBpdCB0aGlzIHdlZWsgb3IgdGhl
IG5leHQuIFNvcnJ5IGZvciBub3QgdXBkYXRpbmcgZWFybGllciAuLi4NCg0KUmVnYXJkcywNCg0K
SWxhbi4NCg0K
--
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 f0badeb..17d693d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4070,12 +4070,14 @@  void cfg80211_report_obss_beacon(struct wiphy *wiphy,
  * cfg80211_reg_can_beacon - check if beaconing is allowed
  * @wiphy: the wiphy
  * @chandef: the channel definition
+ * @p2p_go: if the interface type is a P2P GO
  *
  * Return: %true if there is no secondary channel or the secondary channel(s)
  * can be used for beaconing (i.e. is not a radar channel etc.)
  */
 bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
-			     struct cfg80211_chan_def *chandef);
+			     struct cfg80211_chan_def *chandef,
+			     bool p2p_go);
 
 /*
  * cfg80211_ch_switch_notify - update wdev channel and notify userspace
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ea7b9c2..1e0fac1 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -82,7 +82,7 @@  static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 	sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
 
 	chandef = ifibss->chandef;
-	if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
+	if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef, false)) {
 		chandef.width = NL80211_CHAN_WIDTH_20;
 		chandef.center_freq1 = chan->center_freq;
 	}
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index de76078..d9e2be7 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -102,6 +102,16 @@  config CFG80211_REG_CELLULAR_HINTS
 	  This option adds support for drivers that can receive regulatory
 	  hints from cellular base stations
 
+config CFG80211_REG_SOFT_CONFIGURATIONS
+	bool "cfg80211 support for GO operation on additional channels"
+	depends on CFG80211 && CFG80211_CERTIFICATION_ONUS
+	---help---
+	  This option enables the operation of a P2P Group Owner on
+	  additional channels, if there is a clear assessment that
+	  the platform device operates in an indoor environment or
+	  in case that there is an additional BSS interface which is
+	  connected to an AP which is an indoor device.
+
 config CFG80211_DEFAULT_PS
 	bool "enable powersave by default"
 	depends on CFG80211
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 50f6195..92d9e3c 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -457,18 +457,102 @@  bool cfg80211_chandef_usable(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_chandef_usable);
 
+#ifdef CPTCFG_CFG80211_REG_SOFT_CONFIGURATIONS
+static int cfg80211_get_unii_band(int freq)
+{
+	/* UNII-1 */
+	if (freq >= 5150 && freq <= 5250)
+		return 0;
+
+	/* UNII-2 */
+	if (freq > 5250 && freq <= 5350)
+		return 1;
+
+	/* UNII-2E */
+	if (freq >= 5470 && freq <= 5725)
+		return 2;
+
+	/* UNII-3 */
+	if (freq > 5725 && freq <= 5825)
+		return 3;
+
+	WARN_ON(1);
+	return -EINVAL;
+}
+#endif
+
+/* For GO only, check if the channel can be used under permissive conditions
+ * mandated by the FCC, i.e., the channel is marked as:
+ * 1. Indoor only: a GO can be operational on such a channel, iff there is
+ *    clear assessment that the platform device is indoor.
+ * 2. Concurrent GO: a GO can be operational on such a channel, iff there is an
+ *    additional station interface connected to an AP on this channel.
+ *
+ * TODO: The function is too permissive, as it does not verify the platform
+ * device type is indeed indoor, or that the AP is indoor/AC powered.
+ */
+static bool cfg80211_can_go_use_chan(struct cfg80211_registered_device *rdev,
+				     struct ieee80211_channel *chan)
+{
+#ifdef CPTCFG_CFG80211_REG_SOFT_CONFIGURATIONS
+	struct wireless_dev *wdev_iter;
+
+	ASSERT_RTNL();
+
+	if (!(chan->flags & (IEEE80211_CHAN_INDOOR_ONLY |
+			     IEEE80211_CHAN_GO_CONCURRENT)))
+		return false;
+
+	if (chan->band == IEEE80211_BAND_60GHZ)
+		return false;
+
+	list_for_each_entry(wdev_iter, &rdev->wdev_list, list) {
+		struct ieee80211_channel *other_chan = NULL;
+
+		if (wdev_iter->iftype != NL80211_IFTYPE_STATION ||
+		    (!netif_running(wdev_iter->netdev)))
+				continue;
+
+
+		wdev_lock(wdev_iter);
+		if (wdev_iter->current_bss)
+			other_chan = wdev_iter->current_bss->pub.channel;
+		wdev_unlock(wdev_iter);
+
+		if (!other_chan)
+			continue;
+
+		if (chan == other_chan)
+			return true;
+		else if ((chan->band == IEEE80211_BAND_5GHZ) &&
+			 (cfg80211_get_unii_band(chan->center_freq) ==
+			  cfg80211_get_unii_band(other_chan->center_freq)))
+			return true;
+	}
+#endif
+	return false;
+}
+
 bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
-			     struct cfg80211_chan_def *chandef)
+			     struct cfg80211_chan_def *chandef,
+			     bool p2p_go)
 {
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
 	bool res;
+	u32 flags;
 
-	trace_cfg80211_reg_can_beacon(wiphy, chandef);
+	trace_cfg80211_reg_can_beacon(wiphy, chandef, p2p_go);
+
+	flags = IEEE80211_CHAN_DISABLED | IEEE80211_CHAN_RADAR;
+
+	/* Under certain conditions a GO can operate on channels marked
+	 * with IEEE80211_CHAN_PASSIVE_SCAN and IEEE80211_CHAN_NO_IBSS, so set
+	 * these flags only if the conditions are not met.
+	 */
+	if (!p2p_go || !cfg80211_can_go_use_chan(rdev, chandef->chan))
+		flags |= IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS;
 
-	res = cfg80211_chandef_usable(wiphy, chandef,
-				      IEEE80211_CHAN_DISABLED |
-				      IEEE80211_CHAN_PASSIVE_SCAN |
-				      IEEE80211_CHAN_NO_IBSS |
-				      IEEE80211_CHAN_RADAR);
+	res = cfg80211_chandef_usable(wiphy, chandef, flags);
 
 	trace_cfg80211_return_bool(res);
 	return res;
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 30c4920..746c8b4 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -172,7 +172,7 @@  int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
 		setup->basic_rates = ieee80211_mandatory_rates(sband);
 	}
 
-	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef))
+	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef, false))
 		return -EINVAL;
 
 	err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cf22b22..204c160 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1801,7 +1801,8 @@  static int __nl80211_set_channel(struct cfg80211_registered_device *rdev,
 			result = -EBUSY;
 			break;
 		}
-		if (!cfg80211_reg_can_beacon(&rdev->wiphy, &chandef)) {
+		if (!cfg80211_reg_can_beacon(&rdev->wiphy, &chandef,
+					     iftype == NL80211_IFTYPE_P2P_GO)) {
 			result = -EINVAL;
 			break;
 		}
@@ -3150,7 +3151,8 @@  static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 	} else if (!nl80211_get_ap_channel(rdev, &params))
 		return -EINVAL;
 
-	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef))
+	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef,
+				     wdev->iftype == NL80211_IFTYPE_P2P_GO))
 		return -EINVAL;
 
 	err = cfg80211_chandef_dfs_required(wdev->wiphy, &params.chandef);
@@ -6319,7 +6321,7 @@  static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
 	if (err)
 		return err;
 
-	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef))
+	if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef, false))
 		return -EINVAL;
 
 	switch (ibss.chandef.width) {
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index e1534baf..7be32c3 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2115,18 +2115,21 @@  TRACE_EVENT(cfg80211_cqm_rssi_notify,
 );
 
 TRACE_EVENT(cfg80211_reg_can_beacon,
-	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
-	TP_ARGS(wiphy, chandef),
+	TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
+		 bool p2p_go),
+	TP_ARGS(wiphy, chandef, p2p_go),
 	TP_STRUCT__entry(
 		WIPHY_ENTRY
 		CHAN_DEF_ENTRY
+		__field(bool, p2p_go)
 	),
 	TP_fast_assign(
 		WIPHY_ASSIGN;
 		CHAN_DEF_ASSIGN(chandef);
+		__entry->p2p_go = p2p_go;
 	),
-	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
-		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
+	TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", p2p_go=%d",
+		  WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->p2p_go)
 );
 
 TRACE_EVENT(cfg80211_chandef_dfs_required,