]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/wl18xx-target-scripts.git/blob - sta/sta_stop.sh
stop.sh: reset all driver modules when stopping
[wilink8-wlan/wl18xx-target-scripts.git] / sta / sta_stop.sh
1 #!/system/bin/sh
3 INSMOD=/system/bin/insmod
4 RMMOD=/system/bin/rmmod
5 IFCONFIG=/system/bin/ifconfig
6 WPA_CLI=/system/bin/wpa_cli
8 WLAN_IF=wlan0
9 WLAN_IP=192.168.1.20
10 WLAN_NETMASK=255.255.255.0
12 SERVICE_SUPPLICANT=wpa_supplicant
14 SUPP_STAT=`getprop init.svc.$SERVICE_SUPPLICANT`
15 echo "wpa_supplicant state: $SUPP_STAT"
16 if [ ! "$SUPP_STAT" == "running" ] ; then echo "supplicant is not in running state, exiting..." ; exit 0 ; fi
18 echo "unload supplicant"
19 setprop ctl.stop $SERVICE_SUPPLICANT
20 #$WPA_CLI -i$WLAN_IF -p/data/misc/wifi/wlan0 terminate
21 sleep 1
23 echo "disable interface"
24 $IFCONFIG $WLAN_IF down
25 sleep 1
27 echo "unload driver"
28 $RMMOD wl12xx_sdio
29 sleep 1
30 $RMMOD wl12xx
31 $RMMOD mac80211
32 $RMMOD cfg80211
33 $RMMOD compat
34 sleep 1
35 $INSMOD /system/lib/modules/compat.ko
36 $INSMOD /system/lib/modules/cfg80211.ko
37 $INSMOD /system/lib/modules/mac80211.ko
38 $INSMOD /system/lib/modules/wl12xx.ko debug_level=0x63c00