Added HotFix-Scripts (not yet finished) for easier editing on multiple PCs :)
[openpandora.oe.git] / recipes / hotfix / 2 / rc.wl1251
1 #!/bin/sh
2 DESC="WL1251 MAC80211 Wireless LAN driver"
3 NAME="wl1251"
4
5 d_stop() {
6         if `grep -q wl1251 /proc/modules` ; then
7                 rmmod wl1251_sdio
8                 rmmod wl1251
9                 rmmod board-omap3pandora-wifi
10         fi
11 }
12
13 d_start() {
14         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "rfkill_backport.ko")
15         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "compat.ko")
16         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "cfg80211.ko")
17         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "mac80211.ko")
18         insmod $(busybox find /lib/modules/$(uname -r)/updates -name "compat_firmware_class.ko")
19         insmod $(busybox find /lib/modules/$(uname -r) -name "ecb.ko")
20         insmod $(busybox find /lib/modules/$(uname -r) -name "pcbc.ko")
21         insmod $(busybox find /lib/modules/$(uname -r) -name "arc4.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         insmod $(busybox find /lib/modules/$(uname -r) -name "board-omap3pandora-wifi.ko")
29
30         # restore phyX related LED triggers (they come from mac80211.ko)
31         sleep 0.5
32         if [ -e /sys/class/leds/ ] ; then
33                 for led in /sys/class/leds/* ; do
34                         trigger=$(grep "$(basename $led)" /etc/default/leds | grep "phy" | awk '{print $2}')
35                         if [ "x$trigger" != "x" ] ; then
36                                 echo "$trigger" > "$led/trigger"
37                         fi
38                 done
39         fi
40 }
41
42 case "$1" in
43   start)
44         echo -n "Starting $DESC: $NAME"
45         d_start &
46         echo "."
47         ;;
48   stop)
49         echo -n "Stopping $DESC: $NAME"
50         d_stop
51         echo "."
52         ;;
53   restart|force-reload)
54         echo -n "Restarting $DESC: $NAME"
55         d_stop
56         sleep 1
57         d_start
58         echo "."
59         ;;
60   *)
61         echo "Usage: $0 {start|stop|restart|force-reload}" >&2
62         exit 1
63         ;;
64 esac
65
66 exit 0