8.13.8 Change Regulatory Domain Settings
Kernel's Central Regulatory Domain Agent (CRDA) acts as the udev helper for the communication between the kernel and for regulatory compliance. CRDA is enabled by default on the reference platform. To enable it for other platforms, it must be selected on buildroot's package using the menuconfig:
Target Packages>Networking applications>crda
CRDA uses a database that specifies the channels which are to be used at
each country, with a restricting "World Regulatory Domain". This database is defined in
db.txt
file in the wireless-regdb
package. World
Regulatory Domain helps to apply some restrictions according to the country and the
device is configured to operate, even if the user used it in a country that does not
have these restrictions. For more details, see wireless.wiki.kernel.org/en/developers/Regulatory/CRDA#Using_iw_to_change_regulatory_domains.
Linux allows changing of the regulatory domains in compliance with worldwide regulatory restrictions, including the US FCC. In order to achieve this, this device always respects its programmed regulatory domain and a country code selection will enhance regulatory restrictions. This is in accordance with the FCC part 15 country code selection knowledge base publication number 594280. For example, if the device is programmed for operation in the US which allows operation on channels 1-11 on the 2.4 GHz band, and the user visits Japan which allows operation on channels 1-14 and the user changes the regulatory domain to JP, then the channel 12, 13 or 14 (CCK) cannot be used. However, if a device is programmed for operation in Japan and visits the US, selecting US as the regulatory domain will have channel 12-14 disabled.
The default database restricts channels 12 to 14 as listen only; therefore, use these channels for the AP mode. For example, the flag NO-IR must be removed.
- This is the world regulatory domain country 00: (2402 - 2472 @ 40), (20)
- Channel 12 - 13. (2457 - 2482 @ 20), (20), AUTO-BW
- Channel 14. Only JP enables this and for 802.11b only (2474 - 2494 @ 20), (20), NO-OFDM
- Channel 36 - 48 (5170 - 5250 @ 80), (20), NO-IR, AUTO-BW
- Channel 52 - 64 (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW
- Channel 100 - 144 (5490 - 5730 @ 160), (20), NO-IR, DFS
- Channel 149 - 165 (5735 - 5835 @ 80), (20), NO-IR
- IEEE 802.11ad (60GHz), channels 1..3 (57240 - 63720 @ 2160), (0)
Generating a New Regulatory Database Binary
- Open an already built buildroot.
- Go to
output/build/wireless-regdb-2017.03.07/
. - Change
db.tx
. - Build regdb using
make
command.This creates a new public key, and can be used to generate and sign a new
regulartory.bin
file. The user must install m2crypto Python® package to buildregdb # sudo apt-get install python-m2crypto
. - Copy the file to
output/build/crda-3.18/pubkeys/
. - Modify wireless-regdb package to
install the new key to the target as:
- Go to
wireless-regdb.mk
. - Edit
WIRELESS_REGDB_INSTALL_TARGET_CMDS
to copy the new key to the target folder.
- Go to
- Force rebuild and installation to
target for both crda and wireless-regdb by removing
.stamp_target_installed
,.stamp_built from output/build/crda-3.18
andwireless-regdb-2017.03.07
. - Rebuild buildroot.
regulatory.bin
can be
verified.# regdbdump /usr/lib/crda/regulatory.bin
Target packages > Networking applications -> wireless-regdb
The regulatory.db & regulatory.db.p7s files should be present in /lib/firmware/ folder in rootFS.