[PATCH] Add option to support 802.3 flags in qmicli open

David McCullough david.mccullough at accelecon.com
Fri Mar 21 05:18:27 PDT 2014


Hi all,

This patch adds a command line option to qmicli to allow an appropriate
setting on the 802.3 flags.

The Sierra Wireless MC7354 needs this in order to get an address via DHCP
even though qmi-network has successfully connected.  It also seems that
adding this flag for the Vodafone (Huawei) K4511 has resulted in a much
more stable connection but this is still under test :-)

I added this option to qmi-network since ModemManager uses these settings
by default I suspect most qmi-network uses would also like to have it set.

Cheers,
Davidm


--- libqmi-1.8.0/src/qmicli/qmicli.c.orig	2014-03-14 15:35:39.670243534 +1000
+++ libqmi-1.8.0/src/qmicli/qmicli.c	2014-03-14 15:36:16.130223700 +1000
@@ -51,6 +51,7 @@
 static gboolean device_open_version_info_flag;
 static gboolean device_open_sync_flag;
 static gboolean device_open_proxy_flag;
+static gboolean device_open_net_802_3_flag;
 static gchar *client_cid_str;
 static gboolean client_no_release_cid_flag;
 static gboolean verbose_flag;
@@ -82,6 +83,10 @@
       "Request to use the 'qmi-proxy' proxy",
       NULL
     },
+    { "device-open-flag-net-802-3", 0, 0, G_OPTION_ARG_NONE, &device_open_net_802_3_flag,
+      "Request to open in 802.3 mode",
+      NULL
+    },
     { "client-cid", 0, 0, G_OPTION_ARG_STRING, &client_cid_str,
       "Use the given CID, don't allocate a new one",
       "[CID]"
@@ -481,6 +486,8 @@
         open_flags |= QMI_DEVICE_OPEN_FLAGS_SYNC;
     if (device_open_proxy_flag)
         open_flags |= QMI_DEVICE_OPEN_FLAGS_PROXY;
+    if (device_open_net_802_3_flag)
+        open_flags |= (QMI_DEVICE_OPEN_FLAGS_NET_802_3|QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER);
 
     /* Open the device */
     qmi_device_open (device,
--- libqmi-1.8.0/utils/qmi-network.in.orig	2014-03-21 08:37:48.693708323 +1000
+++ libqmi-1.8.0/utils/qmi-network.in	2014-03-21 08:37:50.803698032 +1000
@@ -16,6 +16,8 @@
 #
 # Copyright (C) 2012-2013 Aleksander Morgado <aleksander at gnu.org>
 
+GOPTS="--device-open-flag-net-802-3"
+
 print_usage ()
 {
     echo "usage: $0 [DEVICE] [COMMAND]"
@@ -137,7 +139,7 @@
         exit 3
     fi
 
-    START_NETWORK_CMD="qmicli -d $DEVICE --wds-start-network=$APN $USE_PREVIOUS_CID --client-no-release-cid"
+    START_NETWORK_CMD="qmicli $GOPTS -d $DEVICE --wds-start-network=$APN $USE_PREVIOUS_CID --client-no-release-cid"
     echo "Starting network with '$START_NETWORK_CMD'..."
 
     if [ "x$QMIDEBUG" != "x" ]; then
@@ -166,7 +168,7 @@
     if [ "x$PDH" = "x" ]; then
         echo "error: network start failed, no packet data handle" 1>&2
         # Cleanup the client
-        qmicli -d "$DEVICE" --wds-noop --client-cid="$CID"
+        qmicli $GOPTS -d "$DEVICE" --wds-noop --client-cid="$CID"
         clear_state
         exit 2
     else
@@ -184,9 +186,9 @@
     elif [ "x$PDH" = "x" ]; then
         echo "Network already stopped; need to cleanup CID $CID"
         # Cleanup the client
-        qmicli -d "$DEVICE" --wds-noop --client-cid="$CID"
+        qmicli $GOPTS -d "$DEVICE" --wds-noop --client-cid="$CID"
     else
-        STOP_NETWORK_CMD="qmicli -d $DEVICE --wds-stop-network=$PDH --client-cid=$CID"
+        STOP_NETWORK_CMD="qmicli $GOPTS -d $DEVICE --wds-stop-network=$PDH --client-cid=$CID"
         echo "Stopping network with '$STOP_NETWORK_CMD'..."
 
         if [ "x$QMIDEBUG" != "x" ]; then
@@ -210,7 +212,7 @@
         USE_PREVIOUS_CID="--client-cid=$CID --client-no-release-cid"
     fi
 
-    STATUS_CMD="qmicli -d $DEVICE --wds-get-packet-service-status $USE_PREVIOUS_CID"
+    STATUS_CMD="qmicli $GOPTS -d $DEVICE --wds-get-packet-service-status $USE_PREVIOUS_CID"
     echo "Getting status with '$STATUS_CMD'..."
 
     if [ "x$QMIDEBUG" != "x" ]; then


Signed-Off-By: David McCullough <david.mccullough at accelecon.com>
-- 
David McCullough,  david.mccullough at accelecon.com,   Ph: 0410 560 763


More information about the libqmi-devel mailing list