diff mbox

[LEDE-DEV] mac80211: respect user-set regulatory domain by default

Message ID 20160525173153.GA4219@makrotopia.org
State Accepted
Headers show

Commit Message

Daniel Golle May 25, 2016, 5:32 p.m. UTC
It turns out most device vendors don't set the correct country code
in their devices' on-flash-EEPROM sections as they apparently rather
provide a complete per-target-market firmware with patched drivers
instead of just setting the country code.
This results in the driver to incorrectly assume the value stored in
the on-flash-EERPOM (usually US or China) being the regulatory domain
inside which the device is being used.
To work around this issue, OpenWrt introduced the ATH_USER_REGD config
variable to decide during build whether or not to allow the user to
override the regulatory domain setting. This option, however, is not
enabled by default and thus ends up being disabled for snapshots builds
and released binaries.
As we know for a long time that most devices got borked regulatory
domain values set in their EEPROMs we should allow our users to respect
their local law (instead of just assume US or China laws).
Note that also the current default has great potential of users not
ever setting their regulatory domain and thus using inapproriate and
potentially illegal frequencies and/or tx-power settings

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
Imho we should set World regulatory domain by default but also allow
users to set their actual regulatory domain (e.g. ETSI).
Obviously this will require the user to enter her country before being
able to use AP, IBSS and 802.11s mode in the 5 GHz bands.
Most wireless mesh communities' firmware projects are currently
implemented as source-wrappers around OpenWrt instead of just using the
SDK and ImageBuilder because of the official releases being useless in
most places in the world due to ATH_USER_REGD being disabled.

 package/kernel/mac80211/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexander 'lynxis' Couzens May 26, 2016, 12:57 a.m. UTC | #1
On Wed, 25 May 2016 19:32:01 +0200
Daniel Golle <daniel@makrotopia.org> wrote:

> It turns out most device vendors don't set the correct country code
> in their devices' on-flash-EEPROM sections as they apparently rather
> provide a complete per-target-market firmware with patched drivers
> instead of just setting the country code.
> This results in the driver to incorrectly assume the value stored in
> the on-flash-EERPOM (usually US or China) being the regulatory domain
> inside which the device is being used.
> To work around this issue, OpenWrt introduced the ATH_USER_REGD config
> variable to decide during build whether or not to allow the user to
> override the regulatory domain setting. This option, however, is not
> enabled by default and thus ends up being disabled for snapshots
> builds and released binaries.
> As we know for a long time that most devices got borked regulatory
> domain values set in their EEPROMs we should allow our users to
> respect their local law (instead of just assume US or China laws).
> Note that also the current default has great potential of users not
> ever setting their regulatory domain and thus using inapproriate and
> potentially illegal frequencies and/or tx-power settings
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> Imho we should set World regulatory domain by default but also allow
> users to set their actual regulatory domain (e.g. ETSI).
> Obviously this will require the user to enter her country before being
> able to use AP, IBSS and 802.11s mode in the 5 GHz bands.
> Most wireless mesh communities' firmware projects are currently
> implemented as source-wrappers around OpenWrt instead of just using
> the SDK and ImageBuilder because of the official releases being
> useless in most places in the world due to ATH_USER_REGD being
> disabled.

I really like this commit.
Can you set the country *explicit* to world in /etc/config/wireless
before appling this patch?

best,
lynxis
Daniel Dickinson May 26, 2016, 1:29 a.m. UTC | #2
On Thu, 2016-05-26 at 02:57 +0200, Alexander Couzens wrote: 
> On Wed, 25 May 2016 19:32:01 +0200
> Daniel Golle <daniel@makrotopia.org> wrote:
> 

> I really like this commit.
> Can you set the country *explicit* to world in /etc/config/wireless
> before appling this patch?
> 

If the FCC hadn't already completely knobbish and basically eliminated
(or least required one to be much more determined and skilled) the
ability to use OpenWrt/LEDE on new routers in the US anyway, I might
have some objection (I'm not in the US but Canada will almost certainly
adopt similar legislation since our government tends to do what the US
wants, putzes that they are) on the grounds of leading to trouble.

As it is, for new wireless routers, the US, and probably soon Canada,
are shut out from participating in OpenWrt/LEDE anyway, it's pretty much
moot point for those of us here, and in sane parts of the world it makes
sense.

Regards,

Daniel
Daniel Golle May 26, 2016, 8:49 a.m. UTC | #3
Hi Daniel!

On Wed, May 25, 2016 at 09:29:23PM -0400, Daniel Dickinson wrote:
> ...
> If the FCC hadn't already completely knobbish and basically eliminated
> (or least required one to be much more determined and skilled) the
> ability to use OpenWrt/LEDE on new routers in the US anyway, I might
> have some objection (I'm not in the US but Canada will almost certainly
> adopt similar legislation since our government tends to do what the US
> wants, putzes that they are) on the grounds of leading to trouble.
> 
> As it is, for new wireless routers, the US, and probably soon Canada,
> are shut out from participating in OpenWrt/LEDE anyway, it's pretty much
> moot point for those of us here, and in sane parts of the world it makes
> sense.

As we have learned at BattleMesh, this whole lockdown madness was
actually started in some back-office of the European Comission back
in 2014 without anyone of us noticing. As usually, if things like
that happend, we Europeans are quick to blame others eventhough it
was out own governments making that decission and then encouraging
the FCC to do the same on the other side of the Atlantic.

Independently of that whole issue, I believe we should always try our
bests to make it as easy as possible for users to obey to radio
regulations. One improvement could be to make sure the user enters her
country code before starting to use the firmware.
Currently, users outside of the US may just enable the 5 GHz radio and
without ever being asked, the device will just assume FCC regulations
and most likely use frequencies and/or transmit power inappropriate to
the region it is actually being used.


Cheers


Daniel
David Lang May 26, 2016, 9:51 a.m. UTC | #4
On Thu, 26 May 2016, Daniel Golle wrote:

> Hi Daniel!
>
> On Wed, May 25, 2016 at 09:29:23PM -0400, Daniel Dickinson wrote:
>> ...
>> If the FCC hadn't already completely knobbish and basically eliminated
>> (or least required one to be much more determined and skilled) the
>> ability to use OpenWrt/LEDE on new routers in the US anyway, I might
>> have some objection (I'm not in the US but Canada will almost certainly
>> adopt similar legislation since our government tends to do what the US
>> wants, putzes that they are) on the grounds of leading to trouble.
>>
>> As it is, for new wireless routers, the US, and probably soon Canada,
>> are shut out from participating in OpenWrt/LEDE anyway, it's pretty much
>> moot point for those of us here, and in sane parts of the world it makes
>> sense.
>
> As we have learned at BattleMesh, this whole lockdown madness was
> actually started in some back-office of the European Comission back
> in 2014 without anyone of us noticing. As usually, if things like
> that happend, we Europeans are quick to blame others eventhough it
> was out own governments making that decission and then encouraging
> the FCC to do the same on the other side of the Atlantic.

It's also important to note that the FCC has not passed any rules requiring a 
lockdown. The posted some proposed rules that would require a lockdown, but 
after the backlash have made public statements that they do not intend to block 
OpenWRT or similar (and they started the 'free the settop box' project to break 
existing cable lockdowns)

Linksys would not be able to say that they are not going to lock down their 
devices if the FCC actually required it.


Back on topic, I think it's a good thing to default to world-wide and allow the 
user to set the proper country (they should not need to know what the codes are)

be sure to have the appropriate dire warnings about deliberatly setting it 
incorrectly and the trouble you could get into :-)

David Lang
AG6AH
Daniel Golle May 31, 2016, 12:16 p.m. UTC | #5
Hi David,

On Thu, May 26, 2016 at 02:51:17AM -0700, David Lang wrote:
> On Thu, 26 May 2016, Daniel Golle wrote:
> 
> > Hi Daniel!
> > 
> > On Wed, May 25, 2016 at 09:29:23PM -0400, Daniel Dickinson wrote:
> > > ...
> > > If the FCC hadn't already completely knobbish and basically eliminated
> > > (or least required one to be much more determined and skilled) the
> > > ability to use OpenWrt/LEDE on new routers in the US anyway, I might
> > > have some objection (I'm not in the US but Canada will almost certainly
> > > adopt similar legislation since our government tends to do what the US
> > > wants, putzes that they are) on the grounds of leading to trouble.
> > > 
> > > As it is, for new wireless routers, the US, and probably soon Canada,
> > > are shut out from participating in OpenWrt/LEDE anyway, it's pretty much
> > > moot point for those of us here, and in sane parts of the world it makes
> > > sense.
> > 
> > As we have learned at BattleMesh, this whole lockdown madness was
> > actually started in some back-office of the European Comission back
> > in 2014 without anyone of us noticing. As usually, if things like
> > that happend, we Europeans are quick to blame others eventhough it
> > was out own governments making that decission and then encouraging
> > the FCC to do the same on the other side of the Atlantic.
> 
> It's also important to note that the FCC has not passed any rules requiring
> a lockdown. The posted some proposed rules that would require a lockdown,
> but after the backlash have made public statements that they do not intend
> to block OpenWRT or similar (and they started the 'free the settop box'
> project to break existing cable lockdowns)
> 
> Linksys would not be able to say that they are not going to lock down their
> devices if the FCC actually required it.

Well, Linksys (and others using mv88w8864 or ath10k) can opt for really
only locking the radio firmware and thereby create a niche-market for
'open-source-friendly' routers. However, this is obviously not possible
for ath9k and might be hard or even impossible to achieve using other
pure softmac (ie. firmware-less) chips as well.

> 
> 
> Back on topic, I think it's a good thing to default to world-wide and allow
> the user to set the proper country (they should not need to know what the
> codes are)

Ack. Imho the ISO country code is the right thing to store in UCI,
(translated) country names should be exposed to users on the
web-interface, but that's really only on the view-level.

It also doesn't make much sense to store the country-code for each
radio, it's a system-wide property and should thus go into
/etc/config/system (opinions?).

> 
> be sure to have the appropriate dire warnings about deliberatly setting it
> incorrectly and the trouble you could get into :-)

Obviously there should be warnings in the documentation and web-
interface as well as comments in the configuration file.


Cheers


Daniel

> 
> David Lang
> AG6AH
diff mbox

Patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 8b053d4..28da0ec 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -161,6 +161,7 @@  define KernelPackage/ath/config
   if PACKAGE_kmod-ath
 	config ATH_USER_REGD
 		bool "Force Atheros drivers to respect the user's regdomain settings"
+		default y
 		help
 		  Atheros' idea of regulatory handling is that the EEPROM of the card defines
 		  the regulatory limits and the user is only allowed to restrict the settings