If I install linux-2.6.28 without CONFIG_WIRELESS_OLD_REGULATORY, the kernel queries the regulatory domain from nearby access points and then asks udev to call iw and load the allowed frequency ranges into the kernel. It is also possible to set the sountry by calling "iw reg set RU", but there is no initscript that does this.
Unfortunately, somewhere around my flat there is a misconfigured access point that not only transmits in bands that are illegal in Russia, but also sends out invalid information about the country (says "DE") and thus theoretically can coerce my wireless card to transmit in illegal bands. In order to stop violating the law, I have to either set the channel manually on my wireless card (that's what I do now), or run "iw reg set RU". Please provide the initscript that would allow me to run "iw reg set RU" at boot before bringing up any wireless cards.
Reassigning to/CCing maintainers, CCing netmon herd as well.
While we consider the init script issue (since in most cases people will not want to force a specific country, but instead pick it up from the access points, particularly in the context of laptops that travel internationally), a workaround for you would be to add that line to /etc/conf.d/local.start.
The local service gets started generally at the very end of booting or start of shutting down, and simply runs any commands that are found in /etc/conf.d/local.start on startup and /etc/conf.d/local.stop when stopped. That should allow you to force the country of your choosing.
Rbu, I'm not sure whether it's worth getting everybody to install an initscript (and have it sourced/executed) at the start of every boot if most of the time everything just works automatically like it's supposed to. I'd also thought udev called crda not iw (given that iw doesn't install udev rules, but crda does), but I could be mistaken about that. So I'm currently inclined not to add an initscript or ask the crda people (mobile, chainsaw) about it, what do you think?
local.start starts after the wireless network is up, and thus too late. And yes, crda may be a more logical place for the initscript.
By adding an init script, we'd be reinventing the wheel. Setting these options via "iw" is really just using the kernel api to do something other services should be doing. It's like aadding an init script to ifconfig when you really want to expand the "net" scripts.
To make it more constructive, wpa_supplicant (which features an init script) supports setting regulatory restrictions in the latest version, which has an open version bump bug (see blocker):
Furthermore, this could be interesting for NetworkManager ebuild, and maybe actually for the baselayout network config.
correction... wpa_supplicant does not feature an init script, but is started via dbus and other helpers.
Alexander, did you look into this? Does it solve the problem?
I haven't looked yet, and can't do that for a week or so, because my laptop is at work and it is impossible to test wpa_supplicant with only one wireless device.
However, from what is written on that page, it should work.
I fully agree with Robert. Following the Gentoo way, this support should be added to OpenRC networking scripts.
(In reply to comment #2)
> [...] I'd also thought
> udev called crda not iw (given that iw doesn't install udev rules, but crda
> does), but I could be mistaken about that. So I'm currently inclined not to
> add an initscript or ask the crda people (mobile, chainsaw) about it, what do
> you think?
Yes, udev calls crda when asked to by the kernel, but you cannot manually set the regdomain by invoking crda alone. You have to use 'iw reg set', so by adding the init script to crda, you'd introduce a new dep on iw, which may not be desired, especially on embedded boxes.
The wpa_supplicant solution works for me with zd1211rw with today's compat-wireless, and wpa_supplicant 0.6.8 with -Dnl80211.
So the remaining part of the bug is to either deprecate the iwconfig module (and document that), or to add the possibility to set the country to the iwconfig module.
I am a little lost on this bug. What still needs to be done and by which team?
Haven't touched iw in over a year, removing myself as maintainer.
kernel is moving away from iwconfig setting via wpa_supplicant.conf reference http://wireless.kernel.org/en/developers/Regulatory/CRDA
appears to be the proper way to do this
Move laptop after setting to own peril ;-)
iw appears to be recieving releases still http://wireless.kernel.org/download/iw/
two releases in 2010
This discussion, while exciting, seems to have a few misunderstandings.
1.) "iw reg set" does NOT forcibly maintain a reg domain, if you are in Country XY and you connect to an AP broadcasting regdomain AB you will switch to AB
2.) An AP which you do not connect to should have no effect on what regdomain your card thinks it is in, if it does, then please report a bug to the linux-wireless mailing list (I'm happy to help you if that is the case)
The proper solution for this is to either stop connecting to your neighbor's AP, or configure your AP properly.
This does not need an init script as the behavior of the regulatory domain stuff was specifically designed to almost entirely ignore the user's desires (as everything else overrides the user choice automatically).
Just my 0.02$
I didn't try to connect to the neighbours' AP. When I reported this bug, I used an ad-hoc wireless network to transfer data between the desktop and the laptop, and DE was clearly in the kernel log.
However, I moved since the bug report and thus cannot tell whether the problem still exists. Feel free to close.
I am agreed with Rick, so i close this as INVALID.