summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2022-12-15 11:08:22 -0600
committerJohn Klug <john.klug@multitech.com>2023-01-10 16:42:56 -0600
commit4dc27623470b61aeb0845d74c0dc073ffff485b7 (patch)
tree42293ea94b305c8d221269bcb012b4e990de724e
parent66f856814e518c825d262b509ec5feb120f7fea7 (diff)
downloadmeta-multitech-atmel-4dc27623470b61aeb0845d74c0dc073ffff485b7.tar.gz
meta-multitech-atmel-4dc27623470b61aeb0845d74c0dc073ffff485b7.tar.bz2
meta-multitech-atmel-4dc27623470b61aeb0845d74c0dc073ffff485b7.zip
Do not remove rfkill, remove modules when updating cfg80211 Regulatory Domain
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_load_modules.sh13
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_remove_modules.sh2
-rw-r--r--recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb2
3 files changed, 14 insertions, 3 deletions
diff --git a/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
index d9a5ed0..3977a5c 100755
--- a/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
+++ b/recipes-kernel/rsi-91x/files/rs9113_load_modules.sh
@@ -80,7 +80,18 @@ fi
logger -s -p daemon.error "Using COUNTRY_CODE $COUNTRY_CODE"
cd /opt/rs9113/modules
-modprobe cfg80211 ieee80211_regdom="$COUNTRY_CODE"
+# Remove cfg80211 if not the correct regulatory domain
+if [[ $(lsmod) =~ [[:space:]]cfg80211[[:space:]] ]] ; then
+ if ! [[ $(iw reg get) =~ [[:space:]]country[[:space:]]${COUNTRY_CODE}: ]] ; then
+ logger -s -p daemon.alert "Removing modules related to cfg80211 to set up country code"
+ /usr/sbin/rs9113_remove_modules.sh
+ fi
+fi
+if [[ $(lsmod) =~ [[:space:]]cfg80211[[:space:]] ]] ; then
+ logger -s -p daemon.error "ERROR: cfg80211 will not remove."
+fi
+
+modprobe cfg80211 ieee80211_regdom="$COUNTRY_CODE" 2>&1
modprobe mac80211
modprobe bluetooth
diff --git a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
index acdb27b..ba65254 100755
--- a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
+++ b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
@@ -7,7 +7,7 @@ sleep 2
modules=" "$(lsmod)" "
### COMMON HAL MODULES
-for mod in bnep rfcomm rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_91x mac80211 cfg80211 bluetooth rfkill ; do
+for mod in bnep rfcomm rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_91x mac80211 cfg80211 bluetooth ; do
if [[ ${modules} =~ [[:space:]]${mod}[[:space:]] ]] ; then
result+=$(rmmod $mod 2>&1)
last=$?
diff --git a/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb b/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb
index 50753f2..eb5b6eb 100644
--- a/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb
+++ b/recipes-kernel/rsi-91x/rsi-91x-fw_2.5.1.bb
@@ -1,6 +1,6 @@
LIC_FILES_CHKSUM = "file://${WORKDIR}/git/rsi/Makefile;beginline=1;endline=29;md5=5eb8ffe925477437d8fcd5e2859c96a1"
LICENSE = "BSD-3-Clause"
-PR = "r1"
+PR = "r2"
inherit allarch
inherit update-rc.d