+/*
+ * uqmi -- tiny QMI support implementation
+ *
+ * Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
+
#include <stdio.h>
#include <string.h>
#include <strings.h>
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_REQUEST;
+}
+
#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)
#include "commands-nas.c"
#include "commands-wms.c"
#include "commands-wda.c"
+#include "commands-uim.c"
#define __uqmi_command(_name, _optname, _arg, _type) \
[__UQMI_COMMAND_##_name] = { \
cmds = realloc(cmds, n_cmds * sizeof(*cmds));
cmds[idx].handler = &uqmi_cmd_handler[cmd];
- cmds[idx].arg = optarg;
+ cmds[idx].arg = arg;
}
static void uqmi_print_result(struct blob_attr *data)
static bool __uqmi_run_commands(struct qmi_dev *qmi, bool option)
{
- static char buf[2048];
static struct qmi_request req;
+ char *buf = qmi->buf;
int i;
for (i = 0; i < n_cmds; i++) {
}
if (res == QMI_CMD_REQUEST) {
- qmi_request_start(qmi, &req, (void *) buf, cmds[i].handler->cb);
+ qmi_request_start(qmi, &req, cmds[i].handler->cb);
req.no_error_cb = true;
if (qmi_request_wait(qmi, &req)) {
uqmi_add_error(qmi_get_error_str(req.ret));