summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes-kernel/rs9113/files/rs9113/rs9113.init39
1 files changed, 14 insertions, 25 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init
index 0d3d548..e27a35d 100755
--- a/recipes-kernel/rs9113/files/rs9113/rs9113.init
+++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init
@@ -27,47 +27,36 @@ case "$1" in
# We don't want the driver loaded.
exit 0
fi
+
+ for i in {1..5} ; do
+ if [[ -f $RS9113_RESET ]] ; then
+ break
+ fi
+ done
+
# Reset the RS9113 chip is ready, and
# wait for it to settle.
- count=0
- while : ; do
- if [ -f "$RS9113_RESET" ] ; then
+ for i in {1..5} ; do
+ if [[ -f $RS9113_RESET ]] ; then
echo 1 >$RS9113_RESET
usleep $SLEEPTIME
echo 0 >$RS9113_RESET
usleep $SLEEPTIME
echo 1 >$RS9113_RESET
- N=1
- while [ $N -lt 20 ] ; do
- INT=$(cat $RS9113_INT)
- if ((INT != 1)) ; then
- usleep $INTSLEEPTIME
- else
- break
- fi
- done
- if [ $INT -ne 1 ] ; then
- logger -t rs9113 -p error -s "$RS9113_INT is $INT"
- fi
else
# No WiFi BT, so exit quietly
exit 0
fi
- n=0
- while ((n < 10)) ; do
- usleep 50000
+ for j in {0..250} ; do
if /usr/bin/lsusb -d 1618:9113 ; then
break 2
fi
+ usleep 100000
done
- /usr/bin/logger -t "rs9113" -p error -s "Redpine not found on USB Hub."
- sleep 15
- ((count++))
- if ((count > 5)) ; then
- /usr/bin/logger -t "rs9113" -p error -s "RS9113 not found after $count resets"
- break
+ if ((i > 1)) ; then
+ logger -t rs9113 -p error -s "RS9113 not found after $i resets"
+ /usr/bin/lsusb | logger -t rs9113 -p error -s
fi
- echo 'RS9113 not found, try resetting again'
done
/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