summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-02-07 18:59:05 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-02-07 19:07:47 +0100
commit22628a69dad6a1c4b0400dacf1c13c48425faf69 (patch)
tree39340fb240c97d0e13a8ad98a86a1413934e6ef1
parent45ab1a6d81457dbbedaf24758978dcb725e8ca99 (diff)
dms: new 'DMS Set FCC Authentication' message
Dell-branded Sierra modems, like the Dell DW5570 (Sierra Wireless MC8805) need this specific command before they can be put in 'online' mode: $ sudo qmicli -d /dev/cdc-wdm1 --dms-get-operating-mode [/dev/cdc-wdm1] Operating mode retrieved: Mode: 'low-power' HW restricted: 'no' $ sudo qmicli -d /dev/cdc-wdm1 --dms-set-fcc-authentication [/dev/cdc-wdm1] Successfully set FCC authentication $ sudo qmicli -d /dev/cdc-wdm1 --dms-get-operating-mode [/dev/cdc-wdm1] Operating mode retrieved: Mode: 'online' HW restricted: 'no' https://bugzilla.kernel.org/show_bug.cgi?id=92101
-rw-r--r--data/qmi-service-dms.json8
-rw-r--r--docs/reference/libqmi-glib/libqmi-glib-docs.xml1
-rw-r--r--src/qmicli/qmicli-dms.c48
3 files changed, 57 insertions, 0 deletions
diff --git a/data/qmi-service-dms.json b/data/qmi-service-dms.json
index a6cf57e..c62b431 100644
--- a/data/qmi-service-dms.json
+++ b/data/qmi-service-dms.json
@@ -1169,6 +1169,14 @@
"type" : "TLV",
"format" : "string",
"fixed-size" : "6" } ],
+ "output" : [ { "common-ref" : "Operation Result" } ] },
+
+ // *********************************************************************************
+ { "name" : "Set FCC Authentication",
+ "type" : "Message",
+ "service" : "DMS",
+ "id" : "0x555F",
+ "version" : "1.0",
"output" : [ { "common-ref" : "Operation Result" } ] }
]
diff --git a/docs/reference/libqmi-glib/libqmi-glib-docs.xml b/docs/reference/libqmi-glib/libqmi-glib-docs.xml
index 3051597..87ddbf5 100644
--- a/docs/reference/libqmi-glib/libqmi-glib-docs.xml
+++ b/docs/reference/libqmi-glib/libqmi-glib-docs.xml
@@ -107,6 +107,7 @@
<xi:include href="xml/qmi-message-dms-set-alt-net-config.xml"/>
<xi:include href="xml/qmi-message-dms-get-software-version.xml"/>
<xi:include href="xml/qmi-message-dms-set-service-programming-code.xml"/>
+ <xi:include href="xml/qmi-message-dms-set-fcc-authentication.xml"/>
</section>
</chapter>
diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c
index e529cba..ec31d04 100644
--- a/src/qmicli/qmicli-dms.c
+++ b/src/qmicli/qmicli-dms.c
@@ -81,6 +81,7 @@ static gboolean get_factory_sku_flag;
static gboolean list_stored_images_flag;
static gchar *select_stored_image_str;
static gchar *delete_stored_image_str;
+static gboolean set_fcc_authentication_flag;
static gboolean reset_flag;
static gboolean noop_flag;
@@ -241,6 +242,10 @@ static GOptionEntry entries[] = {
"Delete stored image",
"[modem#|pri#] where # is the index"
},
+ { "dms-set-fcc-authentication", 0, 0, G_OPTION_ARG_NONE, &set_fcc_authentication_flag,
+ "Set FCC authentication",
+ NULL
+ },
{ "dms-reset", 0, 0, G_OPTION_ARG_NONE, &reset_flag,
"Reset the service state",
NULL
@@ -315,6 +320,7 @@ qmicli_dms_options_enabled (void)
list_stored_images_flag +
!!select_stored_image_str +
!!delete_stored_image_str +
+ set_fcc_authentication_flag +
reset_flag +
noop_flag);
@@ -2948,6 +2954,36 @@ get_stored_image_delete_ready (QmiClientDms *client,
}
static void
+set_fcc_authentication_ready (QmiClientDms *client,
+ GAsyncResult *res)
+{
+ QmiMessageDmsSetFccAuthenticationOutput *output;
+ GError *error = NULL;
+
+ output = qmi_client_dms_set_fcc_authentication_finish (client, res, &error);
+ if (!output) {
+ g_printerr ("error: operation failed: %s\n", error->message);
+ g_error_free (error);
+ shutdown (FALSE);
+ return;
+ }
+
+ if (!qmi_message_dms_set_fcc_authentication_output_get_result (output, &error)) {
+ g_printerr ("error: couldn't set FCC authentication: %s\n", error->message);
+ g_error_free (error);
+ qmi_message_dms_set_fcc_authentication_output_unref (output);
+ shutdown (FALSE);
+ return;
+ }
+
+ g_print ("[%s] Successfully set FCC authentication\n",
+ qmi_device_get_path_display (ctx->device));
+
+ qmi_message_dms_set_fcc_authentication_output_unref (output);
+ shutdown (TRUE);
+}
+
+static void
reset_ready (QmiClientDms *client,
GAsyncResult *res)
{
@@ -3580,6 +3616,18 @@ qmicli_dms_run (QmiDevice *device,
return;
}
+ /* Set FCC authentication */
+ if (set_fcc_authentication_flag) {
+ g_debug ("Asynchronously setting FCC auth...");
+ qmi_client_dms_set_fcc_authentication (ctx->client,
+ NULL,
+ 10,
+ ctx->cancellable,
+ (GAsyncReadyCallback)set_fcc_authentication_ready,
+ NULL);
+ return;
+ }
+
/* Request to reset DMS service? */
if (reset_flag) {
g_debug ("Asynchronously resetting DMS service...");