Qualcomm Atheros Device can't find channel 13 WiFi (Ubuntu 16.04.2)
So I have the specific WLAN adapter as mentioned above (168c:0042 rev 31) but I can't find my WiFi in the list of WiFi networks if the channel is set to 13 (If I set it to < 13, I can find it but there so many WiFi networks on the other channels and they just mess up with mine and download speed gets really slow). I have set my region to my corresponding region using sudo iw reg set
(I am fairly sure channel 13 is supported) but the problem persists. I was wondering if the source of the problem are any drivers (currently using ath10k).
EDIT 1:
Output of iw list | grep Freq -A14
:
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
--
Frequencies:
* 5180 MHz [36] (20.0 dBm) (no IR)
* 5200 MHz [40] (20.0 dBm) (no IR)
* 5220 MHz [44] (20.0 dBm) (no IR)
* 5240 MHz [48] (20.0 dBm) (no IR)
* 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
DFS state: usable (for 103 sec)
DFS CAC time: 60000 ms
* 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
DFS state: usable (for 103 sec)
DFS CAC time: 60000 ms
* 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
DFS state: usable (for 103 sec)
DFS CAC time: 60000 ms
* 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
EDIT 2:
Output of iw reg get
:
country GR: DFS-ETSI
(2402 - 2482 @ 40), (N/A, 20), (N/A)
(5170 - 5250 @ 80), (N/A, 20), (N/A)
(5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS
(5490 - 5710 @ 160), (N/A, 27), (0 ms), DFS
(57000 - 66000 @ 2160), (N/A, 40), (N/A)
EDIT 3:
Output of dmesg | grep ath
:
[ 1.960190] ath10k_pci 0000:03:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[ 2.252806] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/pre-cal-pci-0000:03:00.0.bin failed with error -2
[ 2.252815] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/cal-pci-0000:03:00.0.bin failed with error -2
[ 2.269809] ath10k_pci 0000:03:00.0: qca9377 hw1.1 target 0x05020001 chip_id 0x003821ff sub 11ad:08a6
[ 2.269811] ath10k_pci 0000:03:00.0: kconfig debug 0 debugfs 1 tracing 1 dfs 0 testmode 0
[ 2.270128] ath10k_pci 0000:03:00.0: firmware ver WLAN.TF.1.0-00267-1 api 5 features ignore-otp crc32 79cea2c7
[ 2.338522] ath10k_pci 0000:03:00.0: board_file api 2 bmi_id N/A crc32 93da0176
[ 4.117342] ath10k_pci 0000:03:00.0: htt-ver 3.1 wmi-op 4 htt-op 3 cal otp max-sta 32 raw 0 hwcrypto 1
[ 4.123902] ath: EEPROM regdomain: 0x69
[ 4.123903] ath: EEPROM indicates we should expect a direct regpair map
[ 4.123905] ath: Country alpha2 being used: 00
[ 4.123905] ath: Regpair used: 0x69
[ 4.128498] ath10k_pci 0000:03:00.0 wlp3s0: renamed from wlan0
You need to enable source code repositories in Software Sources and make sure build-essential is installed along with kernel header files. You will also need Secure Boot disabled in BIOS
sudo apt-get install build-essential linux-headers-generic
Then we can download the kernel source code
apt-get source linux-image-$(uname -r)
Then we can navigate to the ath folder
cd linux-hwe-4.8.0/drivers/net/wireless/ath
Open the file we need to change with gedit
gedit regd.c
Got to lines 235-237 and change
case 0x66:
case 0x69:
return &ath_world_regdom_66_69;
To
case 0x66:
return &ath_world_regdom_66_69;
case 0x69:
return &ath_world_regdom_60_61_62;
Make sure the indentation matches, case should be one TAB from left and return should be 2 TAB from left then save the file and exit gedit. Then we can compile the module with
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
It should compile if the changes were made correctly. Then we can make a copy of the original module
sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko.bak
Then we can copy the new module to the kernel
sudo cp ath.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko
Reboot
This will need to be redone after a kernel update and you will need to
cd linux-hwe-4.8.0/drivers/net/wireless/ath
make -C /lib/modules/$(uname -r)/build M=$(pwd) clean
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko.bak
sudo cp ath.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ath/ath.ko
And reboot to have channel 13 in the new kernel
Reference: https://forums.linuxmint.com/viewtopic.php?f=53&t=236357