aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-04-10 15:56:24 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2018-10-11 12:18:16 +0200
commitf171a86d064ac3fcfff05d286becae87c2e26b5f (patch)
tree1a5567db0ed60e778abd1767ba9ac9f6e6b0b188
parentdec1bfa0f48d43174921d1a1357a4842f9ba0cf6 (diff)
downloadupstream-f171a86d064ac3fcfff05d286becae87c2e26b5f.tar.gz
upstream-f171a86d064ac3fcfff05d286becae87c2e26b5f.tar.bz2
upstream-f171a86d064ac3fcfff05d286becae87c2e26b5f.zip
uqmi: do not block proto handler if SIM is uninitialized
QMI proto setup-handler will wait forever if SIM does not get initialized. To fix this stop polling pin status and notify netifd. Netifd will generate then a "ifup-failed" ACTION. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index f3c5487574..f6e964fb20 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -70,7 +70,15 @@ proto_qmi_setup() {
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
[ -e "$device" ] || return 1
- sleep 1;
+ if [ "$uninitialized_timeout" -lt "$timeout" ]; then
+ let uninitialized_timeout++
+ sleep 1;
+ else
+ echo "SIM not initialized"
+ proto_notify_error "$interface" SIM_NOT_INITIALIZED
+ proto_block_restart "$interface"
+ return 1
+ fi
done
[ -n "$pincode" ] && {