wl1251-modules: Tweak the init script a little to stop trying to unload MAC80211...
[openpandora.oe.git] / recipes / pandora-system / wl1251-modules / rc.wl1251
1 #!/bin/sh
2
3 DESC="WL1251 MAC80211 Wireless LAN driver"
4 NAME="wl1251"
5
6 d_stop() {
7         if `grep -q wl1251 /proc/modules` ; then
8                 rmmod wl1251_sdio
9                 rmmod wl1251
10                 # rmmod board-omap3pandora-wifi
11         fi
12 }
13
14 d_start() {
15         insmod $(busybox find /lib/modules/$(uname -r) -name "board-omap3pandora-wifi.ko")
16         insmod $(busybox find /lib/modules/$(uname -r) -name "arc4.ko")
17         insmod $(busybox find /lib/modules/$(uname -r) -name "ecb.ko")
18         insmod $(busybox find /lib/modules/$(uname -r) -name "pcbc.ko")
19         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "rfkill_backport.ko")
20         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "cfg80211.ko")
21         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "mac80211.ko")
22         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211.ko")
23         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211_crypt_tkip.ko")
24         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211_crypt_wep.ko")
25         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "lib80211_crypt_ccmp.ko")
26         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251.ko")
27         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251_sdio.ko")
28 }
29
30 case "$1" in
31   start)
32         echo -n "Starting $DESC: $NAME"
33         d_start &
34         echo "."
35         ;;
36   stop)
37         echo -n "Stopping $DESC: $NAME"
38         d_stop
39         echo "."
40         ;;
41   restart|force-reload)
42         echo -n "Restarting $DESC: $NAME"
43         d_stop
44         sleep 1
45         d_start
46         echo "."
47         ;;
48   *)
49         echo "Usage: $0 {start|stop|restart|force-reload}" >&2
50         exit 1
51         ;;
52 esac
53
54 exit 0