ath9k regulatory
Hi,
I'm using a TP-Link TL-WN861N card. What could be the reason that channels 12 and 13 are
not allowed ?
Using compat-wireless 2009-01-25.
Relevant dmesg output:
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: DE
cfg80211: Regulatory domain changed to country: DE
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
(5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
(5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)ath9k: 0.1
PCI: enabling device 0000:00:02.0 (0140 -> 0142)
ath9k: 2MHz channel: 2412, channelFlags: 0x300e0
ath9k: 2MHz channel: 2417, channelFlags: 0x300e0
ath9k: 2MHz channel: 2422, channelFlags: 0x300e0
ath9k: 2MHz channel: 2427, channelFlags: 0x300e0
ath9k: 2MHz channel: 2432, channelFlags: 0x700e0
ath9k: 2MHz channel: 2437, channelFlags: 0x700e0
ath9k: 2MHz channel: 2442, channelFlags: 0x700e0
ath9k: 2MHz channel: 2447, channelFlags: 0x500e0
ath9k: 2MHz channel: 2452, channelFlags: 0x500e0
ath9k: 2MHz channel: 2457, channelFlags: 0x500e0
ath9k: 2MHz channel: 2462, channelFlags: 0x500e0
ath9k: Rate: 1Mbps, ratecode: 27
ath9k: Rate: 2Mbps, ratecode: 26
ath9k: Rate: 5Mbps, ratecode: 25
ath9k: Rate: 11Mbps, ratecode: 24
ath9k: Rate: 6Mbps, ratecode: 11
ath9k: Rate: 9Mbps, ratecode: 15
ath9k: Rate: 12Mbps, ratecode: 10
ath9k: Rate: 18Mbps, ratecode: 14
ath9k: Rate: 24Mbps, ratecode: 9
ath9k: Rate: 36Mbps, ratecode: 13
ath9k: Rate: 48Mbps, ratecode: 8
ath9k: Rate: 54Mbps, ratecode: 12
ath9k: Rate: 6Mbps, ratecode: 11
ath9k: Rate: 9Mbps, ratecode: 15
ath9k: Rate: 12Mbps, ratecode: 10
ath9k: Rate: 18Mbps, ratecode: 14
ath9k: Rate: 24Mbps, ratecode: 9
ath9k: Rate: 36Mbps, ratecode: 13
ath9k: Rate: 48Mbps, ratecode: 8
ath9k: Rate: 54Mbps, ratecode: 12
ath9k: tx DMA: 512 buffers 1 desc/buf
ath9k: tx DMA map: ffc08000 (73728) -> 1f80000 (73728)
ath9k: beacon DMA: 1 buffers 1 desc/buf
ath9k: beacon DMA map: ffc1a000 (144) -> 1eb3000 (144)
ath9k: cachelsz 32 rxbufsize 3872
ath9k: rx DMA: 512 buffers 1 desc/buf
ath9k: rx DMA map: ffc1b000 (73728) -> 1fa0000 (73728)
phy0: Selected rate control algorithm 'ath9k_rate_control' Registered led device: ath9k-phy0:radio
Registered led device: ath9k-phy0:assoc
Registered led device: ath9k-phy0:tx
Registered led device: ath9k-phy0:rx
phy0: Atheros AR5416 MAC/BB Rev:2 AR2122 RF Rev:81: mem=0xc2900000, irq=27
Cheers,
Zoltan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20090126/974e1d3d/attachment.htm
Quoted 60 lines · Zoltan Devai
Hi,
I'm using a TP-Link TL-WN861N card. What could be the reason that channels 12 and 13 are not allowed ?
Using compat-wireless 2009-01-25.
Relevant dmesg output:cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm) (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm) cfg80211: Calling CRDA for country: DE cfg80211: Regulatory domain changed to country: DE (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm) (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)ath9k: 0.1
PCI: enabling device 0000:00:02.0 (0140 -> 0142)
ath9k: 2MHz channel: 2412, channelFlags:0x300e0
ath9k: 2MHz channel: 2417, channelFlags:0x300e0
ath9k: 2MHz channel: 2422, channelFlags:0x300e0
ath9k: 2MHz channel: 2427, channelFlags:0x300e0
ath9k: 2MHz channel: 2432, channelFlags:0x700e0
ath9k: 2MHz channel: 2437, channelFlags:0x700e0
ath9k: 2MHz channel: 2442, channelFlags:0x700e0
ath9k: 2MHz channel: 2447, channelFlags:0x500e0
ath9k: 2MHz channel: 2452, channelFlags:0x500e0
ath9k: 2MHz channel: 2457, channelFlags:0x500e0
ath9k: 2MHz channel: 2462, channelFlags:0x500e0
ath9k: Rate: 1Mbps, ratecode: 27
ath9k: Rate: 2Mbps, ratecode: 26
ath9k: Rate: 5Mbps, ratecode: 25
ath9k: Rate: 11Mbps, ratecode: 24
ath9k: Rate: 6Mbps, ratecode: 11
ath9k: Rate: 9Mbps, ratecode: 15
ath9k: Rate: 12Mbps, ratecode: 10
ath9k: Rate: 18Mbps, ratecode: 14
ath9k: Rate: 24Mbps, ratecode: 9
ath9k: Rate: 36Mbps, ratecode: 13
ath9k: Rate: 48Mbps, ratecode: 8
ath9k: Rate: 54Mbps, ratecode: 12
ath9k: Rate: 6Mbps, ratecode: 11
ath9k: Rate: 9Mbps, ratecode: 15
ath9k: Rate: 12Mbps, ratecode: 10
ath9k: Rate: 18Mbps, ratecode: 14
ath9k: Rate: 24Mbps, ratecode: 9
ath9k: Rate: 36Mbps, ratecode: 13
ath9k: Rate: 48Mbps, ratecode: 8
ath9k: Rate: 54Mbps, ratecode: 12
ath9k: tx DMA: 512 buffers 1 desc/buf
ath9k: tx DMA map:ffc08000(73728) -> 1f80000 (73728)
ath9k: beacon DMA: 1 buffers 1 desc/buf
ath9k: beacon DMA map:ffc1a000(144) -> 1eb3000 (144)
ath9k: cachelsz 32 rxbufsize 3872
Quoted 8 lines
ath9k: rx DMA: 512 buffers 1 desc/buf
ath9k: rx DMA map:ffc1b000(73728) -> 1fa0000 (73728)
phy0: Selected rate control algorithm 'ath9k_rate_control' Registered led device: ath9k-phy0:radio
Registered led device: ath9k-phy0:assoc
Registered led device: ath9k-phy0:tx
Registered led device: ath9k-phy0:rx
phy0: Atheros AR5416 MAC/BB Rev:2 AR2122 RF Rev:81: mem=0xc2900000, irq=27
I take it the second DE regulatory request was yours? Anyway -- since I am not seeing any print out during ath9k's initialization on regulatory it would seem your card uses one of the built-in regulatory domains.
You can use iw to see your allowed channels:
iw list
If your regulatory domain does not allow for it you will not be able to use that channel.
To confirm you can recompile ath9k with debugging enabled with the patch attached applied. Then load ath9k as follows:
insmod drivers/net/wireless/ath9k/ath9k.ko debug=0x00000080
0x00000080 is ATH_DBG_REGULATORY so this will show all regulatory debug prints.
Luis
From: Luis R. Rodriguez <[email protected]>
Date: Mon, 26 Jan 2009 06:41:48 -0800
Subject: [PATCH] ath9k: fix debug print on regd
With debugging enabled and with ATH_DBG_REGULATORY selected we wouldn't get the full print out of one line, reason is we used "," instead of nothing to separate two lines.
--- drivers/net/wireless/ath9k/regd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath9k/regd.c +1 -1
@@ -447,7 +447,7 @@ int ath9k_regd_init(struct ath_hal *ah) }DPRINTF (ah->ah_sc,ATH_DBG_REGULATORY , -"Country alpha2 being used: %c%c\n" , +"Country alpha2 being used: %c%c\n" "Regpair detected: 0x%0x\n" , ah->alpha2[0 ], ah->alpha2[1 ], ah->regpair->regDmnEnum);
Signature · 1 line
1.5.6.4
Quoted 1 line · Luis Rodriguez
To confirm you can recompile ath9k with debugging enabled
you do this in compat-wireless by editing config.mk and adding a line with:
CONFIG_ATH9K_DEBUG=y
Then recompile.
Luis
2009/1/26 Luis R. Rodriguez <[email protected]>
Quoted 6 lines · Zoltan Devai
Quoted 1 line
I'm using a TP-Link TL-WN861N card. What could be the reason that
channels 12 and 13 are
Quoted 2 lines
not allowed ?
Using compat-wireless 2009-01-25.
<snip>
I take it the second DE regulatory request was yours?
That's coming from loading cfg80211 with ieee80211_regdom=DE.
Quoted 3 lines
If your regulatory domain does not allow for it you will not be able to use that
channel.
I'm a bit confused now about who tells what the regulatory domain is. Does the (EEPROM on the) card override the user setting ? Is there a way to give the users preference priority ?
Quoted 3 lines
To confirm you can recompile ath9k with debugging enabled with the patch attached applied.
Gives me this:
# modprobe ath9k debug=0x00000080
ath9k: 0.1
PCI: enabling device 0000:00:02.0 (0140 -> 0142)
ath9k: Country alpha2 being used: US
Regpair detected: 0x3a
phy0: Selected rate control algorithm 'ath9k_rate_control'
cfg80211: Calling CRDA for country: US
Registered led device: ath9k-phy0:radio
Registered led device: ath9k-phy0:assoc
Registered led device: ath9k-phy0:tx
Registered led device: ath9k-phy0:rx
phy0: Atheros AR5416 MAC/BB Rev:2 AR2122 RF Rev:81: mem=0xc2900000, irq=27
cfg80211: Regulatory domain changed to country: US
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
(5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 1700 mBm)
(5250000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)If I do:
# iw reg set DE
cfg80211: Calling CRDA for country: DE
command failed: No such file or directory (-2)
cfg80211: Regulatory domain changed to country: DE
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
(5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm)
(5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)But iw list still is:
# iw list
Wiphy phy0
Band 1:
HT capabilities: 0x104e
* 20/40 MHz operation
* SM PS disabled
* 40 MHz short GI
* max A-MSDU len 3839
* DSSS/CCK 40 MHz
HT A-MPDU factor: 0x0003 (65535 bytes)
HT A-MPDU density: 0x0006 (8 usec)
HT MCS set: ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)Thanks,
Zoltan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20090126/d39cc26f/attachment.htm
Quoted 9 lines · Zoltan Devai
2009/1/26 Luis R. Rodriguez <lrodriguez at atheros.com<mailto:[email protected]>>
Quoted 3 lines · Zoltan Devai
I'm using a TP-Link TL-WN861N card. What could be the reason that channels 12 and 13 are not allowed ?
Using compat-wireless 2009-01-25.<snip>
I take it the second DE regulatory request was yours? That's coming from loading cfg80211 with ieee80211_regdom=DE.
ieee80211_regdom module parameter should be used with the only 3 old regulatory domains built into the kernel:
EU
US
JP
This is only available if you have the old regulatory option is enabled in the kernel:
CONFIG_WIRELESS_OLD_REGULATORY=y
This will hopefully be removed soon (2.6.31), it provides three regulatory domains statically into the kernel. The fact that CRDA is called even though you selected "DE" is by chance I had forgotten to make it only work for the 3 above. Regardless this is OK -- it is calling CRDA for the DE regulatory domain to help you enhance your regulatory settings.
Quoted 3 lines
If your regulatory domain does not allow for it you will not be able to use that channel.
I'm a bit confused now about who tells what the regulatory domain is.
Please have a read here:
http://wireless.kernel.org/en/developers/Regulatory
Let me try to summarize it for your case though. If the no one knows where we are we will defualt to the world regulatory domain (unless OLD_REG is enabled which defaults to the US), if a driver knows the regulatory domain it should abide by then the wireless core is now switched to that regulatory domain. If a user knows changes country and the card also has a programmed regulatory domain the card will operate under the intersection of both.
Quoted 1 line
Does the (EEPROM on the) card override the user setting ?
It varies by driver, on some drivers, like rt2x00 drivers the documentation provided indicates and recommends that the regulatory domain not be considered from the EEPROM so alternatives are to be used. In some other cases the EEPROM information must always be respected as is the case with Intel and Atheros' drivers.
Quoted 1 line
Is there a way to give the users preference priority ?
The user can always specifify the regulatory domain that is the default. In ath9k's case the EEPROM is always respected though.
Quoted 53 lines
To confirm you can recompile ath9k with debugging enabled with the patch attached applied.
Gives me this:# modprobe ath9k debug=0x00000080 ath9k: 0.1 PCI: enabling device 0000:00:02.0 (0140 -> 0142) ath9k: Country alpha2 being used: US Regpair detected: 0x3a phy0: Selected rate control algorithm 'ath9k_rate_control' cfg80211: Calling CRDA for country: US Registered led device: ath9k-phy0:radio Registered led device: ath9k-phy0:assoc Registered led device: ath9k-phy0:tx Registered led device: ath9k-phy0:rx phy0: Atheros AR5416 MAC/BB Rev:2 AR2122 RF Rev:81: mem=0xc2900000, irq=27 cfg80211: Regulatory domain changed to country: US (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm) (5170000 KHz - 5250000 KHz @ 40000 KHz), (600 mBi, 1700 mBm) (5250000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm) (5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 2000 mBm) (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)If I do:
# iw reg set DE cfg80211: Calling CRDA for country: DE command failed: No such file or directory (-2) cfg80211: Regulatory domain changed to country: DE (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) (5150000 KHz - 5255000 KHz @ 40000 KHz), (N/A, 2301 mBm) (5470000 KHz - 5650000 KHz @ 40000 KHz), (N/A, 3000 mBm)But iw list still is:
# iw list Wiphy phy0 Band 1: HT capabilities: 0x104e * 20/40 MHz operation * SM PS disabled * 40 MHz short GI * max A-MSDU len 3839 * DSSS/CCK 40 MHz HT A-MPDU factor: 0x0003 (65535 bytes) HT A-MPDU density: 0x0006 (8 usec) HT MCS set: ff ff 00 00 00 00 00 00 00 00 00 00 01 00 00 00 Frequencies: * 2412 MHz [1] (20.0 dBm) * 2417 MHz [2] (20.0 dBm) * 2422 MHz [3] (20.0 dBm) * 2427 MHz [4] (20.0 dBm) * 2432 MHz [5] (20.0 dBm) * 2437 MHz [6] (20.0 dBm)
Quoted 8 lines
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)Yeap, this is by design -- your card has the "US" regulatory domain and as such has those channels are disabled and you cannot enable them. Reason for this is the device was not calibrated to operate on those channels and as such proper behaviour cannot be guaranteed. For cards where proper behaviour can be guaranteed you will be able to enable those channels like on the b43 driver.
Luis
Whoops, here's the CC for the list.
2009/1/26 Luis R. Rodriguez <[email protected]>
Quoted 6 lines · Zoltan Devai
Quoted 5 lines
2009/1/26 Luis R. Rodriguez <lrodriguez at atheros.com<mailto:[email protected]>>
Quoted 3 lines · Zoltan Devai
I'm using a TP-Link TL-WN861N card. What could be the reason that channels 12 and 13 are not allowed ?
Using compat-wireless 2009-01-25.
Thanks for the explanation on the regulatory.
Quoted 10 lines
Quoted 1 line
Is there a way to give the users preference priority ?
The user can always specifify the regulatory domain that is the default. In ath9k's case the EEPROM is always respected though.
Quoted 4 lines
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
Quoted 6 lines
Yeap, this is by design -- your card has the "US" regulatory domain and as such has those channels are disabled and you cannot enable them. Reason for this is the device was not calibrated to operate on those channels and as such proper behaviour cannot be guaranteed. For cards where proper behaviour can be guaranteed you will be able to enable those channels like on the b43 driver.
The EEP_REG_0 is actually 0x0000 on my card and the driver defaults US for that. Is that a valid value to put in the EEPROM ? Or was just the card manufacturer sloppy and it rather means "don't care", in which case the driver should enable all channels ?
Cheers,
Zoltan
Quoted 29 lines · Zoltan Devai
Whoops, here's the CC for the list.
2009/1/26 Luis R. Rodriguez <[email protected]>
Quoted 6 lines · Zoltan Devai
Quoted 5 lines
2009/1/26 Luis R. Rodriguez <lrodriguez at atheros.com<mailto:[email protected]>>
Quoted 3 lines · Zoltan Devai
I'm using a TP-Link TL-WN861N card. What could be the reason that channels 12 and 13 are not allowed ?
Using compat-wireless 2009-01-25.Thanks for the explanation on the regulatory.
Quoted 10 lines
Quoted 1 line
Is there a way to give the users preference priority ?
The user can always specifify the regulatory domain that is the default. In ath9k's case the EEPROM is always respected though.
Quoted 4 lines
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)Quoted 6 lines
Yeap, this is by design -- your card has the "US" regulatory domain and as such has those channels are disabled and you cannot enable them. Reason for this is the device was not calibrated to operate on those channels and as such proper behaviour cannot be guaranteed. For cards where proper behaviour can be guaranteed you will be able to enable those channels like on the b43 driver.
Quoted 2 lines
The
EEP_REG_0is actually0x0000on my card and the driver defaults US for that. Is that a valid value to put in the EEPROM ?
As per this implementation -- yes, it seems that is the case. I am however not sure how common this is. I'll try to find out.
Quoted 3 lines
Or was just the card
manufacturer sloppy and it rather means "don't care", in which case the driver should enable all channels ?
It really depends on who manufactured the card and their decision on how to support the device and how the vendor documents this for them. The driver just follows this architectural design. That is why regulatory is such a pain in the ass -- vendor involvement is key.
Luis