aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-02-26 13:01:17 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-02-26 13:01:17 +0100
commit4a82bb9be84861e5098d1c1482b16f60b2b3e449 (patch)
tree9404e39264c8284d41c8e318c190d7e2021d91a8 /utils
parent12793ef603195997215f9e232fa3e5216c8c07db (diff)
downloadexternal_libqmi-4a82bb9be84861e5098d1c1482b16f60b2b3e449.zip
external_libqmi-4a82bb9be84861e5098d1c1482b16f60b2b3e449.tar.gz
external_libqmi-4a82bb9be84861e5098d1c1482b16f60b2b3e449.tar.bz2
qmi-network: try to update LLP before connecting if the wrong one found
Diffstat (limited to 'utils')
-rwxr-xr-xutils/qmi-network.in48
1 files changed, 48 insertions, 0 deletions
diff --git a/utils/qmi-network.in b/utils/qmi-network.in
index b07c162..242e5ee 100755
--- a/utils/qmi-network.in
+++ b/utils/qmi-network.in
@@ -173,6 +173,54 @@ start_network ()
exit 3
fi
+ # Read link layer protocol
+ DATA_FORMAT_CMD="qmicli -d $DEVICE --wda-get-data-format $PROXY_OPT"
+ echo "Checking data format with '$DATA_FORMAT_CMD'..."
+ if [ "x$QMIDEBUG" != "x" ]; then
+ DATA_FORMAT_OUT="\
+[/dev/cdc-wdm1] Successfully got data format
+ QoS flow header: no
+ Link layer protocol: '802-3'
+ Uplink data aggregation protocol: 'disabled'
+Downlink data aggregation protocol: 'disabled'
+ NDP signature: '0'
+ Uplink data aggregation max size: '0'
+Downlink data aggregation max size: '0'"
+ else
+ DATA_FORMAT_OUT=`$DATA_FORMAT_CMD`
+ fi
+
+ LLP=`echo "$DATA_FORMAT_OUT" | sed -n "s/.*Link layer protocol:.*'\(.*\)'.*/\1/p"`
+ if [ "x$LLP" = "x" ]; then
+ echo "Link layer protocol not retrieved" 1>&2
+ else
+ echo "Link layer protocol retrieved: $LLP" 1>&2
+ if [ "x$LLP" != "x802-3" ]; then
+ DATA_FORMAT_SET_CMD="qmicli -d $DEVICE --wda-set-data-format=802-3 $PROXY_OPT"
+ echo "Updating data format with '$DATA_FORMAT_SET_CMD'..."
+ if [ "x$QMIDEBUG" != "x" ]; then
+ DATA_FORMAT_SET_OUT="\
+[/dev/cdc-wdm1] Successfully set data format
+ QoS flow header: no
+ Link layer protocol: '802-3'
+ Uplink data aggregation protocol: 'disabled'
+ Downlink data aggregation protocol: 'disabled'
+ NDP signature: '0'
+Downlink data aggregation max datagrams: '0'
+ Downlink data aggregation max size: '0'"
+ else
+ DATA_FORMAT_SET_OUT=`$DATA_FORMAT_SET_CMD`
+ fi
+
+ LLP=`echo "$DATA_FORMAT_SET_OUT" | sed -n "s/.*Link layer protocol:.*'\(.*\)'.*/\1/p"`
+ if [ "x$LLP" = "x" ]; then
+ echo "Link layer protocol not retrieved after update" 1>&2
+ else
+ echo "New link layer protocol retrieved: $LLP" 1>&2
+ fi
+ fi
+ fi
+
START_NETWORK_CMD="qmicli -d $DEVICE --wds-start-network=$APN $USE_PREVIOUS_CID --client-no-release-cid $PROXY_OPT"
echo "Starting network with '$START_NETWORK_CMD'..."