There was a somewhat similar thread recently: https://forums.opensuse.org/showthread.php/518471-Set-wireless-regulatory-domain. But that one was about Tumbleweed and the situation was also a bit different, so I decided to start another one.
I’m using the following USB wifi adapter:
$lsusb
Bus 001 Device 003: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
I can’t find a way to have wireless regulatory domain setting persist across reboots. When my system starts up, “iw reg get” shows the following:
global
country CN: DFS-FCC
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 59400 @ 2160), (N/A, 28), (N/A)
(59400 - 63720 @ 2160), (N/A, 44), (N/A)
(63720 - 65880 @ 2160), (N/A, 28), (N/A)
phy#0
country CN: DFS-FCC
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 59400 @ 2160), (N/A, 28), (N/A)
(59400 - 63720 @ 2160), (N/A, 44), (N/A)
(63720 - 65880 @ 2160), (N/A, 28), (N/A)
I can successfully run “iw reg set EE” and this changes the setting of phy#0 from CN to EE, but after reboot the original situation is restored.
I have tried two ways
Some articles I have found suggest creating a file /etc/default/crda, containing:
REGDOMAIN=EE
I have tried that, and it does not help. Looking at journal messages during boot, I see no difference from situation where /etc/default/crda does not exist.
Then I tried to add a parameter to cfg80211 module in /etc/modprobe.d/99-local.conf
options cfg80211 ieee80211_regdom=EE
This at least has some effect. Looking at journal messages during boot, I can see that regulatory domain gets set to EE but then immediately it is changed back to CN:
Jul 20 07:28:41 susa kernel: cfg80211: Calling CRDA to update world regulatory domain
Jul 20 07:28:41 susa kernel: cfg80211: Calling CRDA to update world regulatory domain
Jul 20 07:28:41 susa kernel: cfg80211: World regulatory domain updated:
Jul 20 07:28:41 susa kernel: cfg80211: DFS Master region: unset
Jul 20 07:28:41 susa kernel: cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 20 07:28:41 susa kernel: cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 20 07:28:41 susa kernel: cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Jul 20 07:28:41 susa kernel: cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: Calling CRDA for country: EE
Jul 20 07:28:41 susa kernel: cfg80211: Regulatory domain changed to country: EE
Jul 20 07:28:41 susa kernel: cfg80211: DFS Master region: ETSI
Jul 20 07:28:41 susa kernel: cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 20 07:28:41 susa kernel: cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:41 susa kernel: cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 20 07:28:41 susa kernel: cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Jul 20 07:28:41 susa kernel: cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Jul 20 07:28:42 susa kernel: ath9k_htc 1-5:1.0: ath9k_htc: HTC initialized with 33 credits
Jul 20 07:28:43 susa kernel: ath9k_htc 1-5:1.0: ath9k_htc: FW Version: 1.3
Jul 20 07:28:43 susa kernel: ath9k_htc 1-5:1.0: FW RMW support: Off
Jul 20 07:28:43 susa kernel: ath: EEPROM regdomain: 0x809c
Jul 20 07:28:43 susa kernel: ath: EEPROM indicates we should expect a country code
Jul 20 07:28:43 susa kernel: ath: doing EEPROM country->regdmn map search
Jul 20 07:28:43 susa kernel: ath: country maps to regdmn code: 0x52
Jul 20 07:28:43 susa kernel: ath: Country alpha2 being used: CN
Jul 20 07:28:43 susa kernel: ath: Regpair used: 0x52
Jul 20 07:28:43 susa systemd[1]: Starting system-systemd\x2drfkill.slice.
Jul 20 07:28:43 susa systemd[1]: Created slice system-systemd\x2drfkill.slice.
Jul 20 07:28:43 susa kernel: ieee80211 phy0: Atheros AR9271 Rev:1
Jul 20 07:28:43 susa kernel: cfg80211: Calling CRDA for country: CN
Jul 20 07:28:43 susa kernel: ath9k_htc 1-5:1.0 wlan1: renamed from wlan0
Jul 20 07:28:43 susa kernel: cfg80211: Current regulatory domain intersected:
Jul 20 07:28:43 susa kernel: cfg80211: DFS Master region: unset
Jul 20 07:28:43 susa kernel: cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Jul 20 07:28:43 susa kernel: cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:43 susa kernel: cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Jul 20 07:28:43 susa kernel: cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Jul 20 07:28:43 susa kernel: cfg80211: (57240000 KHz - 59400000 KHz @ 2160000 KHz), (N/A, 2800 mBm), (N/A)
Jul 20 07:28:43 susa kernel: cfg80211: (59400000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Jul 20 07:28:43 susa kernel: cfg80211: (63720000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 2800 mBm), (N/A)
So, the end result is still the same - regulatory domain is wrong.
The following command that I have tried for troubleshooting also results in error:
#COUNTRY=EE /sbin/crda
Failed to set regulatory domain: -7
Any suggestions in how to resolve this?