Set the WiFi regulatory domain properly on the Elipsa

No idea how restrictive the defaults are, but stuff is weird in the 5G
band, so, do it right.
This commit is contained in:
NiLuJe
2021-08-09 20:56:00 +02:00
parent 1e9346aec6
commit a91ba05e34

View File

@@ -33,11 +33,23 @@ fi
usleep 250000
# NOTE: Used to be exported in WIFI_MODULE_PATH before FW 4.23
if ! grep -q "${WIFI_MODULE}" "/proc/modules"; then
# Set the Wi-Fi regulatory domain properly if necessary...
WIFI_COUNTRY_CODE_PARM=""
if grep -q "^WifiRegulatoryDomain=" "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf"; then
WIFI_COUNTRY_CODE="$(grep "^WifiRegulatoryDomain=" "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf" | cut -d '=' -f2)"
case "${WIFI_MODULE}" in
"8821cs")
WIFI_COUNTRY_CODE_PARM="rtw_country_code=${WIFI_COUNTRY_CODE}"
;;
esac
fi
if [ -e "/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko" ]; then
insmod "/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko"
insmod "/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko" "${WIFI_COUNTRY_CODE_PARM}"
elif [ -e "/drivers/${PLATFORM}/${WIFI_MODULE}.ko" ]; then
# NOTE: Modules are unsorted on Mk. 8
insmod "/drivers/${PLATFORM}/${WIFI_MODULE}.ko"
insmod "/drivers/${PLATFORM}/${WIFI_MODULE}.ko" "${WIFI_COUNTRY_CODE_PARM}"
fi
fi
# Race-y as hell, don't try to optimize this!