SET(service_headers)
SET(service_sources)
-FOREACH(service ctl dms nas pds wds wms)
+FOREACH(service ctl dms nas pds wds wms wda)
ADD_CUSTOM_COMMAND(
OUTPUT qmi-message-${service}.h
COMMAND ./data/gen-header.pl ${service}_ ./data/qmi-service-${service}.json > qmi-message-${service}.h
--- /dev/null
+#include <stdlib.h>
+
+#include "qmi-message.h"
+
+static const struct {
+ const char *name;
+ QmiWdaLinkLayerProtocol val;
+} link_modes[] = {
+ { "802.3", QMI_WDA_LINK_LAYER_PROTOCOL_802_3 },
+ { "raw-ip", QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP },
+};
+
+#define cmd_wda_set_data_format_cb no_cb
+
+static enum qmi_cmd_result
+cmd_wda_set_data_format_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ struct qmi_wda_set_data_format_request data_req = {};
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(link_modes); i++) {
+ if (strcasecmp(link_modes[i].name, arg) != 0)
+ continue;
+
+ qmi_set(&data_req, link_layer_protocol, link_modes[i].val);
+ qmi_set_wda_set_data_format_request(msg, &data_req);
+ return QMI_CMD_REQUEST;
+ }
+
+ uqmi_add_error("Invalid auth mode (valid: 802.3, raw-ip)");
+ return QMI_CMD_EXIT;
+}
+
+static void
+cmd_wda_get_data_format_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+ struct qmi_wda_get_data_format_response res;
+ const char *name = "unknown";
+ int i;
+
+ qmi_parse_wda_get_data_format_response(msg, &res);
+ for (i = 0; i < ARRAY_SIZE(link_modes); i++) {
+ if (link_modes[i].val != res.data.link_layer_protocol)
+ continue;
+
+ name = link_modes[i].name;
+ break;
+ }
+
+ blobmsg_add_string(&status, NULL, name);
+}
+
+static enum qmi_cmd_result
+cmd_wda_get_data_format_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ qmi_set_wda_get_data_format_request(msg);
+ return QMI_CMD_REQUEST;
+}
--- /dev/null
+#define __uqmi_wda_commands \
+ __uqmi_command(wda_set_data_format, wda-set-data-format, required, QMI_SERVICE_WDA), \
+ __uqmi_command(wda_get_data_format, wda-get-data-format, no, QMI_SERVICE_WDA)
+
+
+#define wda_helptext \
+ " --wda-set-data-format <type>: Set data format (type: 802.3|raw-ip)\n" \
+ " --wda-get-data-format: Get data format\n" \
+
#include "commands-dms.c"
#include "commands-nas.c"
#include "commands-wms.c"
+#include "commands-wda.c"
#define __uqmi_command(_name, _optname, _arg, _type) \
[__UQMI_COMMAND_##_name] = { \
#include "commands-dms.h"
#include "commands-nas.h"
#include "commands-wms.h"
+#include "commands-wda.h"
enum qmi_cmd_result {
QMI_CMD_DONE,
__uqmi_wds_commands, \
__uqmi_dms_commands, \
__uqmi_nas_commands, \
- __uqmi_wms_commands
+ __uqmi_wms_commands, \
+ __uqmi_wda_commands
#define __uqmi_command(_name, _optname, _arg, _option) __UQMI_COMMAND_##_name
enum uqmi_command {
{ "pds", QMI_SERVICE_PDS },
{ "wds", QMI_SERVICE_WDS },
{ "wms", QMI_SERVICE_WMS },
+ { "wda", QMI_SERVICE_WDA },
};
int i;
dms_helptext
nas_helptext
wms_helptext
+ wda_helptext
"\n", progname);
return 1;
}
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * libqmi-glib -- GLib/GIO based library to control QMI devices
+ *
+ * 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.
+ *
+ * Copyright (C) 2014 Aleksander Morgado <aleksander@aleksander.es>
+ */
+
+#ifndef _LIBQMI_GLIB_QMI_ENUMS_WDA_H_
+#define _LIBQMI_GLIB_QMI_ENUMS_WDA_H_
+
+/**
+ * SECTION: qmi-enums-wda
+ * @title: WDA enumerations and flags
+ *
+ * This section defines enumerations and flags used in the WDA service
+ * interface.
+ */
+
+/**
+ * QmiWdaLinkLayerProtocol:
+ * @QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN: Unknown.
+ * @QMI_WDA_LINK_LAYER_PROTOCOL_802_3: 802.3 ethernet mode.
+ * @QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP: Raw IP mode.
+ *
+ * Link layer protocol.
+ */
+typedef enum {
+ QMI_WDA_LINK_LAYER_PROTOCOL_UNKNOWN = 0x00,
+ QMI_WDA_LINK_LAYER_PROTOCOL_802_3 = 0x01,
+ QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP = 0x02,
+} QmiWdaLinkLayerProtocol;
+
+/**
+ * QmiWdaDataAggregationProtocol:
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED: Disabled.
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_TLP: TLP enabled.
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QC_NCM: QC NCM enabled.
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_MBIM: MBIM enabled.
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_RNDIS: RNDIS enabled.
+ * @QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAP: QMAP enabled.
+ *
+ * Data aggregation protocol in uplink or downlink.
+ */
+typedef enum {
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_DISABLED = 0x00,
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_TLP = 0x01,
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_QC_NCM = 0x02,
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_MBIM = 0x03,
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_RNDIS = 0x04,
+ QMI_WDA_DATA_AGGREGATION_PROTOCOL_QMAP = 0x05,
+} QmiWdaDataAggregationProtocol;
+
+#endif /* _LIBQMI_GLIB_QMI_ENUMS_WDA_H_ */
#include "qmi-enums-wms.h"
#include "qmi-message-wms.h"
+#include "qmi-enums-wda.h"
+#include "qmi-message-wda.h"
+
#define qmi_set(_data, _field, _val) \
do { \
(_data)->set._field = 1; \
__qmi_service(QMI_SERVICE_RMTFS), \
__qmi_service(QMI_SERVICE_CAT), \
__qmi_service(QMI_SERVICE_RMS), \
- __qmi_service(QMI_SERVICE_OMA)
+ __qmi_service(QMI_SERVICE_OMA), \
+ __qmi_service(QMI_SERVICE_WDA)
#define __qmi_service(_n) __##_n
enum {