You are not logged in.

#1 2011-08-15 20:46:26

mjc506
Member
From: Southampton, UK
Registered: 2010-04-07
Posts: 18
Website

[SOLVED] Changing atheros regdomain

I have a Atheros AR9280 which is reporting an EEPROM regdomain of 0x0, which maps to US. I'd like to get it working on my local (GB) channels, but the EEPROM setting overrides whatever I ask for by calling crda for US.

From what I've read, the only ways I can 'fix' this are by
1) Using athinfo/athtool to modify the eeprom to point to GB instead of US
2) Recompile the kernel with 'Force atheros cards to respect user regdom setting'
3) Create a new crda database with the GB settings transplanted into the US settings

Ideally, I'd use 1), but all the athero eeprom tools I can find don't seem to support the 9280 (I get MAC revision 0x72ff is not supported! from ath_info e0200000). 2) is problematic - I'm on an old tablet pc with slow cpu and very small hdd. Cross compiling is an option, but I've never done it before, and I also can't find the  'Force atheros cards to respect user regdom setting' in any of the configs. I'd also like to keep simple pacman compatibility with all the arch modules and not break anything (the tablet has an 855GM graphics chip, which hasn't long been working properly, and still requires libdrm_git et al)

3) is looking the most promising, but I'm struggling with the linux_wireless docs - from what I understand, I can use db.txt, but then it goes on to say that it'll only look at compiled regulatory.bin signed with a certain public key? I've also got to work out the db.txt syntax, but that's a minor issue...

Does anyone have any ideas?

Last edited by mjc506 (2011-08-17 12:54:51)

Offline

#2 2011-08-15 20:53:04

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Changing atheros regdomain

pacman -S crda

edit /etc/conf.d/wireless-regdom

add wireless-regdom to DAEMONS array in /etc/rc.conf (start it manually if you don't want to restart).

profit tongue


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2011-08-15 21:05:07

mjc506
Member
From: Southampton, UK
Registered: 2010-04-07
Posts: 18
Website

Re: [SOLVED] Changing atheros regdomain

Ah yes, sorry, I forgot about that. Done all that unfortunately sad In fact, for ''testing'' I set the regdom in /etc/conf.d/wireless-regdom to JP (Japan), and rebooted. dmesg spits out the following:

...
cfg80211: Calling CRDA to update world regulatory domain
...
cfg80211: World regulatory domain updated:
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
...
cfg80211: Calling CRDA for country: JP
...
cfg80211: Regulatory domain changed to country: JP
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (N/A, 2000 mBm)
cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
cfg80211:     (4910000 KHz - 4930000 KHz @ 10000 KHz), (N/A, 2300 mBm)
cfg80211:     (4910000 KHz - 4990000 KHz @ 40000 KHz), (N/A, 2300 mBm)
cfg80211:     (4930000 KHz - 4950000 KHz @ 10000 KHz), (N/A, 2300 mBm)
cfg80211:     (5030000 KHz - 5045000 KHz @ 10000 KHz), (N/A, 2300 mBm)
cfg80211:     (5030000 KHz - 5090000 KHz @ 40000 KHz), (N/A, 2300 mBm)
cfg80211:     (5050000 KHz - 5060000 KHz @ 10000 KHz), (N/A, 2300 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2300 mBm)
...
Compat-wireless backport release: compat-wireless-2011-03-30-1-g7b4debf
Backport based on linux-next.git next-20110331
 clean.
...
ath9k 0000:02:06.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, low) -> IRQ 10
...
ath: EEPROM regdomain: 0x0
ath: EEPROM indicates default country code should be used
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x3a
ath: Country alpha2 being used: US
ath: Regpair used: 0x3a
ieee80211 phy0: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy0
ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xefa20000, irq=10
cfg80211: Calling CRDA for country: US
cfg80211: Current regulatory domain intersected:
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (2457000 KHz - 2472000 KHz @ 15000 KHz), (N/A, 2000 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 1700 mBm)
cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5490000 KHz - 5600000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5650000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2000 mBm)
...
wlan0: authenticate with 50:67:f0:7c:6c:08 (try 1)
wlan0: authenticated
wlan0: associate with 50:67:f0:7c:6c:08 (try 1)
wlan0: RX AssocResp from 50:67:f0:7c:6c:08 (capab=0x411 status=0 aid=1)
wlan0: associated
cfg80211: Calling CRDA for country: GB
cfg80211: Regulatory domain changed to country: GB
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211:     (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
padlock: VIA PadLock not detected.
[matt@mattablet ~]$

As you can see, first, the World regdom is set, then Japan (from wireless-regdom), but then it all goes horribly wrong and the EEPROM tells te kernel to intersect the US settings. Finally, the card connects to the wlan, sees that it's in the UK, and intersects the GB settings!

iw list still shows Channels 12, 13 and 14 (as well as a load of 5GHz ones) as disabled, and I can't see anything transmitting on them either.

Last edited by mjc506 (2011-08-15 21:07:56)

Offline

#4 2011-08-15 21:13:02

R00KIE
Forum Moderator
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Changing atheros regdomain

Try to see if there is any module option that can override the regdomain or at least let you use all channels. No more ideas here.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2011-08-15 21:17:37

mjc506
Member
From: Southampton, UK
Registered: 2010-04-07
Posts: 18
Website

Re: [SOLVED] Changing atheros regdomain

Thanks for the help, same effect with the module option unfortunately sad

Offline

#6 2011-08-15 23:15:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819

Re: [SOLVED] Changing atheros regdomain

Unfortunately the Atheros card is hardcoded to that region. A lot of routers use Atheros 92xx hardware, and there is a CONFIG_ATH_USER_REGD variable in OpenWrt that allows the user to override the default settings of the wireless NIC. Unfortunately grepping the Arch kernel config doesn't seem to have that, and since OpenWrt has its fair share of hacking and patches, I don't know if that's something they added or that's provided e.g. in compat-wireless.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2011-08-16 06:28:44

mjc506
Member
From: Southampton, UK
Registered: 2010-04-07
Posts: 18
Website

Re: [SOLVED] Changing atheros regdomain

Ah, that's the option I was looking for! Thanks, I'll search through wireless-compat and see if its there too.

Offline

#8 2011-08-17 13:04:38

mjc506
Member
From: Southampton, UK
Registered: 2010-04-07
Posts: 18
Website

Re: [SOLVED] Changing atheros regdomain

Ok, for anyone else who stumbles this way (and for myself, when I need to do it again!)...

The stock kernel does not have CONFIG_ATH_USER_REGD - this is (as far as I can tell) a OpenWRT patch. Nothing stopping you from applying that patch to the arch kernel though. I didn't pursue ath_info any further, either.

What did work for me...

My atheros card had the regdomain/country code set to 0x0 in the EEPROM. crda/kernel saw this and set the country code to US - United states. I decided on a bit of a hack, intending to change the US regdb entries to those matching GB - crda would still set the channels up for the US, but the settings it used would match those from GB.

crda will only read regulatory.bin's which are signed with the same key as crda itself is built with. While I could/should probably edit a PKGBUILD to allow me to drop in my own keys, what I actually did was grab the source of crda and wireless-regdb from linux-wireless. Within the crda README, there's a paragraph describing how to produce your own regulatory.bin - essentially, create your private and public keys, edit db.txt (in my case, copying GB settings into World and US, just to make sure), and running a python script from wireless-regdb to create regulatory.bin (note, I had to edit these scripts to use python2 instead of python). Then, I could put bit in the right place, run make; make install on crda, and reboot. After reboot, iw list returned the correct channels.

Question: Should I sort this out and get it into the wiki? I'm all too aware that it would be very easy to set your card to break all the regulations concerning allowed channels and power outputs...

Offline

#9 2011-12-31 23:00:11

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 6,104

Re: [SOLVED] Changing atheros regdomain

mjc506 wrote:

Question: Should I sort this out and get it into the wiki? I'm all too aware that it would be very easy to set your card to break all the regulations concerning allowed channels and power outputs...

Personally, I would find this very useful. My own card doesn't seem to have this problem. (I'm having wifi issues but not this one!) However, my mother's computer believes it is in China. Not only does this restrict the channels but it is repeatedly resetting the regulatory domain which causes the connection to be dropped. For reasons I don't understand, wicd somehow mitigates this problem.

We are not located in China.

Until I came across this problem, I didn't realise that cards were programmed for a particular place in this way. As long as manufacturers supply cards in countries which are pre-programmed to use other countries' restrictions, it seems perfectly reasonable to provide information on how to correct for that. All kinds of information can potentially be misused. DRM is premised on the idea that information/code should only be available if it cannot be misused however much that restricts the freedoms of legitimate users. I see no reason to endorse that logic!


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Corporation Wireless 8265 / 8275 | US keyboard with Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB