| function driver_insmod() |
| { |
| cfg80211_insmod=`lsmod | grep cfg80211` |
| if [ -z "$cfg80211_insmod" ];then |
| modprobe cfg80211 |
| else |
| echo "cfg80211 has insmod." |
| fi |
| |
| aic8800_bsp_insmod=`lsmod | grep aic8800_bsp` |
| if [ -z "$aic8800_bsp_insmod" ];then |
| insmod /etc/wifi/aic8800_bsp.ko sdio_f0=0 sdio_clk=150000000 |
| else |
| echo "aic8800_bsp has insmod." |
| fi |
| |
| aic8800_fdrv_insmod=`lsmod | grep aic8800_fdrv` |
| if [ -z "$aic8800_fdrv_insmod" ];then |
| insmod /etc/wifi/aic8800_fdrv.ko |
| else |
| echo "aic8800_fdrv has insmod." |
| fi |
| } |
| |
| function driver_rmmod() |
| { |
| aic8800_fdrv_insmod=`lsmod | grep aic8800_fdrv` |
| if [ -z "$aic8800_fdrv_insmod" ];then |
| echo "aic8800_fdrv not insmod." |
| else |
| rmmod aic8800_fdrv |
| fi |
| |
| aic8800_bsp_insmod=`lsmod | grep aic8800_bsp` |
| if [ -z "$aic8800_bsp_insmod" ];then |
| echo "aic8800_bsp not insmod." |
| else |
| rmmod aic8800_bsp |
| fi |
| |
| cfg80211_insmod=`lsmod | grep cfg80211` |
| if [ -z "$cfg80211_insmod" ];then |
| echo "cfg80211 not insmod." |
| else |
| rmmod cfg80211 |
| fi |
| } |
| |
| |
| if [ -n "$2" ] ;then #有参数 |
| case "$1" in |
| ap) |
| case "$2" in |
| start) |
| driver_insmod |
| |
| #wifi_ap_start |
| ;; |
| stop) |
| #wifi_ap_stop |
| ;; |
| *) |
| help |
| ;; |
| esac |
| ;; |
| sta) |
| case "$2" in |
| start) |
| driver_insmod |
| |
| #wifi_sta_start |
| ;; |
| stop) |
| driver_rmmod |
| #wifi_sta_stop |
| ;; |
| *) |
| help |
| ;; |
| esac |
| ;; |
| *) |
| help |
| ;; |
| esac |
| else |
| help |
| fi |