Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CRDA regulatory domain hell
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 484

PostPosted: Wed Apr 25, 2012 8:19 pm    Post subject: CRDA regulatory domain hell Reply with quote

i don't seem to be able to set the country to GB, it reverts to CN.

Does anyone know how to fix this?

Code:
ath9k 0000:04:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
ath9k 0000:04:00.0: setting latency timer to 64
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: 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)
ath: EEPROM regdomain: 0x809c
ath: EEPROM indicates we should expect a country code
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x52
ath: Country alpha2 being used: CN
ath: Regpair used: 0x52
ieee80211 phy0: Selected rate control algorithm 'ath9k_rate_control'
cfg80211: Calling CRDA for country: CN
Registered led device: ath9k-phy0
ieee80211 phy0: Atheros AR9285 Rev:2 mem=0xffffc900047c0000, irq=18
cfg80211: Current regulatory domain intersected:
cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211:     (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
udevd[31720]: renamed network interface wlan0 to wlan2

_________________
Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/
Back to top
View user's profile Send private message
swimmer
Veteran
Veteran


Joined: 15 Jul 2002
Posts: 1291
Location: Netherlands

PostPosted: Thu Apr 26, 2012 5:14 am    Post subject: Reply with quote

I'm not sure how you set the domain but you could try to modify the cfg80211 options ...
Code:
ack regdom /etc/modprobe.d/options.conf
options cfg80211 ieee80211_regdom=UK


HTH
swimmer
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1711

PostPosted: Thu Apr 26, 2012 7:48 am    Post subject: Reply with quote

AFAIK you can't - I got the region to set with kernel 2.6.34, but haven't managed
it since. You could start by adding the wireless drivers as modules, not built-in,
which is what solved the problem for me last time.

I've attacked the problem intermittently for the last year or so, and got no further,
so if you find a solution I'd like to know it (This is with the ath9k drivers).

Will
Back to top
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 484

PostPosted: Thu Apr 26, 2012 10:16 am    Post subject: Reply with quote

swimmer wrote:
I'm not sure how you set the domain but you could try to modify the cfg80211 options ...
Code:
ack regdom /etc/modprobe.d/options.conf
options cfg80211 ieee80211_regdom=UK


HTH
swimmer


I've got this. Actually I've set the regdom to GB, not UK, but I think that's correct.
_________________
Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/
Back to top
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 484

PostPosted: Thu Apr 26, 2012 10:18 am    Post subject: Reply with quote

cwr wrote:
AFAIK you can't - I got the region to set with kernel 2.6.34, but haven't managed
it since. You could start by adding the wireless drivers as modules, not built-in,
which is what solved the problem for me last time.

The ath9k is compiled as a kernel module.

cwr wrote:

I've attacked the problem intermittently for the last year or so, and got no further,
so if you find a solution I'd like to know it (This is with the ath9k drivers).

Will

Is it a bug or a design choice? What's actually going on? I bought this card because I thought the ath9k drivers were supposed to be very stable.
_________________
Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Thu Apr 26, 2012 10:52 am    Post subject: Reply with quote

Is that log is what you get when setting the domain manually using 'iw reg set GB'?
Have you merged net-wireless/crda?
Back to top
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 484

PostPosted: Thu Apr 26, 2012 11:07 am    Post subject: Reply with quote

kimmie wrote:
Is that log is what you get when setting the domain manually using 'iw reg set GB'?
Have you merged net-wireless/crda?


Yes, to both questions. I also merged wireless-regdb.
_________________
Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Thu Apr 26, 2012 12:35 pm    Post subject: Reply with quote

I doubt I'm saying anything you don't already know, but anyway... I had a trawl through the driver code and http://wireless.kernel.org/en/users/Drivers/ath#Regulatory

As I understand it, your card is approved for use in china, that's locked in the EEPROM. You're telling it you're in the UK. So the driver is doing the right thing (in a regulatory sense) and finding the intersection of channels available for those two countries.

If you think your card is 5GHz-capable and you want to use it in the UK, then you have a problem, the driver isn't going to let you do that, because the card isn't approved for use in those bands.

On the other hand you're completely fine at 2.4 GHz, because the available channels in UK and CN are exactly the same.
Back to top
View user's profile Send private message
Erlend
Guru
Guru


Joined: 26 Dec 2004
Posts: 484

PostPosted: Thu Apr 26, 2012 12:43 pm    Post subject: Reply with quote

kimmie wrote:
I doubt I'm saying anything you don't already know, but anyway... I had a trawl through the driver code and http://wireless.kernel.org/en/users/Drivers/ath#Regulatory

As I understand it, your card is approved for use in china, that's locked in the EEPROM. You're telling it you're in the UK. So the driver is doing the right thing (in a regulatory sense) and finding the intersection of channels available for those two countries.

If you think your card is 5GHz-capable and you want to use it in the UK, then you have a problem, the driver isn't going to let you do that, because the card isn't approved for use in those bands.

On the other hand you're completely fine at 2.4 GHz, because the available channels in UK and CN are exactly the same.


Ah that's what it meant by "intersection" then. Ok, thanks for your help!
_________________
Thunar-thumbnailers
Raw-thumbnailer
http://brainstorm.ubuntu.com/idea/6878/image/1/
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1711

PostPosted: Mon Apr 30, 2012 7:27 am    Post subject: Reply with quote

In fact, there have been significant changes in the ath9k drivers.
With a 2.6.32 kernel I can run "iw reg set GB", and "iw reg get"
then gives:

country GB:
(2402 - 2482 @ 40), (N/A, 20)
(5170 - 5250 @ 40), (N/A, 20)
(5250 - 5330 @ 40), (N/A, 20), DFS
(5490 - 5710 @ 40), (N/A, 27), DFS

which looks about right. (BTW it would be really, really nice if CRDA
documented its database format and units somewhere other than in the
source code. An explanation of the various TLAs is too much to hope for.)

With the same hardware and regulatory setup, and any later kernel,
"iw reg set GB" fails and "iw reg get" gives:

country 00:
(2402 - 2472 @ 40), (6, 20)
(2457 - 2482 @ 20), (6, 20), PASSIVE-SCAN, NO-IBSS
(2474 - 2494 @ 20), (6, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
(5170 - 5250 @ 40), (6, 20), PASSIVE-SCAN, NO-IBSS
(5735 - 5835 @ 40), (6, 20), PASSIVE-SCAN, NO-IBSS

According to the (fairly confusing) linux ath9k documentation, Atheros
uses the 00 domain to mean US. The set-up doesn't quite look like the
standard US regulatory environment to me, but I could well be mistaken.

I'm not especially bothered about the 5GHz settings, but I'd like to keep
all the standard UK 2.5GHz settings, some of which seem to have been lost
in recent driver changes. As I said, I'll keep investigating.

Will
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue May 01, 2012 7:10 am    Post subject: Reply with quote

Some good info on regulatory rules and their processing is at http://linuxwireless.org/en/developers/Regulatory/processing_rules - that might help you with the TLAs.

The country "00" data you are seeing in the output of iw reg get is not for the US, that is the "world" regulatory domain. This is a domain that is supposed to be usable the world over by putting limits on transmission power and some other things. In the absence of better info (from a driver, from the user configuration, or from connected AP's) that's what the linux CRDA infrastructure will use.

The atheros EEPROM 0x0 code is a different thing. It maps to the "US" domain, not to the "00" world domain. In any case, your EEPROM code is not 0x0, but 0x809c, which maps to "CN".

I'm not sure why you can no longer set the domain with iw reg set, what error do you see? It may help to have your kernel built with CFG80211_REG_DEBUG so you get some additional info in the syslog. Also, you do not have to use module parameters to set the regulatory domain; at least with wpa_supplicant you can put a "country=GB" line in /etc/wpa_supplicant/wpa_supplicant.conf.

In any case, if your system is using the "00" domain, you are meeting all regulatory requirements.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1711

PostPosted: Tue May 01, 2012 10:08 am    Post subject: Reply with quote

It took quite a bit of work to get CRDA working on 2.6.32, and util I have to,
I don't plan to start over. I'd just like to be able to use the full range UK
channels at 2.5 GHz, which the current kernels apparently can't do.

(and OFDM and DFS took some hunting down ...)

Will
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum