rc.wl1251: Bring network interface down on shutdown, otherwise, drivers cannot be...
[openpandora.oe.git] / recipes / pandora-system / wl1251-modules / rc.wl1251
index d1834e1..ec4677b 100755 (executable)
@@ -4,9 +4,8 @@ NAME="wl1251"
 
 d_stop() {
        if `grep -q wl1251 /proc/modules` ; then
-               rmmod wl1251_sdio
-               rmmod wl1251
-               rmmod board-omap3pandora-wifi
+               ifconfig wlan0 down
+               rmmod board_omap3pandora_wifi wl1251_sdio wl1251 2> /dev/null
        fi
 }
 
@@ -25,9 +24,10 @@ d_start() {
                insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211_crypt_wep.ko")
                insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211_crypt_ccmp.ko")
        fi
-       insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251.ko")
-       insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251_sdio.ko")
-       insmod $(busybox find /lib/modules/$(uname -r) -name "board-omap3pandora-wifi.ko")
+       modprobe wl1251
+       modprobe wl1251_sdio
+       # this does not exist on newer kernels
+       modprobe board-omap3pandora-wifi 2> /dev/null
 
        # find our phy index, they change every time driver module is reinserted
        # assume our interface is wlan0