Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to set WiFi regulatory domain in Buster?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
renne
Posts: 22
Joined: 2019-04-01 09:17

How to set WiFi regulatory domain in Buster?

#1 Post by renne »

Hi,

we have a freshly installed Buster with automatic updates enabled and can't set the WiFi regulatory domain.

WLAN cards: 2x Compex WLE900VX (qca9880/ath10k) WLAN cards.

What doesn't work:
/etc/modprobe.d/cfg80211.conf:

Code: Select all

options cfg80211 ieee80211_regdom=DE
/etc/hostapd/hostapd.conf:

Code: Select all

...
ieee80211d=1
country_code=DE
...

Code: Select all

root@cloud:/# export COUNTRY=DE; /sbin/crda 
Failed to set regulatory domain: -7

Code: Select all

root@cloud:/# iw reg set DE && iw reg get
global
country 98: DFS-UNSET
	(2402 - 2472 @ 40), (N/A, 20), (N/A)
	(5170 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5330 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5490 - 5725 @ 160), (N/A, 23), (0 ms), DFS
	(5725 - 5730 @ 5), (N/A, 13), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 13), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

phy#1
country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

Code: Select all

renne@cloud:/lib/firmware/ath10k/QCA988X/hw2.0$ uname -a
Linux cloud 4.19.0-4-amd64 #1 SMP Debian 4.19.28-2 (2019-03-15) x86_64 GNU/Linux

Code: Select all

renne@cloud:~$ ls /lib/firmware/ath10k/QCA988X/hw2.0/
board.bin  firmware-4.bin  firmware-5.bin
Thanx for any hint :-)
Last edited by renne on 2019-04-02 10:36, edited 3 times in total.

TonyT
Posts: 575
Joined: 2006-09-04 11:57

Re: How to set WiFi regulatory domain in Buster?

#2 Post by TonyT »

It should get the country code from the router automatically. AFAIK you must not be connected to the wlan to change the country code.

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#3 Post by renne »

The Debian Buster installation is the access point -> hostapd. :wink:

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: How to set WiFi regulatory domain in Buster?

#4 Post by Head_on_a_Stick »

Is CRDA called by the relevant module?

Code: Select all

# dmesg | grep cfg80211
I am presuming that you have already installed the crda package (and rebooted afterwards).
deadbang

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#5 Post by renne »

Yes. it is installed and rebooted.

renne@cloud:~$ sudo grep -i crda /var/log/syslog:

Code: Select all

Apr  1 07:46:59 cloud systemd-udevd[309]: Process '/sbin/crda' failed with exit code 249.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: How to set WiFi regulatory domain in Buster?

#6 Post by Head_on_a_Stick »

deadbang

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#7 Post by renne »

Without the Compex WLE900VX setting the country code with iw works:

Code: Select all

renne@cloud:~$ sudo iw reg get && sudo modprobe ath10k_pci && sudo iw reg set DE && sudo iw reg get
[sudo] password for renne: 
global
country 00: DFS-UNSET
	(2402 - 2472 @ 40), (6, 20), (N/A)
	(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
	(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
	(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
	(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
	(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
	(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
	(57240 - 63720 @ 2160), (N/A, 0), (N/A)

global
country DE: DFS-ETSI
	(2400 - 2483 @ 40), (N/A, 20), (N/A)
	(5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
	(5725 - 5875 @ 80), (N/A, 13), (N/A)
	(57000 - 66000 @ 2160), (N/A, 40), (N/A)
With a Compex WLE900VX setting the country fails:

Code: Select all

renne@cloud:~$ sudo iw reg get && sudo modprobe ath10k_pci && sudo iw reg set DE && sudo iw reg get
[sudo] password for renne: 
global
country 98: DFS-UNSET
	(2402 - 2472 @ 40), (N/A, 20), (N/A)
	(5170 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5330 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5490 - 5725 @ 160), (N/A, 23), (0 ms), DFS
	(5725 - 5730 @ 5), (N/A, 13), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 13), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

global
country 98: DFS-UNSET
	(2402 - 2472 @ 40), (N/A, 20), (N/A)
	(5170 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
	(5250 - 5330 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
	(5490 - 5725 @ 160), (N/A, 23), (0 ms), DFS
	(5725 - 5730 @ 5), (N/A, 13), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 13), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
	(2402 - 2472 @ 40), (N/A, 30), (N/A)
	(5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
	(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
	(5735 - 5835 @ 80), (N/A, 30), (N/A)
	(57240 - 63720 @ 2160), (N/A, 40), (N/A)
The Compex WLE900VX keeps country code US.

I also found these firmware error messages in syslog:

Code: Select all

renne@cloud:~$ sudo dmesg | grep ath   
[    4.630113] ath10k_pci 0000:04:00.0: enabling device (0000 -> 0002)
[    4.630548] ath10k_pci 0000:04:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[    4.803687] ath10k_pci 0000:04:00.0: firmware: failed to load ath10k/pre-cal-pci-0000:04:00.0.bin (-2)
[    4.803700] ath10k_pci 0000:04:00.0: firmware: failed to load ath10k/cal-pci-0000:04:00.0.bin (-2)
[    4.803872] ath10k_pci 0000:04:00.0: firmware: failed to load ath10k/QCA988X/hw2.0/firmware-6.bin (-2)
[    4.804994] ath10k_pci 0000:04:00.0: firmware: direct-loading firmware ath10k/QCA988X/hw2.0/firmware-5.bin
[    4.804999] ath10k_pci 0000:04:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
[    4.805000] ath10k_pci 0000:04:00.0: kconfig debug 0 debugfs 0 tracing 0 dfs 0 testmode 0
[    4.805147] ath10k_pci 0000:04:00.0: firmware ver 10.2.4-1.0-00041 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 f43fa422
[    4.840158] ath10k_pci 0000:04:00.0: firmware: failed to load ath10k/QCA988X/hw2.0/board-2.bin (-2)
[    4.840338] ath10k_pci 0000:04:00.0: firmware: direct-loading firmware ath10k/QCA988X/hw2.0/board.bin
[    4.840343] ath10k_pci 0000:04:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[    5.988575] ath10k_pci 0000:04:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
[    6.067999] ath: EEPROM regdomain: 0x0
[    6.068000] ath: EEPROM indicates default country code should be used
[    6.068000] ath: doing EEPROM country->regdmn map search
[    6.068001] ath: country maps to regdmn code: 0x3a
[    6.068002] ath: Country alpha2 being used: US
[    6.068002] ath: Regpair used: 0x3a
[    6.078078] ath10k_pci 0000:04:00.0 wlp4s0: renamed from wlan0
[ 5099.420780] ath10k_pci 0000:04:00.0: pdev param 0 not supported by firmware
Any idea?

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#8 Post by renne »

Is the country code hard-coded to US in hardware like described here?

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#9 Post by renne »

Comment from Compex support:
for the regulatory domain issue, please update your kernel by edited /drivers/net/wireless/ath/regd.c with change the following "reg->country_code = CTRY_UNITED_STATES;" to your country accordingly since this is an initial limitations of the card from Linux operating system itself.

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#10 Post by renne »

If the ath10k module cannot read the country code from the ACPI table it locks to country code US. :(

See bug report.

renne
Posts: 22
Joined: 2019-04-01 09:17

Re: How to set WiFi regulatory domain in Buster?

#11 Post by renne »

Correction:

The country code is not read from ACPI but from the EEPROM of the WiFi-card (0x0 "World Regulatory Domain" by default).

MrGlasspoole
Posts: 27
Joined: 2012-12-22 21:34

Re: How to set WiFi regulatory domain in Buster?

#12 Post by MrGlasspoole »

I also have problems with the Compex WLE900VX.
This is correct:

Code: Select all

~$ iw reg get
global
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (5725 - 5875 @ 80), (N/A, 13), (N/A)
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)
But 'iw list' shows everything as no-IR or disabled.

And there is no '/drivers/net/wireless/ath/regd.c' on the system?

Post Reply