summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNickolay Ledovskikh <nledovskikh@gmail.com>2016-12-07 20:12:54 +0300
committerFelix Fietkau <nbd@nbd.name>2016-12-09 12:52:01 +0100
commit1dc7be1a2c5fa6c56b6293ae4540bdc16fbe2cb2 (patch)
treeb98a8787ea9971b364e055e2927ee2bdfffa4516
parentd682e966615fc652da6e4e26b57aa3adfebeb2fe (diff)
uqmi: Add sync command to release all cids.
Signed-off-by: Nickolay Ledovskikh <nledovskikh@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [add command line help]
-rw-r--r--commands.c8
-rw-r--r--commands.h1
-rw-r--r--main.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index 04ca238..ff9d3ac 100644
--- a/commands.c
+++ b/commands.c
@@ -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)
diff --git a/commands.h b/commands.h
index 28823f3..f409ec4 100644
--- a/commands.h
+++ b/commands.h
@@ -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 25ec992..9b43e5e 100644
--- 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