Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[Solved] Changing the wifi regulatory domain

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
27 posts
  • 1
  • 2
  • Next
Author
Message
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

[Solved] Changing the wifi regulatory domain

  • Quote

Post by Bullet Dodger » Thu Feb 02, 2012 9:59 pm

I have a home built router to which I have just added a 2nd wifi card so that I can use the 5GHz spectrum of 802.11n, although hostapd is refusing to do this. The root cause appears to be the regulatory domain:

Code: Select all

# iw reg get
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
In /etc/hostapd/hostapd.conf, I have the line:

Code: Select all

# grep country /etc/hostapd/hostapd.conf
country_code=GB
But the regulatory domain is still "world"

Code: Select all

# grep -i crda /var/log/messages
Feb  2 21:22:23 tux kernel: [   16.479558] cfg80211: Calling CRDA to update world regulatory domain
How do I go about changing this?
Last edited by Bullet Dodger on Tue Feb 14, 2012 9:01 pm, edited 1 time in total.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Thu Feb 02, 2012 11:43 pm

I found cdra wasn't installed. After emerging it I now have:

Code: Select all

# iw reg get
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
But I think there is still a problem, as I still have:

Code: Select all

# iw info

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

The card is:

Code: Select all

02:00.0 Network controller: Atheros Communications Inc. AR5418 Wireless Network Adapter [AR5008E 802.11(a)bgn] (PCI-Express) (rev 01)
Using the ath9k driver
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Fri Feb 03, 2012 12:17 am

It looks like the card is still using the world regulatory domain:

Code: Select all

Feb  2 23:45:38 tux kernel: [   18.252652] ath9k 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
Feb  2 23:45:38 tux kernel: [   18.252678] ath9k 0000:02:00.0: setting latency timer to 64
Feb  2 23:45:38 tux kernel: [   18.383197] ath: EEPROM regdomain: 0x60
Feb  2 23:45:38 tux kernel: [   18.383204] ath: EEPROM indicates we should expect a direct regpair map
Feb  2 23:45:38 tux kernel: [   18.383213] ath: Country alpha2 being used: 00
Feb  2 23:45:38 tux kernel: [   18.383217] ath: Regpair used: 0x60
Feb  2 23:45:38 tux kernel: [   18.466320] ieee80211 phy0: Selected rate control algorithm 'ath9k_rate_control'
Feb  2 23:45:38 tux kernel: [   18.470980] Registered led device: ath9k-phy0
Feb  2 23:45:38 tux kernel: [   18.471048] ieee80211 phy0: Atheros AR5418 MAC/BB Rev:2 AR5133 RF Rev:81 mem=0xffffc90011560000, irq=17
How do I change this?
Top
cwr
Veteran
Veteran
Posts: 1969
Joined: Sat Dec 17, 2005 11:17 am

  • Quote

Post by cwr » Fri Feb 03, 2012 8:21 am

I had to load the ath9k wireless driver as a module; it wouldn't change regulatory
domain when built into the kernel.

Will
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Fri Feb 03, 2012 2:34 pm

Also to mention wireless drivers that don't even try to use other than all-world-00 domains like the
proprietary broadcom-sta
As it is stated in their Readme!

And my chip
BCM4321 802.11a/b/g/n [14e4:4328] (mac-mini)
isnt supported at all by mainline linux ...
Top
Gusar
Advocate
Advocate
Posts: 2665
Joined: Sat Apr 09, 2005 10:19 pm
Location: Slovenia

  • Quote

Post by Gusar » Fri Feb 03, 2012 2:39 pm

ulenrich wrote:And my chip
BCM4321 802.11a/b/g/n [14e4:4328] (mac-mini)
isnt supported at all by mainline linux ...
Sure it is. Since 2.3.39. There's some caveats (no 5GHz operation, no HT40 channels), but otherwise it works. b43 driver.
Top
Logicien
Veteran
Veteran
User avatar
Posts: 1555
Joined: Fri Sep 16, 2005 8:04 am
Location: Montréal

  • Quote

Post by Logicien » Fri Feb 03, 2012 4:49 pm

The module cfg80211 have the parameter ieee80211_regdom that can be use to set the IEEE 802.11 regulatory domain code:

Code: Select all

modinfo -p cfg80211
cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band
ieee80211_regdom:IEEE 802.11 regulatory domain code
So using that parameter when module load might help:

Code: Select all

modprobe cfg80211 ieee80211_regdom=GB
or

Code: Select all

echo 'options cfg80211 ieee80211_regdom=GB' > /etc/modprobe.d/cfg80211.conf
Paul
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Fri Feb 03, 2012 9:35 pm

That one didn't work :-(

Code: Select all

# modprobe cfg80211 ieee80211_regdom=GB
# iw phy phy0 info
                Frequencies:
                        * 5180 MHz [36] (12.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (16.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (16.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (16.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (disabled)
                        * 5280 MHz [56] (disabled)
                        * 5300 MHz [60] (disabled)
                        * 5320 MHz [64] (disabled)
                        * 5500 MHz [100] (disabled)
                        * 5520 MHz [104] (disabled)
                        * 5540 MHz [108] (disabled)
                        * 5560 MHz [112] (disabled)
                        * 5580 MHz [116] (disabled)
                        * 5600 MHz [120] (disabled)
                        * 5620 MHz [124] (disabled)
                        * 5640 MHz [128] (disabled)
                        * 5660 MHz [132] (disabled)
                        * 5680 MHz [136] (disabled)
                        * 5700 MHz [140] (disabled)
                        * 5745 MHz [149] (20.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (20.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (20.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (20.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (20.0 dBm) (passive scanning, no IBSS)
I'll try a kernel recompile with the ath9k build as a module.
Currently I have:

Code: Select all

# zcat /proc/config.gz | grep -i ath9k
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K=m
CONFIG_ATH9K_PCI=y
# CONFIG_ATH9K_AHB is not set
CONFIG_ATH9K_DEBUGFS=y
CONFIG_ATH9K_RATE_CONTROL=y
CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS is not set
Last edited by Bullet Dodger on Wed Feb 08, 2012 12:25 am, edited 1 time in total.
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

  • Quote

Post by turtles » Sat Feb 04, 2012 2:52 am

Bullet Dodger wrote:I found cdra wasn't installed. After emerging it I now have:

Code: Select all

# iw reg get
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
By emerging it you mean

Code: Select all

net-wireless/wireless-regdb
?
I have had this problem since last July on any US network with ath9k and a AR5008
Which is everywhere but my home network which uses country '00'
I have a stale post here somewhere about it.

Code: Select all

iw reg set US
iw reg get
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
It would be nice to get ath9k working in Gentoo again.
Donate to Gentoo
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sat Feb 04, 2012 9:32 am

turtles wrote:
Bullet Dodger wrote:I found cdra wasn't installed. After emerging it I now have:

Code: Select all

# iw reg get
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
By emerging it you mean

Code: Select all

net-wireless/wireless-regdb
?
No

Code: Select all

# emerge -a crda
Just about to recompile the kernel with CONFIG_ATH9K_PCI and CONFIG_ATH9K_RATE_CONTROL, build as modules. I'll let you know how that goes.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sat Feb 04, 2012 10:08 am

It appears that genkernel will not allow CONFIG_ATH9K_PCI and CONFIG_ATH9K_RATE_CONTROL to be built as modules
Top
Gusar
Advocate
Advocate
Posts: 2665
Joined: Sat Apr 09, 2005 10:19 pm
Location: Slovenia

  • Quote

Post by Gusar » Sat Feb 04, 2012 10:27 am

Bullet Dodger wrote:It appears that genkernel will not allow CONFIG_ATH9K_PCI and CONFIG_ATH9K_RATE_CONTROL to be built as modules
That's perfectly normal, and has nothing to do with genkernel. Those merely set driver options, they're not drivers themselves. If you activate these options, they will be built into the atk9k driver.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sat Feb 04, 2012 12:04 pm

Ok,

So I have ath9k built as a module

Code: Select all

# zcat /proc/config.gz | grep -i ath9k
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K=m
CONFIG_ATH9K_PCI=y
CONFIG_ATH9K_AHB=y
# CONFIG_ATH9K_DEBUGFS is not set
CONFIG_ATH9K_RATE_CONTROL=y
CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS is not set
I have cdra installed and

Code: Select all

# iw reg get
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
But still

Code: Select all

# iw phy phy0 info
                Frequencies:
                        * 5180 MHz [36] (12.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (16.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (16.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (16.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (20.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (20.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (20.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (20.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (20.0 dBm) (passive scanning, no IBSS)
And if I try to change the reg domain of the card

Code: Select all

# modprobe cfg80211 ieee80211_regdom=GB 
And this time no change

Code: Select all

                Frequencies:
                        * 5180 MHz [36] (12.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (16.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (16.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (16.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (16.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (18.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (20.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (20.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (20.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (20.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (20.0 dBm) (passive scanning, no IBSS)
Last edited by Bullet Dodger on Wed Feb 08, 2012 12:26 am, edited 1 time in total.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sat Feb 04, 2012 12:27 pm

Could this be related?

Code: Select all

# zcat /proc/config.gz | grep CONFIG_CFG80211_INTERNAL_REGDB
# CONFIG_CFG80211_INTERNAL_REGDB is not set
Top
Gusar
Advocate
Advocate
Posts: 2665
Joined: Sat Apr 09, 2005 10:19 pm
Location: Slovenia

  • Quote

Post by Gusar » Sat Feb 04, 2012 12:35 pm

Bullet Dodger wrote:Could this be related?

Code: Select all

# zcat /proc/config.gz | grep CONFIG_CFG80211_INTERNAL_REGDB
# CONFIG_CFG80211_INTERNAL_REGDB is not set
Nope. This kernel option is an alternative to the wireless-regdb package, so if you have that package, the kernel option isn't needed. But it doesn't hurt to try a kernel with it activated.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sat Feb 04, 2012 1:02 pm

I think the problem is that the card has the world regulatory domain programmed into the EEPROM, and hostapd will not override it.

Code: Select all

# dmesg | grep EEPROM -2
[   18.170278] ath: EEPROM regdomain: 0x60
[   18.170283] ath: EEPROM indicates we should expect a direct regpair map
[   18.170292] ath: Country alpha2 being used: 00
[   18.170296] ath: Regpair used: 0x60
http://linuxwireless.org/en/users/Drive ... tory_pairs
WOR0_WORLD = 0x60

Do I need to look at pre-programming the EEPROM / damaging the EEPROM / buying a new card?
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

  • Quote

Post by turtles » Sat Feb 04, 2012 4:11 pm

???
What is the point of having a regulatory database if it cant override the eprom setting?
If that is not a bug I dont know what one is.
My card used to be able to roam on US networks and now it cant since I think the .38 kernel series.
They have done exactly what they wanted to avoid with this the bug riddled regulatory code.
Now I am going to compile my own kernel and with all the regulatory stuff stripped out.
Donate to Gentoo
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Wed Feb 08, 2012 12:19 am

I have just tried using the madwifi's ath_info to change the regdomain in eeprom, but that failed.
I read somewhere that my card (168c:0024 AR5418 Wireless Network Adapter [AR5008E 802.11(a)bgn]) isn't supported by ath_info, because the eeprom layout has changed from previous atheros cards.
I'm not really sure where to go from here.
I obviously need to be more careful the next time I buy a wifi card.
Top
chithanh
Retired Dev
Retired Dev
User avatar
Posts: 2158
Joined: Sat Aug 05, 2006 10:16 pm
Location: Berlin, Germany

  • Quote

Post by chithanh » Wed Feb 08, 2012 12:48 am

Basically you can forget about operating a 5 GHz access point with a consumer card. Only cards intended for AP use will talk on 5 GHz channels before having received packets in that band.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Wed Feb 08, 2012 12:53 am

chithanh wrote:Basically you can forget about operating a 5 GHz access point with a consumer card. Only cards intended for AP use will talk on 5 GHz channels before having received packets in that band.
Unless I can find an atheros card that ath_info can change the eepromed regdomain to GB?
(I'm assuming it will be difficult to find a wifi card with a regdomain set to anything other than the world domain).

Or where can I find a mini-pcie wifi card intended for AP use?
Top
s4e8
Guru
Guru
Posts: 311
Joined: Sat Jul 29, 2006 11:09 am

  • Quote

Post by s4e8 » Wed Feb 08, 2012 7:41 am

Bullet Dodger wrote: Unless I can find an atheros card that ath_info can change the eepromed regdomain to GB?
(I'm assuming it will be difficult to find a wifi card with a regdomain set to anything other than the world domain).
Or where can I find a mini-pcie wifi card intended for AP use?
Atheros linux drivers don't use kernel regdomain, it hard code it in the drivers.
For the 5G bands, there's only 2 profile (drivers/net/wireless/ath/regd.c):

Code: Select all

#define ATH9K_5GHZ_ALL          ATH9K_5GHZ_5150_5350, \
                                ATH9K_5GHZ_5470_5850

/* This one skips what we call "mid band" */
#define ATH9K_5GHZ_NO_MIDBAND   ATH9K_5GHZ_5150_5350, \
                                ATH9K_5GHZ_5725_5850
Top
turtles
Veteran
Veteran
User avatar
Posts: 1713
Joined: Fri Dec 31, 2004 7:30 am

  • Quote

Post by turtles » Sat Feb 11, 2012 11:33 pm

chithanh wrote:Basically you can forget about operating a 5 GHz access point with a consumer card. Only cards intended for AP use will talk on 5 GHz channels before having received packets in that band.
This is not about an access point. The problem here is the ath9k driver nolonger works for any ath9k cards since they decided to implement a new "feature" called hyper regulatory domain enforcement / compliance.
Older cards not manufactured for the country you are in will associate with an access point then at some point disassociate due to not being manufactured for the country according to this new feature.

[topic=890366]I ran into this problem just trying to use a card the normal way on my laptop [/topic] on newer than 2.6.37 kernels I believe.

My card works perfectly with older kernels or newer patched kernels only when the new regulatory feature is disabled. My card also has no issues with the newer kernels associating with an access point that is in the same country code as the card (CO or 00).

The solution to the problem is to remove the regulatory domain stuff from the kernel or use an older kernel.
Donate to Gentoo
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sun Feb 12, 2012 12:04 am

turtles wrote:
chithanh wrote:Basically you can forget about operating a 5 GHz access point with a consumer card. Only cards intended for AP use will talk on 5 GHz channels before having received packets in that band.
This is not about an access point.
This is entirely about an access point. The actual problem might be bigger than just setting up an access point, but the whole point of this thread is that I bought a wifi card in the UK with the intention of setting up an access point in the 5GHz band, with a card that is capable of transmitting on the 5GHz band in the unlicensed 5GHz band in the UK.

By changing the EEPROM setting I am not doing anything illegal, but I shouldn't have had to in the 1st place.
Last edited by Bullet Dodger on Sun Feb 12, 2012 4:05 am, edited 1 time in total.
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sun Feb 12, 2012 4:03 am

Ok,

I think I've gotten 1 step closer.
If you have a spare windows laptop download the EEPROM tool from here: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=491145
Don't forget to press F8 during boot and select disable driver singing enforcement.

I couldn't find the regdomain code for GB, so I went for debug (FF).
This makes hostapd go for Japan (JP) - Probably because it is the most unrestictive.
But I do have country_code=GB in /etc/hostapd/hostapd.conf
I wouldn't recommend any other regdomain than the 1 you are in unless you are prepared for a big fine.

Now I get:

Code: Select all

# cat /var/log/messages |grep ath
Feb 12 03:39:53 chronos kernel: [   17.809136] ath9k 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
Feb 12 03:39:53 chronos kernel: [   17.809154] ath9k 0000:02:00.0: setting latency timer to 64
Feb 12 03:39:53 chronos kernel: [   17.939585] ath: EEPROM regdomain: 0xff
Feb 12 03:39:53 chronos kernel: [   17.939591] ath: EEPROM indicates we should expect a direct regpair map
Feb 12 03:39:53 chronos kernel: [   17.939599] ath: Country alpha2 being used: JP
Feb 12 03:39:53 chronos kernel: [   17.939602] ath: Regpair used: 0xff
Feb 12 03:39:53 chronos kernel: [   17.979292] ieee80211 phy0: Selected rate control algorithm 'ath9k_rate_control'
Feb 12 03:39:53 chronos kernel: [   17.980915] Registered led device: ath9k-phy0
Feb 12 03:39:53 chronos kernel: [   17.980984] ath9k 0000:03:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
Feb 12 03:39:53 chronos kernel: [   17.981000] ath9k 0000:03:00.0: setting latency timer to 64
Feb 12 03:39:53 chronos kernel: [   18.031441] ath: EEPROM regdomain: 0x60
Feb 12 03:39:53 chronos kernel: [   18.031448] ath: EEPROM indicates we should expect a direct regpair map
Feb 12 03:39:53 chronos kernel: [   18.031456] ath: Country alpha2 being used: 00
Feb 12 03:39:53 chronos kernel: [   18.031461] ath: Regpair used: 0x60
Feb 12 03:39:53 chronos kernel: [   18.034858] ieee80211 phy1: Selected rate control algorithm 'ath9k_rate_control'
Feb 12 03:39:53 chronos kernel: [   18.040338] Registered led device: ath9k-phy1

# iw phy phy0 info
                Frequencies:
                        * 5180 MHz [36] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5240 MHz [48] (20.0 dBm)
                        * 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] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (23.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (23.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)
But when I set channel=36 in /etc/hostapd/hostapd.conf I get:

Code: Select all

# /etc/init.d/hostapd restart
 * Starting hostapd ...
Configuration file: /etc/hostapd/hostapd.conf
wlan1: IEEE 802.11 Configured channel (36) not found from the channel list of current mode (1) IEEE 802.11g
wlan1: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-1)
wlan1: Unable to setup interface.
rmdir[ctrl_interface]: No such file or directory
 * start-stop-daemon: failed to start `/usr/sbin/hostapd'                                                                                                                                                  [ !! ]
 * ERROR: hostapd failed to start
I have tried changing the line:
hw_mode=g
to
hw_mode=n
hw_mode=gn
and even commenting the line out
but neither work.

Could it be because the other wifi card is still a world (0x60) regdomain?
Why can't I get a 5GHz channel working?
Top
Bullet Dodger
Apprentice
Apprentice
Posts: 230
Joined: Sat Jul 16, 2005 12:56 pm

  • Quote

Post by Bullet Dodger » Sun Feb 12, 2012 1:46 pm

Ok, I have taken the other wifi card out and changed it's regdomain to FF.
While the card was out I tried to run hostapd with just the 1 card.
I found I needed the following line in /etc/hostapd/hostapd.conf:

Code: Select all

hw_mode=a
I was then able to start hostapd and connect from a laptop.

I'm now having trouble setting up 2 interfaces in hostapd.
The following will set up 1 ap.

Code: Select all

logger_syslog=-1
country_code=GB
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=1
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan0
ssid=test
channel=4
hw_mode=g
bridge=br0
driver=nl80211
## Enable wpa/wpa2
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
## IEEE 802.11n
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1]
And the following will set up an ap.

Code: Select all

logger_syslog=-1
country_code=GB
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=1
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan1
ssid=test
channel=44
hw_mode=a
bridge=br0
driver=nl80211
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
## IEEE 802.11n
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1]
ctrl_interface=/var/run/hostapd1
But when trying to setup 2 interfaces only 1 appears to work.
Using this config I can connect to test2, but there is no test1 to connect to.

Code: Select all


# sed -ne '/^[^#]/p' /etc/hostapd/hostapd.conf
logger_syslog=-1
country_code=GB
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=1
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
interface=wlan0
ssid=test1
channel=4
hw_mode=g
bridge=br0
driver=nl80211
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1]
interface=wlan1
ssid=test2
channel=44
hw_mode=a
bridge=br0
driver=nl80211
wpa=2
wpa_passphrase=password2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][TX-STBC][RX-STBC1]
ctrl_interface=/var/run/hostapd1
Top
Post Reply

27 posts
  • 1
  • 2
  • Next

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic