Setting the country code within the hostapd config doesn’t work on Debian bookworm or Ubuntu 22 LTS. Nor does using iw reg set US
without a workaround. The trick is to remove all kernel modules for the card, then use iw reg set US
and reload the modules.
The card worked fine under Debian 11. I have a hunch things broke when Linux moved away from the CRDA package, but I’m not a kernel developer. If you know what may have happened, please let me know.
Some more backstory: After upgrading my home server from Debian 11 to Debian 12, my QWA-AC2600 would no longer start as an access point using hostapd. Debian bookworm comes with a 6.x kernel (currently 6.1), and I had the same behavior on Ubuntu 22 LTS. Both showed “no IR” in the iw list
output for channels we should be allowed to use. No IR means we “cannot initiate radiation first”.
Frequencies:
* 5180 MHz [36] (23.0 dBm) (no IR)
* 5200 MHz [40] (23.0 dBm) (no IR)
* 5220 MHz [44] (23.0 dBm) (no IR)
* 5240 MHz [48] (23.0 dBm) (no IR)
* 5260 MHz [52] (24.0 dBm) (no IR, radar detection)
* 5280 MHz [56] (24.0 dBm) (no IR, radar detection)
* 5300 MHz [60] (24.0 dBm) (no IR, radar detection)
* 5320 MHz [64] (24.0 dBm) (no IR, radar detection)
* 5500 MHz [100] (disabled)
* 5520 MHz [104] (disabled)
* 5540 MHz [108] (disabled)
* 5560 MHz [112] (disabled)
* 5580 MHz [116] (disabled)
* 5600 MHz [120] (disabled)
* 5620 MHz [124] (disabled)
* 5640 MHz [128] (disabled)
* 5660 MHz [132] (disabled)
* 5680 MHz [136] (disabled)
* 5700 MHz [140] (disabled)
* 5720 MHz [144] (disabled)
* 5745 MHz [149] (30.0 dBm) (no IR)
* 5765 MHz [153] (30.0 dBm) (no IR)
* 5785 MHz [157] (30.0 dBm) (no IR)
* 5805 MHz [161] (30.0 dBm) (no IR)
* 5825 MHz [165] (30.0 dBm) (no IR)
* 5845 MHz [169] (27.0 dBm) (no IR)
* 5865 MHz [173] (disabled)
I contacted QNAP but they didn’t know and didn’t have a card to test with. Eventually I stumbled across a post (maybe on Server Fault) that suggested removing kernel modules before setting the regulatory domain. And that worked!
Here’s a shell script to take care of it:
#!/bin/bash
rmmod ath10k_pci
rmmod ath10k_core
rmmod ath
iw reg set US
modprobe ath10k_pci
lsmod | grep ath
# let the device and the kernel settle
sleep 5
# bring up interface and set static IP
ifup wlp8s0
systemctl restart hostapd
After the workaround, our iw list
output looks much better.
Frequencies:
* 5180 MHz [36] (23.0 dBm)
* 5200 MHz [40] (23.0 dBm)
* 5220 MHz [44] (23.0 dBm)
* 5240 MHz [48] (23.0 dBm)
* 5260 MHz [52] (24.0 dBm) (no IR, radar detection)
* 5280 MHz [56] (24.0 dBm) (no IR, radar detection)
* 5300 MHz [60] (24.0 dBm) (no IR, radar detection)
* 5320 MHz [64] (24.0 dBm) (no IR, radar detection)
* 5500 MHz [100] (24.0 dBm) (no IR, radar detection)
* 5520 MHz [104] (24.0 dBm) (no IR, radar detection)
* 5540 MHz [108] (24.0 dBm) (no IR, radar detection)
* 5560 MHz [112] (24.0 dBm) (no IR, radar detection)
* 5580 MHz [116] (24.0 dBm) (no IR, radar detection)
* 5600 MHz [120] (24.0 dBm) (no IR, radar detection)
* 5620 MHz [124] (24.0 dBm) (no IR, radar detection)
* 5640 MHz [128] (24.0 dBm) (no IR, radar detection)
* 5660 MHz [132] (24.0 dBm) (no IR, radar detection)
* 5680 MHz [136] (24.0 dBm) (no IR, radar detection)
* 5700 MHz [140] (24.0 dBm) (no IR, radar detection)
* 5720 MHz [144] (24.0 dBm) (radar detection)
* 5745 MHz [149] (30.0 dBm)
* 5765 MHz [153] (30.0 dBm)
* 5785 MHz [157] (30.0 dBm)
* 5805 MHz [161] (30.0 dBm)
* 5825 MHz [165] (30.0 dBm)
* 5845 MHz [169] (27.0 dBm) (no IR)
* 5865 MHz [173] (27.0 dBm) (no IR)
We can have a 5Ghz access point again!