Set country code for WCN3660B/Linaro-20.07

Hi @loic,

We are working on a product based on APQ8016E and using WCN3660B. We are using latest Linaro-20.07 release for our development.

We need to set different country codes for WIFI. How to achieve this?

When we get the WIFI country code using below command,

root@linaro-alip:/home/linaro/# iw reg get
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)

but when we are trying to set the same using, $ iw reg set , we are unable to set.

Can you please help here, how we can achieve this?

Regards,
Parth Y Shah

You probably need crda:

apt-get install crda

@loic, thanks for your prompt response.

I have installed the same, also set below rules,

/etc/udev/rules.d/regulatory.rules to allow the kernel to communicate with userspace:
KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"

but still not able to set other county code.

Do we need to enable some CONFIGS from the kernel or any other settings we need to do over here?

Regards.

@loic, further I tried to export COUNTRY variable to US and tried to set the county code using crda but it throws below error.

root@linaro-alip:/home/linaro#  export COUNTRY=US
root@linaro-alip:/home/linaro# 
root@linaro-alip:/home/linaro# crda 
Failed to set regulatory domain: -10

@loic any update over here?

On latest release:

root@linaro-alip:~# iw reg set US
root@linaro-alip:~# iw reg get
global
country US: DFS-FCC
(2400 - 2483 @ 40), (N/A, 30), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5350 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 23), (0 ms), DFS
(5730 - 5850 @ 80), (N/A, 30), (N/A)
(57240 - 71000 @ 2160), (N/A, 40), (N/A)

Thanks @loic, we are also now able to change this, We have installed latest debian package for wireless-regdb.