summaryrefslogtreecommitdiff
path: root/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh')
-rwxr-xr-xrecipes-kernel/rsi-91x/files/rs9113_remove_modules.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
index ba65254..606f069 100755
--- a/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
+++ b/recipes-kernel/rsi-91x/files/rs9113_remove_modules.sh
@@ -5,9 +5,33 @@ killall -9 bluetoothd
rm -rf /var/run/wpa_supplicant/
sleep 2
+# Find the wifi interfaces
+ints=$(find -L /sys/class/net -maxdepth 2 -name phy80211)
+
+# Remove the links with the ip command.
+for phy in $ints ; do
+ dir=$(dirname $phy)
+ vap=$(basename $dir)
+ echo Setting $vap down
+ logger -p daemon.alert Setting $vap down
+ ip link set $vap down
+done
+
+# So ifdown is not confused,
+# make sure ifup/ifdown is now
+# in the down state.
+if [[ -x /sbin/ifdown ]] ; then
+ for phy in $ints ; do
+ dir=$(dirname $phy)
+ vap=$(basename $dir)
+ logger -p daemon.alert ifdown $vap
+ ifdown $vap
+ done
+fi
+
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 ; do
+for mod in bnep rfcomm rsi_btsdio rsi_btusb rsi_bt91x rsi_sdio rsi_usb rsi_usb_sta_ap rsi_91x_sta_ap rsi_91x mac80211 cfg80211 bluetooth ; do
if [[ ${modules} =~ [[:space:]]${mod}[[:space:]] ]] ; then
result+=$(rmmod $mod 2>&1)
last=$?