summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io.init39
1 files changed, 27 insertions, 12 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index eee2635..29f0080 100755
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -31,6 +31,16 @@ hw_name=""
MTAC_MODULES=""
((HASAP=0))
+remove_mod() {
+ mod=$1
+ # modprobe -R does not work for modules not in /lib/modules
+ if lsmod | grep -E "^${mod}[[:space:]]" ; then
+ if ! modprobe -r ${mod} ; then
+ rmmod ${mod}
+ fi
+ fi
+}
+
sethwtype() {
# mts-io must be loaded before trying this
# Also, mtcdt3b should be loaded if it exists
@@ -395,25 +405,30 @@ case $1 in
;;
stop)
+ # Remove modules that fall down when
+ # mts-io is removed.
+ remove_mod rsi_sdio
+ remove_mod wlcore_sdio
+ remove_mod wl18xx
+ remove_mod wlcore
+ if [[ -x /usr/sbin/rs9113_remove_modules.sh ]] ; then
+ /usr/sbin/rs9113_remove_modules.sh
+ else
+ remove_mod mac80211
+ remove_mod cfg80211
+ remove_mod bluetooth
+ fi
/usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mtac modules and mts-io module"
MTAC_MODULES=$(lsmod | grep '^mtac_' | sed -e 's/_/-/' -e 's/ .*//')
MTCDT3B_MODULES=$(lsmod | grep '^mtcdt3b_' | sed -e 's/_/-/' -e 's/ .*//')
for f in ${MTAC_MODULES} ; do
- if ! modprobe -r "$f" ; then
- rmmod "$f"
- fi
+ remove_mod "$f"
done
- if ! modprobe -r mtac ; then
- rmmod mtac
- fi
+ remove_mod mtac
+ remove_mod mtcdt3b
+ remove_mod mts_io
- if ! modprobe -r mtcdt3b ; then
- rmmod mtcdt3b
- fi
- if ! modprobe -r mts-io ; then
- rmmod mtsio
- fi
RETVAL=$?
if ((RETVAL == 0)) ; then
echo "OK"