diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2015-02-07 18:59:05 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-02-10 17:22:12 +0100 |
commit | 161c7dbff5edf64daa536b4a400b5860364d3dd2 (patch) | |
tree | 4dc772a8f1249e59f90f0fc84ac655c44f0c7e49 | |
parent | e44561e84fc31713392c80eec4ead1b9871a99db (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.json | 8 | ||||
-rw-r--r-- | docs/reference/libqmi-glib/libqmi-glib-docs.xml | 1 | ||||
-rw-r--r-- | src/qmicli/qmicli-dms.c | 48 |
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 0ad64a6..03b7cf3 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); @@ -2925,6 +2931,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) { @@ -3557,6 +3593,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..."); |