[bpi-r4] How to deal with self-managed regulatory?

Hello all,

i am unable to deal with “self-managed” mode on qcnfa765 ath11. Because of this, I am unable to set regulatory domain and start hostapd.

I am using Bookworm 12.6 with 6.9.0-main kernel from Franks repo. Hostapd is configured for hwmode=a, channel=0 (acs_survey) and ieee80211[n|d|h|ac]=1.

$ cat /etc/modprobe.d/cfg80211.conf 
options cfg80211 ieee80211_regdom=CZ

$ lspci
0000:01:00.0 Network controller: Qualcomm Technologies, Inc QCNFA765 Wireless Network Adapter (rev 01)

$ dmesg | grep ath
[    8.314235] systemd[1]: Started ntpsec-systemd-netif.path.
[    8.354268] systemd[1]: Started systemd-ask-password-console.path - Dispatch Password Requests to Console Directory Watch.
[    8.394240] systemd[1]: Started systemd-ask-password-wall.path - Forward Password Requests to Wall Directory Watch.
[    8.434209] systemd[1]: proc-sys-fs-binfmt_misc.automount - Arbitrary Executable File Formats File System Automount Point was skipped because of an unmet condition check (ConditionPathExists=/proc/sys/f.
[    8.664185] systemd[1]: Reached target paths.target - Path Units.
[    9.174461] systemd[1]: dev-hugepages.mount - Huge Pages File System was skipped because of an unmet condition check (ConditionPathExists=/sys/kernel/mm/hugepages).
[    9.384295] systemd[1]: auth-rpcgss-module.service - Kernel Module supporting RPCSEC_GSS was skipped because of an unmet condition check (ConditionPathExists=/etc/krb5.keytab).
[   26.607600] ath11k_pci 0000:01:00.0: vgaarb: pci_notify
[   26.612861] ath11k_pci 0000:01:00.0: assign IRQ: got 0
[   26.618218] ath11k_pci 0000:01:00.0: BAR 0 [mem 0x30200000-0x303fffff 64bit]: assigned
[   26.626193] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[   26.632473] ath11k_pci 0000:01:00.0: enabling bus mastering
[   26.920212] ath11k_pci 0000:01:00.0: MSI vectors: 32
[   26.925189] ath11k_pci 0000:01:00.0: wcn6855 hw2.0
[   91.519117] ath11k_pci 0000:01:00.0: vgaarb: pci_notify
[   91.569491] ath11k_pci 0000:01:00.0: chip_id 0x2 chip_family 0xb board_id 0xff soc_id 0x400c0200
[   91.578292] ath11k_pci 0000:01:00.0: fw_version 0x11090c35 fw_build_timestamp 2022-04-18 20:23 fw_build_id WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9

$ iw reg get
global
country CZ: 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)
        (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#0 (self-managed)
country na: DFS-UNSET
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 20), (N/A, 20), (N/A), PASSIVE-SCAN
        (5170 - 5330 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5735 - 5895 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5945 - 7125 @ 160), (N/A, 30), (N/A), AUTO-BW, PASSIVE-SCAN


$ tail /var/log/hostapd.log
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-3)
wlan0: interface state COUNTRY_UPDATE->DISABLED
wlan0: AP-DISABLED 

Manual set regulatory domain is ignored:

$ iw reg set ISO_3166-1_alpha-2
$ iw reg set CZ
$ iw reg get
global
country CZ: 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)
        (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#0 (self-managed)
country na: DFS-UNSET
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 20), (N/A, 20), (N/A), PASSIVE-SCAN
        (5170 - 5330 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5735 - 5895 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5945 - 7125 @ 160), (N/A, 30), (N/A), AUTO-BW, PASSIVE-SCAN

$ iw reg reload
$ iw reg get
global
country CZ: 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)
        (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#0 (self-managed)
country na: DFS-UNSET
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2482 @ 20), (N/A, 20), (N/A), PASSIVE-SCAN
        (5170 - 5330 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5735 - 5895 @ 160), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5945 - 7125 @ 160), (N/A, 30), (N/A), AUTO-BW, PASSIVE-SCAN

So there is no change of regulatory domain on phy0.

To be able to start hostapd, I have to scan all wireless networks, than “the driver itself choose and set-up” regulatory domain, and therefore hostapd acs survay finds a channel. But there is sometimes CZ, GB or FR:

$ service hostapd stop
$ iw wlan0 scan > /dev/null
$ iw reg get
global
country CZ: 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)
        (5945 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#0 (self-managed)
country CZ: DFS-ETSI
        (2402 - 2482 @ 40), (N/A, 20), (N/A)
        (5170 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5330 @ 80), (N/A, 23), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5490 - 5590 @ 80), (N/A, 30), (0 ms), DFS, AUTO-BW
        (5590 - 5650 @ 40), (N/A, 30), (600000 ms), DFS, AUTO-BW
        (5650 - 5730 @ 80), (N/A, 30), (0 ms), DFS, AUTO-BW
        (5735 - 5875 @ 80), (N/A, 14), (N/A), AUTO-BW

$ service hostapd start
$ tail /var/log/hostapd.log
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
wlan0: interface state COUNTRY_UPDATE->ACS
wlan0: ACS-STARTED 
wlan0: ACS-COMPLETED freq=5745 channel=149
wlan0: interface state ACS->HT_SCAN
wlan0: interface state HT_SCAN->ENABLED
wlan0: AP-ENABLED 

$ iwconfig wlan0
wlan0     IEEE 802.11  Mode:Master  Tx-Power=8 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

OK, it looks like no-one have the same issue. As I was not successfull with the root cause, I am running hostap started with my small script. Because there are many country codes around me set on wifi APs, I have configured channel=0 and using ACS scanning. It is working at this time. Will see if anyone will have the same issue in the near future and leave me message here or PM. :smiley:

Seems qcnfa765 needs something else to make it possible to switch region(translate needed):QCNFA765을 이용한 Wi-Fi 6 AP | Pusnow

Great, thanks @Stat_headcrabed for the link :+1: . I will take a look, make some tests, and leave here whenever solution will be verified.

1 Like