Update tree with local changes. Disable WiLink4 drivers in the image and enable the...
[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 wl12xx /proc/modules` ; then
8                 rmmod wl12xx_sdio
9                 rmmod wl12xx
10         fi
11         if `grep -q mac80211 /proc/modules` ; then
12                 rmmod mac80211
13                 rmmod cfg80211
14                 rmmod rfkill_backport
15                 rmmod lib80211_crypt_ccmp
16                 rmmod lib80211_crypt_wep
17                 rmmod lib80211_crypt_tkip
18                 rmmod lib80211
19         fi
20 }
21
22 d_start() {
23         insmod $(busybox find /lib/modules/$(uname -r) -name "arc4.ko")
24         insmod $(busybox find /lib/modules/$(uname -r) -name "ecb.ko")
25         insmod $(busybox find /lib/modules/$(uname -r) -name "pcbc.ko")
26         insmod $(busybox find /lib/modules/$(uname -r) -name "rfkill_backport.ko")
27         insmod $(busybox find /lib/modules/$(uname -r) -name "cfg80211.ko")
28         insmod $(busybox find /lib/modules/$(uname -r) -name "mac80211.ko")
29         insmod $(busybox find /lib/modules/$(uname -r) -name "lib80211.ko")
30         insmod $(busybox find /lib/modules/$(uname -r) -name "lib80211_crypt_tkip.ko")
31         insmod $(busybox find /lib/modules/$(uname -r) -name "lib80211_crypt_wep.ko")
32         insmod $(busybox find /lib/modules/$(uname -r) -name "lib80211_crypt_ccmp.ko")
33         insmod $(busybox find /lib/modules/$(uname -r) -name "wl12xx.ko")
34         insmod $(busybox find /lib/modules/$(uname -r) -name "wl12xx_sdio.ko")
35 }
36
37 case "$1" in
38   start)
39         echo -n "Starting $DESC: $NAME"
40         d_start
41         echo "."
42         ;;
43   stop)
44         echo -n "Stopping $DESC: $NAME"
45         d_stop
46         echo "."
47         ;;
48   restart|force-reload)
49         echo -n "Restarting $DESC: $NAME"
50         d_stop
51         sleep 1
52         d_start
53         echo "."
54         ;;
55   *)
56         echo "Usage: $0 {start|stop|restart|force-reload}" >&2
57         exit 1
58         ;;
59 esac
60
61 exit 0