dms: add "Set FCC Authentication" request
authorBjørn Mork <bjorn@mork.no>
Sun, 21 Aug 2016 00:01:10 +0000 (02:01 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 23 Aug 2016 11:38:27 +0000 (13:38 +0200)
Many newer modems from Sierra Wireless includes a feature known as
"FCC Authentication".  The basic idea is that the radio is kept in
low power mode until the driver has told the firmware that it is
OK to switch it on.  This is done with a vendor specific QMI DMS
request with no input or output TLVs.

The "Set FCC Authentication" request is required for any modem with
the feature enabled.  Which includes most newer Lenovo branded Sierra
Wireless modems based on Qualcomm chipsets, like for example the
EM7455.

Sample session with an EM7455 in MBIM mode and the FCC Authentication
feature enabled:

 $ umbim -d /dev/cdc-wdm0 -n radio
   hwradiostate: on
   swradiostate: off
 $ uqmi -m -d /dev/cdc-wdm0 --fcc-auth
 $ umbim -d /dev/cdc-wdm0 -t 2 radio
   hwradiostate: on
   swradiostate: on

Signed-off-by: Bjørn Mork <bjorn@mork.no>
commands-dms.c
commands-dms.h
data/qmi-service-dms.json

index dad2b86072a17e7a77a1c4647d5e62c35cd9cbb8..8cc7bc5017f3eee78a0082c96fe6ab25d15e1e7c 100644 (file)
@@ -408,3 +408,11 @@ cmd_dms_set_operating_mode_prepare(struct qmi_dev *qmi, struct qmi_request *req,
 
        return uqmi_add_error("Invalid argument");
 }
+
+#define cmd_dms_set_fcc_authentication_cb no_cb
+static enum qmi_cmd_result
+cmd_dms_set_fcc_authentication_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+       qmi_set_dms_set_fcc_authentication_request(msg);
+       return QMI_CMD_REQUEST;
+}
index ccafbb12de7300fb8a2d1717ddb5a565cf84fbd1..82ae592d885668cf63cc24f80effdbd60657924c 100644 (file)
@@ -38,7 +38,8 @@
        __uqmi_command(dms_get_imei, get-imei, no, QMI_SERVICE_DMS), \
        __uqmi_command(dms_get_msisdn, get-msisdn, no, QMI_SERVICE_DMS), \
        __uqmi_command(dms_set_operating_mode, set-device-operating-mode, required, QMI_SERVICE_DMS), \
-       __uqmi_command(dms_reset, reset-dms, no, QMI_SERVICE_DMS) \
+       __uqmi_command(dms_reset, reset-dms, no, QMI_SERVICE_DMS), \
+       __uqmi_command(dms_set_fcc_authentication, fcc-auth, no, QMI_SERVICE_DMS) \
 
 #define dms_helptext \
                "  --get-capabilities:               List device capabilities\n" \
@@ -70,4 +71,5 @@
                "                                    (modes: online, low_power, factory_test, offline\n" \
                "                                     reset, shutting_down, persistent_low_power,\n" \
                "                                     mode_only_low_power)\n" \
+               "  --fcc-auth:                       Set FCC authentication\n" \
 
index 1e48455bf284d54f757c10ad5769735cefae07e3..f7b741fe6acd1fdbb2d05ff7d87257a4dde3a505 100644 (file)
      "type"    : "Message",
      "service" : "DMS",
      "id"      : "0x003C",
-     "version" : "1.3",
+     "version" : "1.1",
      "output"  : [  { "common-ref" : "Operation Result" },
                     { "name"      : "ICCID",
                       "id"        : "0x01",
      "type"    : "Message",
      "service" : "DMS",
      "id"      : "0x0043",
-     "version" : "1.3",
+     "version" : "1.1",
      "output"  : [  { "common-ref" : "Operation Result" },
                     { "name"      : "IMSI",
                       "id"        : "0x01",
      "service" : "DMS",
      "id"      : "0x0052",
      "version" : "1.5",
-     "input"   : [  { "name"       : "Current",
+     "input"   : [  { "name"       : "Current Code",
                       "id"         : "0x01",
                       "mandatory"  : "yes",
                       "type"       : "TLV",
                       "format"     : "string",
                       "fixed-size" : "6" },
-                    { "name"       : "New",
+                    { "name"       : "New Code",
                       "id"         : "0x02",
                       "mandatory"  : "yes",
                       "type"       : "TLV",
                       "format"     : "string",
                       "fixed-size" : "6" } ],
+     "output"  : [  { "common-ref" : "Operation Result" } ] },
+
+  // *********************************************************************************
+  {  "name"    : "Get Supported Messages",
+     "type"    : "Message",
+     "service" : "DMS",
+     "id"      : "0x001E",
+     "version" : "1.16",
+     "output"  : [ { "common-ref" : "Operation Result" },
+                   { "name"               : "List",
+                     "id"                 : "0x10",
+                     "mandatory"          : "no",
+                     "type"               : "TLV",
+                     "format"             : "array",
+                     "size-prefix-format" : "guint16",
+                     "array-element"      : { "format" : "guint8" },
+                     "prerequisites"      : [ { "common-ref" : "Success" } ] } ] },
+
+  // *********************************************************************************
+  {  "name"    : "Get USB Composition",
+     "type"    : "Message",
+     "service" : "DMS",
+     "id"      : "0x555B",
+     "version" : "1.0",
+     "output"  : [ { "common-ref" : "Operation Result" },
+                   { "name"          : "Composition",
+                     "id"            : "0x10",
+                     "mandatory"     : "yes",
+                     "type"          : "TLV",
+                     "format"        : "guint8",
+                     "prerequisites" : [ { "common-ref" : "Success" } ] },
+                   { "name"               : "Supported",
+                     "id"                 : "0x11",
+                     "mandatory"          : "no",
+                     "type"               : "TLV",
+                     "format"             : "array",
+                     "size-prefix-format" : "guint8",
+                     "array-element"      : { "format" : "guint8" },
+                     "prerequisites"      : [ { "common-ref" : "Success" } ] } ] },
+
+  // *********************************************************************************
+  {  "name"    : "Set USB Composition",
+     "type"    : "Message",
+     "service" : "DMS",
+     "id"      : "0x555C",
+     "version" : "1.0",
+     "input"   : [ { "name"          : "Composition",
+                     "id"            : "0x01",
+                     "mandatory"     : "yes",
+                     "type"          : "TLV",
+                     "format"        : "guint8" } ],
+     "output"  : [ { "common-ref" : "Operation Result" } ] },
+
+  // *********************************************************************************
+  {  "name"    : "Set FCC Authentication",
+     "type"    : "Message",
+     "service" : "DMS",
+     "id"      : "0x555F",
+     "version" : "1.0",
      "output"  : [  { "common-ref" : "Operation Result" } ] }
 
 ]