Installing kmod-ath9k-htc makes impossible to change country code

Hello. I have TP-Link TL-WR1043ND v2 with the current 22.03.5 release. There was no problems before, I could change country code and use 13 channel (it's legal in my country).
Recently, I have get Alfa AWUS036NHA usb adapter (AR9271 chip), which is supported by kmod-ath9k-htc.
And after reboot, I found out that 13 channel is no more visible at main radio0 device. Country code changed to '98'. The new radio1 device (that AR9271 usb adapter) can see wireless networks at 13 channel. But the main wireless device of router - no.
This is before installing kmod-ath9k-htc:

root@openwrt:/# iw reg get
global
country TW: 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
(5725 - 5850 @ 80), (N/A, 30), (N/A)
(57000 - 66000 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
(902 - 904 @ 2), (N/A, 30), (N/A)
(904 - 920 @ 16), (N/A, 30), (N/A)
(920 - 928 @ 8), (N/A, 30), (N/A)
(2400 - 2472 @ 40), (N/A, 30), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
(57240 - 71000 @ 2160), (N/A, 40), (N/A)

and this is after:

root@router:/# iw reg get
global
country 98: DFS-UNSET
(2400 - 2472 @ 40), (N/A, 20), (N/A)
(5150 - 5250 @ 100), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
(5250 - 5350 @ 100), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
(5725 - 5730 @ 5), (N/A, 23), (0 ms), NO-OUTDOOR, DFS
(5730 - 5850 @ 80), (N/A, 23), (N/A), NO-OUTDOOR
(5925 - 6425 @ 160), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
(57240 - 71000 @ 2160), (N/A, 40), (N/A)

phy#1
country GB: 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 - 5730 @ 160), (N/A, 26), (0 ms), DFS
(5725 - 5850 @ 80), (N/A, 23), (N/A), NO-OUTDOOR
(5925 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
(57000 - 71000 @ 2160), (N/A, 40), (N/A)

phy#0
country US: DFS-FCC
(902 - 904 @ 2), (N/A, 30), (N/A)
(904 - 920 @ 16), (N/A, 30), (N/A)
(920 - 928 @ 8), (N/A, 30), (N/A)
(2400 - 2472 @ 40), (N/A, 30), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
(57240 - 71000 @ 2160), (N/A, 40), (N/A)

Why? Is this a bug?

Here is the screenshots. First is wlan1 (radio1 / Alfa usb adapter), the second is wlan0 (radio0 / main router wifi device).


Besides,

root@router:/0# opkg download ath9k-htc-firmware
Collected errors:
* opkg_download_pkg: Package ath9k-htc-firmware is not available from any configured src.
* opkg_download_cmd: Failed to download ath9k-htc-firmware.

where is ath9k-htc-firmware package? It was recently in repos.

it's there, forgot to do opkg update ?
https://downloads.openwrt.org/releases/22.03.5/packages/mips_24kc/base/

Oh, Thanks!

In recent releases, multiple radios run on one instance of wpad. It has problems if you don't set all the radios to the same country.

1 Like

I can't do that. When I connect usb adapter to router - on both devices it sets '98' country. But actual country settings it applies to each device separately. As far as I can see, main radio device is working with 'US' country, and usb adapter - with 'GB'; seems to be, both values are taken from EEPROMs of each devices. And, respectively, main radio doesn't see 12,13 channel stations any more, and at usb adapter - wrong tx power values.
How to fix that?

Bug #13070 is opened. I have posted temporary workaround there.