uqmi: Add sync command to release all cids.
authorNickolay Ledovskikh <nledovskikh@gmail.com>
Wed, 7 Dec 2016 17:12:54 +0000 (20:12 +0300)
committerFelix Fietkau <nbd@nbd.name>
Fri, 9 Dec 2016 11:52:01 +0000 (12:52 +0100)
Signed-off-by: Nickolay Ledovskikh <nledovskikh@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [add command line help]
commands.c
commands.h
main.c

index 04ca2386518beb25e9dc8e34841a6e80edd6dda5..ff9d3acefdab05d9d0357967d7319e175fe9b005 100644 (file)
@@ -64,6 +64,14 @@ cmd_version_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg
        return QMI_CMD_REQUEST;
 }
 
+#define cmd_sync_cb no_cb
+static enum qmi_cmd_result
+cmd_sync_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+       qmi_set_ctl_sync_request(msg);
+       return QMI_CMD_DONE;
+}
+
 #define cmd_get_client_id_cb no_cb
 static enum qmi_cmd_result
 cmd_get_client_id_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
index 28823f35ee2c355c61f6e4dfcb7e3000455cd9e2..f409ec42658d8288283ba5982f4f302b8d50f0dd 100644 (file)
@@ -55,6 +55,7 @@ struct uqmi_cmd {
 
 #define __uqmi_commands \
        __uqmi_command(version, get-versions, no, QMI_SERVICE_CTL), \
+       __uqmi_command(sync, sync, no, QMI_SERVICE_CTL), \
        __uqmi_command(set_client_id, set-client-id, required, CMD_TYPE_OPTION), \
        __uqmi_command(get_client_id, get-client-id, required, QMI_SERVICE_CTL), \
        __uqmi_command(ctl_set_data_format, set-data-format, required, QMI_SERVICE_CTL), \
diff --git a/main.c b/main.c
index 25ec992405ce7cb8f0e75e4d542751cd8a0f813c..9b43e5eff76523f3453b75339e33fb82e79e6c6e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -66,6 +66,7 @@ static int usage(const char *progname)
                "                                    (implies --keep-client-id)\n"
                "  --get-client-id <name>:           Connect and get Client ID for service <name>\n"
                "                                    (implies --keep-client-id)\n"
+               "  --sync:                           Release all Client IDs\n"
                wds_helptext
                dms_helptext
                uim_helptext