abperiasamy / rtl8812AU_8821AU_linux

rtl8812AU_8821AU linux kernel driver for AC1200 (801.11ac) Wireless Dual-Band USB Adapter
GNU General Public License v2.0
1.23k stars 434 forks source link

Unable to set regulatory domain with rtw_channel_plan (channels remain disabled) #292

Open iam-TJ opened 5 years ago

iam-TJ commented 5 years ago

Trying again with 0BDA:0811, now on a Raspberry Pi with Raspbian 9.8 (stretch) and kernel 4.14.98+ I've found it seems it is not possible to set the device's regulatory domain.

In U.K. so Europe and 13 2.4GHz 20MHz channels (ETSI1 according to include/rtw_mlme_ext.h) and tried setting rtw_channel_plan to 2, 38, and 66 but "iw list" reports channels 12-14 "disabled".

I've tried every permutation of the sequence of device insertion, module loading, parameter setting (modprobe or via sysfs) and not been able to find a reliable method to change it.

At the same time "iw reg get" reports the correct domain is set in-kernel:

  global
  country GB: DFS-ETSI
               (2402 - 2482 @ 40), (N/A, 20), {N/A)
               (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW
               (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW
               (5490 - 5710 @ 160), (N/A, 27), (0 ms), DFS
               (57000 - 66000 @ 2160), (N/A, 40), (N/A)

I had one occasion where setting via sysfs then removing and re-inserting the device appeared to do it and 'iw list' reported only channel 14 disabled - but since then I've not been able to replicate that!

Because the AP is using 40MHz channels and sometimes picks one of the disabled channels it causes the client to fail to detect the SSID (e.g: an hour ago the AP was using 9 + 5 and was detected. I checked again just now and it is now using 13 + 9 and the client cannot detect it)

iam-TJ commented 5 years ago

AP has just switched back to channels 9+5 and is seen by the client and connected successfully.

As part of my debugging I've been constantly checking the module parameters with:

for n in /sys/module/rtl8812au/parameters/*; do [ -f $n ] && echo "$n=$(cat $n)"; done

and noticed whilst channels 12-14 are still reported disabled and the AP is using channels 9+5 the rtw_channel is reporting 13 !