#!/bin/sh
# chkconfig: 2345 25 75
### BEGIN INIT INFO
# Provides:          ti-connectivity-firmware
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start wl1271 at boot time
# Description:       Enable service provided by wl1271
# X-Start-Before:    
# X-Stop-After:      
# X-Timesys-Start-Number:  22
# X-Timesys-Stop-Number:  76
### END INIT INFO


INTERFACE=wlan0
HWADDR=00:22:33:44:55:66

case "$1" in
    start)
        modprobe wl1271_sdio
	ifconfig $INTERFACE hw ether $HWADDR
	# The following command loads the firmware into the wl1271
	ifconfig $INTERFACE up
    ;;
    stop)
        ifconfig wlan0 down
        rmmod wl1271_sdio
    ;;
    restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "usage: $0 {start|stop|restart}"
    ;;
esac
