2010-05-26 11:32:48

by Arnd Hannemann

[permalink] [raw]
Subject: regulatory problems with ath5k

Hi,

I'm trying to use 802.11a channels in AP mode with my ath5k nics with kernel 2.6.34.
And after setting up crda, udev and wireless regdb, "iw list" still shows flags
"passive scanning, no IBSS" for most of the 802.11a channels (see below.)

I wonder what I'm doing wrong here?


Band 2:
Frequencies:
* 5180 MHz [36] (20.0 dBm) (radar detection)
* 5200 MHz [40] (20.0 dBm) (radar detection)
* 5220 MHz [44] (20.0 dBm) (radar detection)
* 5240 MHz [48] (20.0 dBm) (radar detection)
* 5260 MHz [52] (20.0 dBm) (passive scanning, no IBSS, radar detection)
* 5280 MHz [56] (20.0 dBm) (passive scanning, no IBSS, radar detection)
* 5300 MHz [60] (20.0 dBm) (passive scanning, no IBSS, radar detection)
* 5320 MHz [64] (20.0 dBm) (passive scanning, no IBSS, radar detection)
* 5500 MHz [100] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5520 MHz [104] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5540 MHz [108] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5560 MHz [112] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5580 MHz [116] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5600 MHz [120] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5620 MHz [124] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5640 MHz [128] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5660 MHz [132] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5680 MHz [136] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5700 MHz [140] (26.0 dBm) (passive scanning, no IBSS, radar detection)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)

hannemann@mrouter46:~ $ sudo iw reg get
country DE:
(2400 - 2483 @ 40), (N/A, 20)
(5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
(5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS

dmesg snippet:

May 26 12:10:36 mrouter46 kernel: [ 30.023089] console [netcon0] enabled
May 26 12:10:36 mrouter46 kernel: [ 30.023103] netconsole: network logging started
May 26 12:10:36 mrouter46 kernel: [ 30.314702] cfg80211: Calling CRDA to update world regulatory domain
May 26 12:10:37 mrouter46 kernel: [ 30.555745] ath5k 0000:00:0c.0: registered as \'phy0\'
May 26 12:10:37 mrouter46 kernel: [ 31.039151] ath: EEPROM regdomain: 0x8114
May 26 12:10:37 mrouter46 kernel: [ 31.039168] ath: EEPROM indicates we should expect a country code
May 26 12:10:37 mrouter46 kernel: [ 31.039188] ath: doing EEPROM country->regdmn map search
May 26 12:10:37 mrouter46 kernel: [ 31.039205] ath: country maps to regdmn code: 0x37
May 26 12:10:37 mrouter46 kernel: [ 31.039222] ath: Country alpha2 being used: DE
May 26 12:10:37 mrouter46 kernel: [ 31.039237] ath: Regpair used: 0x37
May 26 12:10:37 mrouter46 kernel: [ 31.054155] cfg80211: World regulatory domain updated:
May 26 12:10:37 mrouter46 kernel: [ 31.054178] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
May 26 12:10:37 mrouter46 kernel: [ 31.054207] (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
May 26 12:10:37 mrouter46 kernel: [ 31.054232] (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
May 26 12:10:37 mrouter46 kernel: [ 31.054258] (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
May 26 12:10:37 mrouter46 kernel: [ 31.054284] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
May 26 12:10:37 mrouter46 kernel: [ 31.054310] (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
May 26 12:10:38 mrouter46 kernel: [ 31.212057] phy0: Selected rate control algorithm \'minstrel\'
May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k phy0: RF5112B multiband radio found (0x36)
May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k 0000:00:0e.0: registered as \'phy1\'
May 26 12:10:38 mrouter46 kernel: [ 31.622592] cfg80211: Calling CRDA for country: DE
May 26 12:10:38 mrouter46 kernel: [ 31.688006] cfg80211: Regulatory domain changed to country: DE
May 26 12:10:38 mrouter46 kernel: [ 31.688030] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
May 26 12:10:38 mrouter46 kernel: [ 31.688057] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
May 26 12:10:38 mrouter46 kernel: [ 31.688080] (5150000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
May 26 12:10:38 mrouter46 kernel: [ 31.688103] (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: EEPROM regdomain: 0x8114
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: EEPROM indicates we should expect a country code
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: doing EEPROM country->regdmn map search
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: country maps to regdmn code: 0x37
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: Country alpha2 being used: DE
May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: Regpair used: 0x37
May 26 12:10:38 mrouter46 kernel: [ 31.758662] phy1: Selected rate control algorithm \'minstrel\'
May 26 12:10:38 mrouter46 kernel: [ 31.759383] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
May 26 12:10:38 mrouter46 kernel: [ 31.759383] ath5k phy1: RF5112B multiband radio found (0x36)


Best regards,
Arnd


2010-05-26 18:09:55

by Arnd Hannemann

[permalink] [raw]
Subject: Re: regulatory problems with ath5k

Am 26.05.2010 19:11, schrieb Luis R. Rodriguez:
> On Wed, May 26, 2010 at 4:23 AM, Arnd Hannemann
> <[email protected]> wrote:
>
>> Hi,
>>
>> I'm trying to use 802.11a channels in AP mode with my ath5k nics with kernel 2.6.34.
>> And after setting up crda, udev and wireless regdb,
>>
> Which release of wireless-regdb?
>
>
This morning's git tree. I just copied the regulatory.bin from there.
Last commit was:

commit f3ba942f073358d1bca82a389da9f7da6e8fe81f
Author: John W. Linville <[email protected]>
Date: Fri Feb 5 13:47:41 2010 -0500

wireless-regdb: update sha1sum.txt in Makefile and fix REGDB_CHANGED

Signed-off-by: John W. Linville <[email protected]>




>> "iw list" still shows flags
>> "passive scanning, no IBSS" for most of the 802.11a channels (see below.)
>>
>> I wonder what I'm doing wrong here?
>>
> Lets take a look.
>
>
>> Band 2:
>> Frequencies:
>> * 5180 MHz [36] (20.0 dBm) (radar detection)
>> * 5200 MHz [40] (20.0 dBm) (radar detection)
>> * 5220 MHz [44] (20.0 dBm) (radar detection)
>> * 5240 MHz [48] (20.0 dBm) (radar detection)
>> * 5260 MHz [52] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5280 MHz [56] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5300 MHz [60] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5320 MHz [64] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5500 MHz [100] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5520 MHz [104] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5540 MHz [108] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5560 MHz [112] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5580 MHz [116] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5600 MHz [120] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5620 MHz [124] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5640 MHz [128] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5660 MHz [132] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5680 MHz [136] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>> * 5700 MHz [140] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>
>
> Please do: 'iw reg get' and paste the output here, the above channels
> should not be passive scan/no-ibss for 'DE'.
>

hannemann@mrouter46:~ $ sudo iw reg get
country DE:
(2400 - 2483 @ 40), (N/A, 20)
(5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
(5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS


>> hannemann@mrouter46:~ $ sudo iw reg get
>> country DE:
>> (2400 - 2483 @ 40), (N/A, 20)
>> (5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
>> (5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS
>>
>> dmesg snippet:
>>
>> May 26 12:10:36 mrouter46 kernel: [ 30.023089] console [netcon0] enabled
>> May 26 12:10:36 mrouter46 kernel: [ 30.023103] netconsole: network logging started
>> May 26 12:10:36 mrouter46 kernel: [ 30.314702] cfg80211: Calling CRDA to update world regulatory domain
>> May 26 12:10:37 mrouter46 kernel: [ 30.555745] ath5k 0000:00:0c.0: registered as \'phy0\'
>> May 26 12:10:37 mrouter46 kernel: [ 31.039151] ath: EEPROM regdomain: 0x8114
>>
> WTF your EEPROM has 0x8114 set on the regulatory domain. David, have
> you ever seen such a thing? This kernel (2.6.34) should already have
> an ath5k EEPROM checksum check so the EEPROM should be valid. Lets
> figure this out first before digging more into this.
>
> Some more notes below though.
>

You got me, I hacked this up:

--- linux-2.6.34/drivers/net/wireless/ath/regd.c 2010-05-16
23:17:36.000000000 +0200
+++ linux-2.6.34.x-um/drivers/net/wireless/ath/regd.c 2010-05-26
19:57:44.000000000 +0200
@@ -501,7 +501,7 @@ ath_regd_init(struct ath_regulatory *reg
return -EINVAL;

ath_regd_sanitize(reg);
-
+ reg->current_rd = CTRY_GERMANY | COUNTRY_ERD_FLAG;
printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);

if (!ath_regd_is_eeprom_valid(reg)) {


Do you think this is the cause?

>
>> May 26 12:10:37 mrouter46 kernel: [ 31.039168] ath: EEPROM indicates we should expect a country code
>> May 26 12:10:37 mrouter46 kernel: [ 31.039188] ath: doing EEPROM country->regdmn map search
>> May 26 12:10:37 mrouter46 kernel: [ 31.039205] ath: country maps to regdmn code: 0x37
>> May 26 12:10:37 mrouter46 kernel: [ 31.039222] ath: Country alpha2 being used: DE
>> May 26 12:10:37 mrouter46 kernel: [ 31.039237] ath: Regpair used: 0x37
>> May 26 12:10:37 mrouter46 kernel: [ 31.054155] cfg80211: World regulatory domain updated:
>>
> So cfg80211 *first* starts out with the world regulatory domain by
> default, and then it will call CRDA for DE since your regpair mapped
> to 'DE'.
>
>
>> May 26 12:10:37 mrouter46 kernel: [ 31.054178] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
>> May 26 12:10:37 mrouter46 kernel: [ 31.054207] (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>> May 26 12:10:37 mrouter46 kernel: [ 31.054232] (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
>> May 26 12:10:37 mrouter46 kernel: [ 31.054258] (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
>> May 26 12:10:37 mrouter46 kernel: [ 31.054284] (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>> May 26 12:10:37 mrouter46 kernel: [ 31.054310] (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
>> May 26 12:10:38 mrouter46 kernel: [ 31.212057] phy0: Selected rate control algorithm \'minstrel\'
>> May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
>> May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k phy0: RF5112B multiband radio found (0x36)
>> May 26 12:10:38 mrouter46 kernel: [ 31.212732] ath5k 0000:00:0e.0: registered as \'phy1\'
>> May 26 12:10:38 mrouter46 kernel: [ 31.622592] cfg80211: Calling CRDA for country: DE
>>
> Here is the call for 'DE'
>
>
>> May 26 12:10:38 mrouter46 kernel: [ 31.688006] cfg80211: Regulatory domain changed to country: DE
>> May 26 12:10:38 mrouter46 kernel: [ 31.688030] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
>> May 26 12:10:38 mrouter46 kernel: [ 31.688057] (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
>> May 26 12:10:38 mrouter46 kernel: [ 31.688080] (5150000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
>> May 26 12:10:38 mrouter46 kernel: [ 31.688103] (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: EEPROM regdomain: 0x8114
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: EEPROM indicates we should expect a country code
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: doing EEPROM country->regdmn map search
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: country maps to regdmn code: 0x37
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: Country alpha2 being used: DE
>> May 26 12:10:38 mrouter46 kernel: [ 31.745694] ath: Regpair used: 0x37
>> May 26 12:10:38 mrouter46 kernel: [ 31.758662] phy1: Selected rate control algorithm \'minstrel\'
>> May 26 12:10:38 mrouter46 kernel: [ 31.759383] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
>> May 26 12:10:38 mrouter46 kernel: [ 31.759383] ath5k phy1: RF5112B multiband radio found (0x36)
>>
> Do you have two cards?
>

Yes.

Best regards,
Arnd

2010-05-26 17:30:55

by Arnd Hannemann

[permalink] [raw]
Subject: Re: regulatory problems with ath5k

Hi,

FWI: I believe this whole regulatory framework is pretty broken in 2.6.34
If I associate with a 802.11g accesspoint with one NIC , I'm not allowed
to use 802.11a on my other NIC at all.

[ 23.352168] wlan0: associated
[ 23.355993] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 23.375106] cfg80211: Calling CRDA for country: DE
[ 23.412542] cfg80211: Current regulatory domain updated by AP to: DE
[ 23.431728] (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 23.454319] (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 1800 mBm)

# iw reg get
country 98:
(2402 - 2482 @ 40), (N/A, 18)

???

Best regards,
Arnd


2010-05-26 17:45:58

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: regulatory problems with ath5k

On Wed, May 26, 2010 at 10:07 AM, Arnd Hannemann
<[email protected]> wrote:
> Hi,
>
> FWI: I believe this whole regulatory framework is pretty broken in 2.6.34
> If I associate with a 802.11g accesspoint with one NIC , I'm not allowed
> to use 802.11a on my other NIC at all.
>
> [   23.352168] wlan0: associated
> [   23.355993] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> [   23.375106] cfg80211: Calling CRDA for country: DE
> [   23.412542] cfg80211: Current regulatory domain updated by AP to: DE
> [   23.431728]     (start_freq - end_freq @ bandwidth),
> (max_antenna_gain, max_eirp)
> [   23.454319]     (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 1800 mBm)
>
> # iw reg get
> country 98:
>    (2402 - 2482 @ 40), (N/A, 18)
>
> ???

No, although that may be your regulatory domain cfg80211 will not
disable 5 GHz if you already had it enabled and your AP provided a
country IE with only 2 GHz rules. Check 'iw list' both before and
after you associate.

Luis

2010-05-26 17:11:38

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: regulatory problems with ath5k

On Wed, May 26, 2010 at 4:23 AM, Arnd Hannemann
<[email protected]> wrote:
> Hi,
>
> I'm trying to use 802.11a channels in AP mode with my ath5k nics with kernel 2.6.34.
> And after setting up crda, udev and wireless regdb,

Which release of wireless-regdb?

> "iw list" still shows flags
> "passive scanning, no IBSS" for most of the 802.11a channels (see below.)
>
> I wonder what I'm doing wrong here?

Lets take a look.

>
>        Band 2:
>                Frequencies:
>                        * 5180 MHz [36] (20.0 dBm) (radar detection)
>                        * 5200 MHz [40] (20.0 dBm) (radar detection)
>                        * 5220 MHz [44] (20.0 dBm) (radar detection)
>                        * 5240 MHz [48] (20.0 dBm) (radar detection)
>                        * 5260 MHz [52] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5280 MHz [56] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5300 MHz [60] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5320 MHz [64] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5500 MHz [100] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5520 MHz [104] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5540 MHz [108] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5560 MHz [112] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5580 MHz [116] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5600 MHz [120] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5620 MHz [124] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5640 MHz [128] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5660 MHz [132] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5680 MHz [136] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>                        * 5700 MHz [140] (26.0 dBm) (passive scanning, no IBSS, radar detection)


Please do: 'iw reg get' and paste the output here, the above channels
should not be passive scan/no-ibss for 'DE'.

>                        * 5745 MHz [149] (disabled)
>                        * 5765 MHz [153] (disabled)
>                        * 5785 MHz [157] (disabled)
>                        * 5805 MHz [161] (disabled)
>                        * 5825 MHz [165] (disabled)
>
> hannemann@mrouter46:~ $ sudo iw reg get
> country DE:
>        (2400 - 2483 @ 40), (N/A, 20)
>        (5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
>        (5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS
>
> dmesg snippet:
>
> May 26 12:10:36 mrouter46 kernel: [   30.023089] console [netcon0] enabled
> May 26 12:10:36 mrouter46 kernel: [   30.023103] netconsole: network logging started
> May 26 12:10:36 mrouter46 kernel: [   30.314702] cfg80211: Calling CRDA to update world regulatory domain
> May 26 12:10:37 mrouter46 kernel: [   30.555745] ath5k 0000:00:0c.0: registered as \'phy0\'
> May 26 12:10:37 mrouter46 kernel: [   31.039151] ath: EEPROM regdomain: 0x8114

WTF your EEPROM has 0x8114 set on the regulatory domain. David, have
you ever seen such a thing? This kernel (2.6.34) should already have
an ath5k EEPROM checksum check so the EEPROM should be valid. Lets
figure this out first before digging more into this.

Some more notes below though.

> May 26 12:10:37 mrouter46 kernel: [   31.039168] ath: EEPROM indicates we should expect a country code
> May 26 12:10:37 mrouter46 kernel: [   31.039188] ath: doing EEPROM country->regdmn map search
> May 26 12:10:37 mrouter46 kernel: [   31.039205] ath: country maps to regdmn code: 0x37
> May 26 12:10:37 mrouter46 kernel: [   31.039222] ath: Country alpha2 being used: DE
> May 26 12:10:37 mrouter46 kernel: [   31.039237] ath: Regpair used: 0x37
> May 26 12:10:37 mrouter46 kernel: [   31.054155] cfg80211: World regulatory domain updated:

So cfg80211 *first* starts out with the world regulatory domain by
default, and then it will call CRDA for DE since your regpair mapped
to 'DE'.

> May 26 12:10:37 mrouter46 kernel: [   31.054178]     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
> May 26 12:10:37 mrouter46 kernel: [   31.054207]     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> May 26 12:10:37 mrouter46 kernel: [   31.054232]     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
> May 26 12:10:37 mrouter46 kernel: [   31.054258]     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
> May 26 12:10:37 mrouter46 kernel: [   31.054284]     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> May 26 12:10:37 mrouter46 kernel: [   31.054310]     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> May 26 12:10:38 mrouter46 kernel: [   31.212057] phy0: Selected rate control algorithm \'minstrel\'
> May 26 12:10:38 mrouter46 kernel: [   31.212732] ath5k phy0: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
> May 26 12:10:38 mrouter46 kernel: [   31.212732] ath5k phy0: RF5112B multiband radio found (0x36)
> May 26 12:10:38 mrouter46 kernel: [   31.212732] ath5k 0000:00:0e.0: registered as \'phy1\'
> May 26 12:10:38 mrouter46 kernel: [   31.622592] cfg80211: Calling CRDA for country: DE

Here is the call for 'DE'

> May 26 12:10:38 mrouter46 kernel: [   31.688006] cfg80211: Regulatory domain changed to country: DE
> May 26 12:10:38 mrouter46 kernel: [   31.688030]     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
> May 26 12:10:38 mrouter46 kernel: [   31.688057]     (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
> May 26 12:10:38 mrouter46 kernel: [   31.688080]     (5150000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
> May 26 12:10:38 mrouter46 kernel: [   31.688103]     (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: EEPROM regdomain: 0x8114
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: EEPROM indicates we should expect a country code
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: doing EEPROM country->regdmn map search
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: country maps to regdmn code: 0x37
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: Country alpha2 being used: DE
> May 26 12:10:38 mrouter46 kernel: [   31.745694] ath: Regpair used: 0x37
> May 26 12:10:38 mrouter46 kernel: [   31.758662] phy1: Selected rate control algorithm \'minstrel\'
> May 26 12:10:38 mrouter46 kernel: [   31.759383] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
> May 26 12:10:38 mrouter46 kernel: [   31.759383] ath5k phy1: RF5112B multiband radio found (0x36)

Do you have two cards?

Luis

2010-05-26 18:12:47

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: regulatory problems with ath5k

On Wed, May 26, 2010 at 11:09 AM, Arnd Hannemann
<[email protected]> wrote:
> Am 26.05.2010 19:11, schrieb Luis R. Rodriguez:
>> On Wed, May 26, 2010 at 4:23 AM, Arnd Hannemann
>> <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I'm trying to use 802.11a channels in AP mode with my ath5k nics with kernel 2.6.34.
>>> And after setting up crda, udev and wireless regdb,
>>>
>> Which release of wireless-regdb?
>>
>>
> This morning's git tree. I just copied the regulatory.bin from there.
> Last commit was:
>
> commit f3ba942f073358d1bca82a389da9f7da6e8fe81f
> Author: John W. Linville <[email protected]>
> Date:   Fri Feb 5 13:47:41 2010 -0500
>
>    wireless-regdb: update sha1sum.txt in Makefile and fix REGDB_CHANGED
>
>    Signed-off-by: John W. Linville <[email protected]>
>
>
>
>
>>> "iw list" still shows flags
>>> "passive scanning, no IBSS" for most of the 802.11a channels (see below.)
>>>
>>> I wonder what I'm doing wrong here?
>>>
>> Lets take a look.
>>
>>
>>>        Band 2:
>>>                Frequencies:
>>>                        * 5180 MHz [36] (20.0 dBm) (radar detection)
>>>                        * 5200 MHz [40] (20.0 dBm) (radar detection)
>>>                        * 5220 MHz [44] (20.0 dBm) (radar detection)
>>>                        * 5240 MHz [48] (20.0 dBm) (radar detection)
>>>                        * 5260 MHz [52] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5280 MHz [56] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5300 MHz [60] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5320 MHz [64] (20.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5500 MHz [100] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5520 MHz [104] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5540 MHz [108] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5560 MHz [112] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5580 MHz [116] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5600 MHz [120] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5620 MHz [124] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5640 MHz [128] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5660 MHz [132] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5680 MHz [136] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>                        * 5700 MHz [140] (26.0 dBm) (passive scanning, no IBSS, radar detection)
>>>
>>
>> Please do: 'iw reg get' and paste the output here, the above channels
>> should not be passive scan/no-ibss for 'DE'.
>>
>
> hannemann@mrouter46:~ $ sudo iw reg get
> country DE:
>       (2400 - 2483 @ 40), (N/A, 20)
>       (5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
>       (5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS
>
>
>>> hannemann@mrouter46:~ $ sudo iw reg get
>>> country DE:
>>>        (2400 - 2483 @ 40), (N/A, 20)
>>>        (5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
>>>        (5470 - 5725 @ 40), (N/A, 26), NO-OUTDOOR, DFS
>>>
>>> dmesg snippet:
>>>
>>> May 26 12:10:36 mrouter46 kernel: [   30.023089] console [netcon0] enabled
>>> May 26 12:10:36 mrouter46 kernel: [   30.023103] netconsole: network logging started
>>> May 26 12:10:36 mrouter46 kernel: [   30.314702] cfg80211: Calling CRDA to update world regulatory domain
>>> May 26 12:10:37 mrouter46 kernel: [   30.555745] ath5k 0000:00:0c.0: registered as \'phy0\'
>>> May 26 12:10:37 mrouter46 kernel: [   31.039151] ath: EEPROM regdomain: 0x8114
>>>
>> WTF your EEPROM has 0x8114 set on the regulatory domain. David, have
>> you ever seen such a thing? This kernel (2.6.34) should already have
>> an ath5k EEPROM checksum check so the EEPROM should be valid. Lets
>> figure this out first before digging more into this.
>>
>> Some more notes below though.
>>
>
> You got me, I hacked this up:
>
> --- linux-2.6.34/drivers/net/wireless/ath/regd.c    2010-05-16
> 23:17:36.000000000 +0200
> +++ linux-2.6.34.x-um/drivers/net/wireless/ath/regd.c    2010-05-26
> 19:57:44.000000000 +0200
> @@ -501,7 +501,7 @@ ath_regd_init(struct ath_regulatory *reg
>         return -EINVAL;
>
>     ath_regd_sanitize(reg);
> -
> +    reg->current_rd = CTRY_GERMANY | COUNTRY_ERD_FLAG;
>     printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
>
>     if (!ath_regd_is_eeprom_valid(reg)) {
>
>
> Do you think this is the cause?

You won't get support if you hack that stuff, you should be using only
what your EEPROM is configured for, otherwise good luck, you're on
your own.

Provide the logs with that change removed to receive more review,
otherwise I consider this thread dead.

Luis