2009-02-12 17:20:21

by Jan Schneider

[permalink] [raw]
Subject: Automatic/manual regulatory settings

While looking at logs collected for my microcode crash problem I
noticed that cfg80211 loads US regulatory settings.
If I understand the documentation correctly the actual country should
be set either by the AP or the device using cfg80211. Neither seems to
happen, so is it the "correct" way to do this through the
ieee80211_regdom module parameter? And I wonder how this is supposed
to happen "idiot-proof" in the future?

Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



2009-02-13 19:29:48

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Automatic/manual regulatory settings

On Fri, Feb 13, 2009 at 07:44:41AM -0800, Dan Williams wrote:
> On Thu, 2009-02-12 at 14:43 -0800, Luis R. Rodriguez wrote:
> > On Thu, Feb 12, 2009 at 12:51 PM, Dan Williams <[email protected]> wrote:
> > > On Thu, 2009-02-12 at 18:19 +0100, Jan Schneider wrote:
> > >> While looking at logs collected for my microcode crash problem I
> > >> noticed that cfg80211 loads US regulatory settings.
> > >> If I understand the documentation correctly the actual country should
> > >> be set either by the AP or the device using cfg80211. Neither seems to
> > >> happen, so is it the "correct" way to do this through the
> > >> ieee80211_regdom module parameter? And I wonder how this is supposed
> > >> to happen "idiot-proof" in the future?
> > >
> > > In the future it would get set by whatever configures your network
> > > connection. Either system scripts like ifup/ifdown, or configured
> > > manually in the config files that ifup/ifdown use, or automatically via
> > > NetworkManager based on some setting, or via NetworkManager based on a
> > > user-override.
> > >
> > > One idea I've toyed with for NetworkManager is using the city you select
> > > in the GUI Timezone control panel that all desktop environments for
> > > timezone selection. Just a thought. Or, it could come from a
> > > system-wide setting by your sysadmin in /etc, or set on a per-connection
> > > basis when you set up the NetworkManager connection for that AP in the
> > > NM connection editor.
> >
> > I think it'd be nice to leverage all these different possible location
> > based hints to help with your location -- and more. I think GeoClue
> > does such a thing (works with dbus and all), but I have not yet had
> > time to try it.
> >
> > http://www.freedesktop.org/wiki/Software/GeoClue
>
> Yeah, if there's GPS available on the system we can certainly use that
> too :)

Absolutely, so does this seem to heavy for a distribution to carry? It seems
openhand is working on this which makes me believe it should work on mobile
devices pretty well.

Luis

2009-02-13 16:06:03

by Dan Williams

[permalink] [raw]
Subject: Re: Automatic/manual regulatory settings

On Thu, 2009-02-12 at 14:43 -0800, Luis R. Rodriguez wrote:
> On Thu, Feb 12, 2009 at 12:51 PM, Dan Williams <[email protected]> wrote:
> > On Thu, 2009-02-12 at 18:19 +0100, Jan Schneider wrote:
> >> While looking at logs collected for my microcode crash problem I
> >> noticed that cfg80211 loads US regulatory settings.
> >> If I understand the documentation correctly the actual country should
> >> be set either by the AP or the device using cfg80211. Neither seems to
> >> happen, so is it the "correct" way to do this through the
> >> ieee80211_regdom module parameter? And I wonder how this is supposed
> >> to happen "idiot-proof" in the future?
> >
> > In the future it would get set by whatever configures your network
> > connection. Either system scripts like ifup/ifdown, or configured
> > manually in the config files that ifup/ifdown use, or automatically via
> > NetworkManager based on some setting, or via NetworkManager based on a
> > user-override.
> >
> > One idea I've toyed with for NetworkManager is using the city you select
> > in the GUI Timezone control panel that all desktop environments for
> > timezone selection. Just a thought. Or, it could come from a
> > system-wide setting by your sysadmin in /etc, or set on a per-connection
> > basis when you set up the NetworkManager connection for that AP in the
> > NM connection editor.
>
> I think it'd be nice to leverage all these different possible location
> based hints to help with your location -- and more. I think GeoClue
> does such a thing (works with dbus and all), but I have not yet had
> time to try it.
>
> http://www.freedesktop.org/wiki/Software/GeoClue

Yeah, if there's GPS available on the system we can certainly use that
too :)

Dan



2009-02-12 17:40:08

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Automatic/manual regulatory settings

On Thu, Feb 12, 2009 at 09:19:59AM -0800, Jan Schneider wrote:
> While looking at logs collected for my microcode crash problem I
> noticed that cfg80211 loads US regulatory settings.

That is because of the CONFIG_WIRELESS_OLD_REGULATORY=y which I keep
insisting should die already. This is still present because CRDA is
starting to be embraced by distributions.

> If I understand the documentation correctly the actual country should
> be set either by the AP or the device using cfg80211.

Correct. With OLD_REG it also means you'll get a static default "US"
regulatory domain. The only other two static options are "JP" and "EU".
This is why this is OLD_REG -- its using static definitions and the
information is present inside the kernel.

Because you _may_ still have CRDA installed we also call CRDA if your
ieee80211_regdomain module parameter is either "US" or "JP" because
there are actual valid ISO / IEC 3166 alpha2 country codes and if
CRDA is present you will get to reap the benefits of an updated
regulatory domain.

> Neither seems to
> happen

On what device? Keep in mind iwlfifi driver ignores the first regulatory
setting by the regulatory code. If users later want to enhance regulatory
further they will have to call it manually using iw:

iw reg set FR

> so is it the "correct" way to do this through the
> ieee80211_regdom module parameter?

No, that should be used only for "US", "JP" and "EU", but technically
you can also try "FR" and CRDA will be called as well if present. But
the correct way to do this from userspace is to do it through iw or
wpa_supplicant, which as the capability of setting it too. If you are
writing your own application you can use the same nl80211 command as
iw and wpa_supplicant, NL80211_CMD_REQ_SET_REG.

> And I wonder how this is supposed
> to happen "idiot-proof" in the future?

Hm?

LuisT

2009-02-12 20:53:01

by Dan Williams

[permalink] [raw]
Subject: Re: Automatic/manual regulatory settings

On Thu, 2009-02-12 at 18:19 +0100, Jan Schneider wrote:
> While looking at logs collected for my microcode crash problem I
> noticed that cfg80211 loads US regulatory settings.
> If I understand the documentation correctly the actual country should
> be set either by the AP or the device using cfg80211. Neither seems to
> happen, so is it the "correct" way to do this through the
> ieee80211_regdom module parameter? And I wonder how this is supposed
> to happen "idiot-proof" in the future?

In the future it would get set by whatever configures your network
connection. Either system scripts like ifup/ifdown, or configured
manually in the config files that ifup/ifdown use, or automatically via
NetworkManager based on some setting, or via NetworkManager based on a
user-override.

One idea I've toyed with for NetworkManager is using the city you select
in the GUI Timezone control panel that all desktop environments for
timezone selection. Just a thought. Or, it could come from a
system-wide setting by your sysadmin in /etc, or set on a per-connection
basis when you set up the NetworkManager connection for that AP in the
NM connection editor.

Dan



2009-02-12 22:43:03

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: Automatic/manual regulatory settings

On Thu, Feb 12, 2009 at 12:51 PM, Dan Williams <[email protected]> wrote:
> On Thu, 2009-02-12 at 18:19 +0100, Jan Schneider wrote:
>> While looking at logs collected for my microcode crash problem I
>> noticed that cfg80211 loads US regulatory settings.
>> If I understand the documentation correctly the actual country should
>> be set either by the AP or the device using cfg80211. Neither seems to
>> happen, so is it the "correct" way to do this through the
>> ieee80211_regdom module parameter? And I wonder how this is supposed
>> to happen "idiot-proof" in the future?
>
> In the future it would get set by whatever configures your network
> connection. Either system scripts like ifup/ifdown, or configured
> manually in the config files that ifup/ifdown use, or automatically via
> NetworkManager based on some setting, or via NetworkManager based on a
> user-override.
>
> One idea I've toyed with for NetworkManager is using the city you select
> in the GUI Timezone control panel that all desktop environments for
> timezone selection. Just a thought. Or, it could come from a
> system-wide setting by your sysadmin in /etc, or set on a per-connection
> basis when you set up the NetworkManager connection for that AP in the
> NM connection editor.

I think it'd be nice to leverage all these different possible location
based hints to help with your location -- and more. I think GeoClue
does such a thing (works with dbus and all), but I have not yet had
time to try it.

http://www.freedesktop.org/wiki/Software/GeoClue

Luis