-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compex wle900vx (qca988x) support in Linux kernels > 5.6 #189
Comments
The latest kernel, as well as 5.11 still includes the above mentioned patch that is causing issues. Currently, both the stable and most recent LTS kernels include this -- making both unable to operate in AP mode on the 5GHz band without compiling the kernel or ath10k module ourselves with this commit reverted. The latest request to revert this patch can be found here. It would help if PC Engines could throw their weight behind this as numerous revert requests seem to just get ignored or lost in the shuffle. Does PC Engines have instructions to reset the firmware on these WLE900VX cards? |
@miczyg1 let's contact @michaelsteinmann and PC Engines directly, so we can move that item forward. |
I'm running into this exact issue. The most annoying thing is that |
For what it's worth, it seems like some distributions apply their own patches to the ath10k driver to give users the ability to choose whether to ignore the EEPROM's restrictive regdomain. For example, NixOS borrows a patch from OpenWRT to do this. If you're running that distro, you can add this to your config (warning, this'll cause nix to recompile the kernel so you might need to use a remote builder -- it took 7h15m to compile a kernel on my APU4D4 😅):
|
Glad to hear that this NixOS option helped! You might want to consider to build the configuration on another, more powerful NixOS system and then copy it using |
APU2 as kernel build machine - nice :) FWIW - these are the steps I've been using on Arch to compile the ath10k module with the above mentioned patch reverted.
This is reasonably quick and painless as it only builds the module and avoids the kernel compile. All of this is far from optimal however. A more suitable solution would be some documented steps from PCEngines allowing us to program the EEPROM with the regulatory domain where our device is operating. Perhaps this is unlikely though as it allows end users to break local laws and transmit with different power and frequency settings that what is locally allowed. Setting the Really, the patch should be reverted in the mainline kernel. The issue it was originally meant to fix has been solved in firmware (see above mailing list links). For some reason getting the ath10k maintainers' attention about this issue has proved next to impossible. |
I think this discussion is a bit shortsighted. The commit in question did only break 5GHz AP operation for a specific group of users, namely those who use the US regulatory domain. People in different (restrictive) regulatory domains faced the same issues before as well. I've been using a Compex WLE600VX card in my APU2 for 3 years or so. In order to get it working in the German regulatory domain, I've always had to recompile the Debian kernel with the following additional options to be able to set the card to my regulatory domain and use channels that require DFS: I've had to do this on kernel 4.9 (Debian Strech) and currently 4.19 (Debian Buster), so long before the commit in question was introduced. Other options would be to use distributions that already compile their kernels with these options set – to my knowledge VyOS does so. OpenWrt would be another option which simply disables the enforcement of the vendor-set regulatory domain on the driver level. Or you could take the OpenWrt patches and apply them to your own kernel builds (I personally don't do this since that would require refreshing the patches whenever the kernel source changes; the configuration changes above are easier to deal with when it comes to automating the build process). |
I found that although, with the options mentioned by @silentcreek, To get a Compex WLE600VX to work on APU2 with kernel v5.13 and Debian 11 Buster I had to modify wireless-regdb's |
Could you elaborate what your channel list looks like and which channel(s) you intended to use? It is important to know that the Linux kernel's default behavior when switching to a different regulatory domain than what is programmed in the eeprom is to intersect the allowed channels and transmit power levels. This means that if a specific channel is not allowed in the vendor's default regulatory domain, you won't be able to use it even after you switch to a different regulatory domain. But the options mentioned should allow you to use those channels that require DFS and are not usable in the default state. To give an example: My device defaults to the US regulatory domain (iirc), where channels 12 and 13 (2.4GHz band) cannot be used by wireless access points. I live in Germany, where they are allowed but even after switching to the German regulatory domain the kernel won't allow me to use those channels. So, no gain here. But what I gain by the changed kernel configuration is that I can now use channels that require DFS which are channels 52-140 of the 5GHz band here.
I have seen this approach in various places, but I would not recommend it because your access point will broadcast the regulatory domain setting. So, it is easy to determine for anyone in the vicinity of your access point that it is misconfigured, i.e. it broadcasts the world regulatory domain but uses channels that are not allowed in it. If you really want to use channels or transmit power levels that are disabled in the default regulatory domain but would be allowed in your local regulatory domain, then I would suggest to actually combine those two approaches, i.e. reconfigure the kernel to allow changes of the regulatory domain and the use of DFS and patch your regulatory domain so the default matches your local regulatory domain. Then hostapd will broadcast the correct country code and operate on the channels you wish. The other option would be to use the OpenWrt patch to disable the regulatory domain enforcement entirely. |
The current ath10k behaviour seems consistent with https://wireless.wiki.kernel.org/en/developers/regulatory/statement, in particular: Further, that document discusses
https://wireless.wiki.kernel.org/en/developers/regulatory has more info the on the regulatory considerations for wireless. I don't know the right solution to this. Is it for PC Engines to check the certification status of the cards, and offer to flash the regulatory domain? |
I don't think so. I don't even know how this would be supposed to work. First of all, PC Engines is not the manufacturer of the wifi chips we're talking about, Qualcomm and Compex are. If at all, I would see the responsibility with Compex. However, wifi certification includes things that the module manufacturer doesn't have a say in. Compex doesn't know if I attach some super high-gain antenna to their module nor can they ensure that I really don't use channels and transmission powers that are for indoor use only on an outdoor access point. So, in the end I think it is up to the user (in this case the integrator) to guarantee this. |
I'm sorry, I was wrong! I upgraded my APU2 from Debian 10 (Kernel 4.19) to Debian 11 (Kernel 5.10) a few days ago and have noticed that the kernel configuration options mentioned above are not sufficient anymore to get the 5GHz midband working on my Compex WLE600VX card. I had to revert the offending commit [ath: add support for special 0x0 regulatory domain], indeed, on top of the kernel configuration changes. OpenWrt's patch works as well, but since reverting the offending patch is less intrusive it should also require fewer adjustments whenever the kernel source changes. |
Our kernels, which include ath10k-ct patches (and optionally, ath10k-ct firmware) should work fine with WLE900VX and other ath10k radios in apu2 platforms. You can patch your own kernels too of course. |
had to go the but once it was done building, AP mode finally stopped being janky and i could get appropriate power output and channel usage! |
A revert to the commit causing this problem has been included in this kernel 5.18 PR. (CTRL-F "0x0" to find it). Kernels < 5.6 and > 5.17 shouldn't have this problem. This is probably worth including in the PC Engines documentation. |
Interesting. The change in question was also sent to the stable kernel mailing list, so it should end up in affected versions that are still in support, such as the longterm kernels 5.10 or 5.15, sooner or later. Nice! |
Great news. Finally, just in case someone needed. I've wrote small kernel module ath_regdm_patcher that uses kprobe to set country to US as before.
|
So, the commit Revert "ath: add support for special 0x0 regulatory domain" has indeed landed in the stable branches, such as 5.10.109, which will eventually make it to distributions relying on these kernel branches. Debian 11 (Bullseye) is based on kernel 5.10, for example, so you can expect this change to land in the next stable point release 11.4 in a few weeks (and maybe even before that). |
I can confirm I could set up hostapd on channel 36 on a WLE900VX card on Debian 11 with the latest kernel 5.10.113:
|
Closing as fixed in recent upstream kernel. |
Can anyone confirm this is fixed i n 5.15? Revert "ath: add support for special 0x0 regulatory domain" is in 5.15.32+ but we still see no 5.8 channels on WLE900VX (compared to working on 5.4-stable and 5.10-stable) |
@Gateworks i confirm.... nevertheless, even now with this fix, changing the country from default US is not possible!!! regulatory domaincountry_code=PA hostapd debug log shows: but iw reg get, does not change it to phy0 root@xxxxx:~# iw reg get phy#0 QCA9984, |
Apparently these cards are considered mis-programmed and thus require special handling that nobody wants to accept into the kernel. See OpenWrt's solution here: https://github.com/openwrt/openwrt/blob/master/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch |
pinning kernel version: https://nixos.wiki/wiki/Linux_kernel#Pinning_a_kernel_version using ath patch: pcengines/apu2-documentation#189 (comment)
Do you have procedure how to modify wireless-regdb's "db.txt" with my desired country code, then generate file regulatory.db? BTW, I don't have this file /lib/firmware/regulatory.db in my device at all, is it normal ? |
I now carry a kernel patch that adds a module parameter and is set to a default that suits me, but can be set at load-time with For some reason github refuses
|
Linux kernel v5.6 included a commit that effectively disables the ability to operate this card in AP mode on the 5GHz band -- unless the device is provisioned with settings specific to the region where it will operate.
There are ongoing discussions on the ath10k mailing list about this which can be reviewed for details. See here and here.
The country/regulatory domain for these devices seems to be set in firmware/EEPROM and I don't believe it is possible to override this in software.
Is PC Engines aware of this issue? Is there a way to reset or provision these cards so they are specific to my region (Canada in my case)?
It appears to be an open question whether or not this commit will be reverted -- thus solving the problem. It would help if PC Engines could add their support for this on the ath10k mailing list.
It would also be helpful to document this problem and any workarounds that may exist.
The text was updated successfully, but these errors were encountered: