diff options
Diffstat (limited to 'recipes-kernel/rsi-91x/files')
-rwxr-xr-x | recipes-kernel/rsi-91x/files/rs9113_load_modules.sh | 13 | ||||
-rwxr-xr-x | recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh | 2 |
2 files changed, 13 insertions, 2 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=$? |