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