US 6GHz: How to proceed

Hi, I’m starting this thread to figure out how to deal with the (IMO ludicrous) US regulatory restrictions for 6GHz emissions. 6GHz devices are growing in popularity, and those that do not use an internal (Qualcomm) regulatory database, such as Mediatek, Airoha, etc., are unable to bring up an access point on the 6GHz band with OpenWrt’s standard regdb. This will become a larger issue as right now, 6GHz is disabled on vanilla OpenWrt builds and can only be re-enabled with regdb patches, which may end up violating emission laws as they currently stand. There are 2 issues that seem to be present:

  1. Different channel widths are limited to different Power Spectral Densities (PSD). See https://lore.kernel.org/wireless-regdb/CAPRryQp6j4UKvLZCkMAuQdaxepMBETQUJ1eNULJSh3ZWXC0f5Q@mail.gmail.com/ for more details.
  2. 6GHz does not require a license and does not require use of an Automatic Frequency Coordinator (AFC) only when used indoors. https://www.federalregister.gov/d/2020-11236/p-61. Outdoor use is subject to communicating with an AFC, and is outside the scope of this discussion.

It appears that the upstream regdb maintainers have no interest in solving this problem, so I think it must be in the hands of OpenWrt. The path forward I see is adding an intermediate state for configuring/enabling 6GHz access points and clients in the US.

  1. Apply a patch to the regdb that removes NO-IR from 6GHz in US.
  2. Add an indoor-use-only option to uci/luci that must be manually selected, to ensure that the responsibility lives with the device operator. If this option is not present, the AP should not come up (and appropriate logging/warnings should be made to the user)
  3. Add a check that verifies PSD requirements are met for both AP and client mode (since they’re different). I expect that AP+STA would be subject to STA regulations

Other references:

Thoughts?

Upstream hasn't looked at this much due to having to support old kernels. Openwrt could patch regdb; however, if they mess this up the FCC may fine them.

The only solution I see is to have an optional patched wireless-regdb-6Ghz.apk in the repo. US users would install openwrt and then have to install it. That should be enough to cover openwrt legally as it would not be included in the default install.

Short term solution is to apply stangri's patch to wireless-regdb found here:

Just build wireless-regdb. Every single update, you must reinstall your patched wireless-regdb apk.

The "easy way" would limit performance:

  • Enabling 6GHz... limited to an EIRP of 12dBm to respect PSD limits in 20MHz operation (since currently, frequency-dependent PSD can't be specified in regdb)
(5925 - 7125 @ 320), (12), NO-OUTDOOR

The proper solution would require significant patching:

  • splitting up NO-IR back into PASSIVE-SCAN (for STA mode) and NO-IBSS
  • adding a new property into wireless-regdb to mark LPI ranges
  • cfg80211 supporting said changes
  • mac80211 and the rest of the other wireless drivers properly reporting their PSD (it has been broken in the past)

"Why doesn't 6Ghz work?!?" "Why does 6Ghz suck with openwrt?!?" + "Why does MLO suck with openwrt?!?"

IMO first step would be to patch away NO-IR at same measly power levels, so that at least people do not think they got broken devices.
Also 5ghz has similar problem - AP mode should permit more power than STA but no way to reflect that in regdb.

(Recommendation for OpenWRT AP - #21 by ledeweb)
(https://www.michaelstinkerings.org/the-mt7922-6ghz-debacle-why-linux-users-cant-use-wifi-6e-and-how-i-fixed-it/)

git clone https://git.kernel.org/pub/scm/linux/kernel/git/wens/wireless-regdb.git
cd wireless-regdb
# edit db.txt: remove NO-IR from the US 6GHz line
python3 db2fw.py regulatory.db db.txt
sudo cp /usr/lib/firmware/regulatory.db /usr/lib/firmware/regulatory.db.bak
sudo cp regulatory.db /usr/lib/firmware/regulatory.db

And reboot. I guess this also works and appears way quicker than generating an .apk. Edit db.txt if you want more than just removing "NO-IR:"

https://github.com/mossdef-org/w1700k-wireless-regdb/releases might be worth looking into, not sure it works for anything else than w1700k, but it should.

Direct edit of regdb works as well and easier:

$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/wens/wireless-regdb.git
$ cd wireless-regdb
#### edit db.txt: remove NO-IR from the US 6GHz line
$ python3 db2fw.py regulatory.db db.txt

### on device backup
$ sudo mv /lib/firmware/regulatory.db /lib/firmware/regulatory.db.bak
### send new regdb
$ scp -O regulatory.db root@192.168.x.x:/lib/firmware/
### reboot 

Wow thanks! I been casually looking for instructions on how to do easily edit regdb for around a year. That was so simple even a monkey could do it.

Is there also an easy way to package this up in an apk? It would be great if we had a simple USA-reg-db-fix.apk one could add to an existing openwrt install via the package manager tab in luci for the not to technical folks, like me. Wouldn't even need a terminal at that point. I mean, I'm personally fine with using the terminal to get stuff done but I know a lot of folks are not.

My recommendation was to have an optional, patched regdb apk in the repo; however, given the open hostility of the current FCC, I would now advise against that. Users should build the apk or direct edit regdb (they are doing the same thing).

Going to mark this as the solution for now since it's unlikely the regdb will change upstream...