diff options
author | Koen Vandeputte <koen.vandeputte@ncentric.com> | 2018-02-15 15:16:03 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-02-18 09:35:01 +0100 |
commit | b3b16c8ce5c616a0d1f84c4263b4067ff099aa1e (patch) | |
tree | 98c0520fe3f7eee64295d41e657a9707a33d735d /package | |
parent | e9eb219e5a07f3e2284c1483da03d5accb130eac (diff) | |
download | upstream-b3b16c8ce5c616a0d1f84c4263b4067ff099aa1e.tar.gz upstream-b3b16c8ce5c616a0d1f84c4263b4067ff099aa1e.tar.bz2 upstream-b3b16c8ce5c616a0d1f84c4263b4067ff099aa1e.zip |
uqmi: use built-in command for data-link verification
uqmi contains a command for directly querying the modem if there
is a valid data connection, so let's use it.
This avoids the cases were all previous tests are succesful, but the
actual data link is not up for some reasons, leading to states were we
thought the link was up when it actually wasn't ..
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/network/utils/uqmi/Makefile | 2 | ||||
-rwxr-xr-x | package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 6e891435b9..993069e256 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/uqmi.git 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 bdab5ee514..c3da5ede26 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -27,7 +27,7 @@ proto_qmi_init_config() { proto_qmi_setup() { local interface="$1" - local dataformat + local dataformat connstat local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 @@ -164,6 +164,15 @@ proto_qmi_setup() { proto_notify_error "$interface" CALL_FAILED return 1 fi + + # Check data connection state + connstat=$(uqmi -s -d "$device" --get-data-status) + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { @@ -192,6 +201,15 @@ proto_qmi_setup() { proto_notify_error "$interface" CALL_FAILED return 1 fi + + # Check data connection state + connstat=$(uqmi -s -d "$device" --get-data-status) + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } echo "Setting up $ifname" |