diff options
-rwxr-xr-x | recipes-kernel/rs9113/files/rs9113/rs9113.init | 24 | ||||
-rwxr-xr-x | recipes-kernel/rs9113/files/rs9113/rs9113.reset | 4 |
2 files changed, 16 insertions, 12 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init index e27a35d..b6c6e37 100755 --- a/recipes-kernel/rs9113/files/rs9113/rs9113.init +++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init @@ -21,13 +21,7 @@ RS9113_WKUP=${MTS_IODIR}/wifi-bt-lpwkup . $CONFIG -case "$1" in - start) - if ((RS9113_LOAD == 0)) ; then - # We don't want the driver loaded. - exit 0 - fi - +function rs9113_reset { for i in {1..5} ; do if [[ -f $RS9113_RESET ]] ; then break @@ -58,6 +52,15 @@ case "$1" in /usr/bin/lsusb | logger -t rs9113 -p error -s fi done +} + +case "$1" in + start) + if ((RS9113_LOAD == 0)) ; then + # We don't want the driver loaded. + exit 0 + fi + rs9113_reset /usr/bin/logger -t "rs9113" -p info -s "Loading rs9113 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE" /usr/sbin/rs9113_load_modules.sh $CONFIG RETVAL=$? @@ -82,7 +85,7 @@ case "$1" in $0 stop sleep 1 $0 start - ;; + ;; status) for dir in /sys/class/net/rpine[0-9]* ; do if [[ -d ${dir} ]] ; then @@ -93,8 +96,11 @@ case "$1" in echo Driver is not loaded exit 3 ;; + reset) + rs9113_reset + ;; *) - "Usage: $0 {start|stop|status|restart}" + "Usage: $0 {start|stop|status|restart|reset}" exit 2 ;; esac diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.reset b/recipes-kernel/rs9113/files/rs9113/rs9113.reset index b4aca45..7992f7d 100755 --- a/recipes-kernel/rs9113/files/rs9113/rs9113.reset +++ b/recipes-kernel/rs9113/files/rs9113/rs9113.reset @@ -6,9 +6,7 @@ function do_reset { if ! [[ -w /sys/devices/platform/mts-io/wifi-bt-reset ]] ; then exit 0 fi - mts-io-sysfs store wifi-bt-reset 0 - usleep 60000 - mts-io-sysfs store wifi-bt-reset 1 + /etc/init.d/rs9113 reset } case $1 in |