aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorMartin Schiller <ms@dev.tdt.de>2020-02-07 12:38:36 +0100
committerChristian Lamparter <chunkeey@gmail.com>2021-12-27 13:51:41 +0100
commit049870a7fe92834b2438c65200d12f938d219cef (patch)
treec31cc16337b4466eb823b8dd4a875271e7bb14c1 /package/network
parent2593d510e2490e03b8fd7276a1a7080ac7e1ffe8 (diff)
downloadupstream-049870a7fe92834b2438c65200d12f938d219cef.tar.gz
upstream-049870a7fe92834b2438c65200d12f938d219cef.tar.bz2
upstream-049870a7fe92834b2438c65200d12f938d219cef.zip
umbim: call umbim disconnect in error case
This is needed to properly close the control channel. Otherwise, on the next try the caps call may fail. Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Diffstat (limited to 'package/network')
-rwxr-xr-xpackage/network/utils/umbim/files/lib/netifd/proto/mbim.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
index abbabd6625..db716c3dbf 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -65,6 +65,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Reading capabilities"
umbim $DBG -n -d $device caps || {
echo "mbim[$$]" "Failed to read modem caps"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" PIN_FAILED
return 1
}
@@ -74,6 +76,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Sending pin"
umbim $DBG -n -t $tid -d $device unlock "$pincode" || {
echo "mbim[$$]" "Unable to verify PIN"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" PIN_FAILED
proto_block_restart "$interface"
return 1
@@ -84,6 +88,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Checking pin"
umbim $DBG -n -t $tid -d $device pinstate || {
echo "mbim[$$]" "PIN required"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" PIN_FAILED
proto_block_restart "$interface"
return 1
@@ -93,6 +99,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Checking subscriber"
umbim $DBG -n -t $tid -d $device subscriber || {
echo "mbim[$$]" "Subscriber init failed"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" NO_SUBSCRIBER
return 1
}
@@ -101,6 +109,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Register with network"
umbim $DBG -n -t $tid -d $device registration || {
echo "mbim[$$]" "Subscriber registration failed"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" NO_REGISTRATION
return 1
}
@@ -109,6 +119,8 @@ _proto_mbim_setup() {
echo "mbim[$$]" "Attach to network"
umbim $DBG -n -t $tid -d $device attach || {
echo "mbim[$$]" "Failed to attach to network"
+ tid=$((tid + 1))
+ umbim $DBG -t $tid -d "$device" disconnect
proto_notify_error "$interface" ATTACH_FAILED
return 1
}
@@ -169,7 +181,7 @@ proto_mbim_teardown() {
echo "mbim[$$]" "Stopping network"
[ -n "$tid" ] && {
- umbim $DBG -t$tid -d "$device" disconnect
+ umbim $DBG -t $tid -d "$device" disconnect
uci_revert_state network $interface tid
}