2 DESC="WL1251 MAC80211 Wireless LAN driver"
5 sysfs_path="/sys/bus/mmc/devices/mmc2:0001/mmc2:0001:1"
6 ps_rate_threshold=30000
9 if [ -f /etc/pandora/conf/wl1251 ]; then
10 . /etc/pandora/conf/wl1251
14 if `grep -q wl1251 /proc/modules` ; then
16 rmmod board_omap3pandora_wifi wl1251_sdio wl1251 2> /dev/null
22 if modinfo wl1251 2> /dev/null | grep -q '\<use_fw_ps\>'; then
23 wl1251_args="use_fw_ps=$use_fw_ps"
25 modprobe wl1251 $wl1251_args
27 # this does not exist on newer kernels
28 modprobe board-omap3pandora-wifi 2> /dev/null
30 # find our phy index, they change every time driver module is reinserted
31 # assume our interface is wlan0
33 for a in `seq 20` ; do
34 if [ -e /sys/class/net/wlan0 ] ; then
35 phy_idx=$(cat /sys/class/net/wlan0/phy80211/index)
42 # restore phy related LED triggers (they come from mac80211.ko)
43 if [ -e /sys/class/leds/ ] ; then
44 for led in /sys/class/leds/* ; do
45 trigger=$(grep "$(basename $led)" /etc/default/leds | grep phy | \
46 awk '{print $2}' | sed -e 's/.*phy[0-9]*\(.*\)/\1/')
47 if [ "x$trigger" != "x" ] ; then
48 echo "phy${phy_idx}$trigger" > "$led/trigger"
53 # some driver configuration
54 if [ -d "$sysfs_path" ]; then
55 test -n "$ps_rate_threshold" && echo "$ps_rate_threshold" > $sysfs_path/ps_rate_threshold
56 test -n "$long_doze_mode" && echo "$long_doze_mode" > $sysfs_path/long_doze_mode
62 echo -n "Starting $DESC: $NAME"
67 echo -n "Stopping $DESC: $NAME"
72 echo -n "Restarting $DESC: $NAME"
79 echo "Usage: $0 {start|stop|restart|force-reload}" >&2