@@ -366,6 +366,7 @@ qmi_sources = drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c \
drivers/qmimodem/pds.h \
drivers/qmimodem/common.h \
drivers/qmimodem/wda.h \
+ drivers/qmimodem/wda.c \
drivers/qmimodem/wds.c \
drivers/qmimodem/voice.h
@@ -76,3 +76,8 @@
#define QMI_LTE_BAND_MASK_EUTRA_41 0x0000010000000000
#define QMI_LTE_BAND_MASK_EUTRA_42 0x0000020000000000
#define QMI_LTE_BAND_MASK_EUTRA_43 0x0000040000000000
+
+struct qmi_endpoint_info {
+ uint32_t endpoint_type;
+ uint32_t interface_number;
+} __attribute__((packed));
@@ -17,6 +17,7 @@
#include <ofono/gprs-context.h>
#include "qmi.h"
+#include "common.h"
#include "wds.h"
#include "util.h"
@@ -715,10 +716,7 @@ static int qmi_gprs_context_bind_mux(struct ofono_gprs_context *gc,
struct qmi_param *param;
const char *interface_number;
const char *bus;
- struct {
- uint32_t endpoint_type;
- uint32_t interface_number;
- } __attribute__((packed)) endpoint_info;
+ struct qmi_endpoint_info endpoint_info;
uint8_t u8;
bus = ofono_modem_get_string(modem, "Bus");
new file mode 100644
@@ -0,0 +1,51 @@
+/*
+ * oFono - Open Source Telephony
+ * Copyright (C) 2024 Cruise, LLC
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <stdint.h>
+#include <stddef.h>
+
+#include <ell/ell.h>
+
+#include "src/common.h"
+
+#include "qmi.h"
+#include "common.h"
+#include "wda.h"
+
+uint16_t qmi_wda_set_data_format(struct qmi_service *wda,
+ const struct qmi_endpoint_info *endpoint_info,
+ const struct qmi_wda_data_format *format,
+ qmi_service_result_func_t func,
+ void *user_data, qmi_destroy_func_t destroy)
+{
+ static const uint8_t PARAM_LL_PROTO = 0x11;
+ static const uint8_t PARAM_UL_AGGREGATION_PROTOCOL = 0x12;
+ static const uint8_t PARAM_DL_AGGREGATION_PROTOCOL = 0x13;
+ static const uint8_t PARAM_DL_MAX_DATAGRAMS = 0x15;
+ static const uint8_t PARAM_DL_MAX_SIZE = 0x16;
+ static const uint8_t PARAM_EP_INFO = 0x17;
+ struct qmi_param *param = qmi_param_new();
+ uint32_t req_id;
+
+ qmi_param_append_uint32(param, PARAM_LL_PROTO, format->ll_protocol);
+ qmi_param_append_uint32(param, PARAM_UL_AGGREGATION_PROTOCOL,
+ format->ul_aggregation_protocol);
+ qmi_param_append_uint32(param, PARAM_DL_AGGREGATION_PROTOCOL,
+ format->dl_aggregation_protocol);
+ qmi_param_append_uint32(param, PARAM_DL_MAX_DATAGRAMS,
+ format->dl_max_datagrams);
+ qmi_param_append_uint32(param, PARAM_DL_MAX_SIZE, format->dl_max_size);
+ qmi_param_append(param, PARAM_EP_INFO,
+ sizeof(*endpoint_info), endpoint_info);
+
+ req_id = qmi_service_send(wda, QMI_WDA_SET_DATA_FORMAT,
+ param, func, user_data, destroy);
+ if (!req_id)
+ qmi_param_free(param);
+
+ return req_id;
+}
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0-only
*/
+struct qmi_endpoint_info;
+
#define QMI_WDA_SET_DATA_FORMAT 32 /* Set data format */
#define QMI_WDA_GET_DATA_FORMAT 33 /* Get data format */
@@ -16,3 +18,24 @@ enum qmi_wda_data_link_protocol {
QMI_WDA_DATA_LINK_PROTOCOL_802_3 = 0x01,
QMI_WDA_DATA_LINK_PROTOCOL_RAW_IP = 0x02,
};
+
+enum qmi_wda_aggregation_protocol {
+ QMI_WDA_AGGREGATION_PROTOCOL_DISABLED = 0x00,
+ QMI_WDA_AGGREGATION_PROTOCOL_QMAP = 0x05,
+ QMI_WDA_AGGREGATION_PROTOCOL_QMAPV4 = 0x08,
+ QMI_WDA_AGGREGATION_PROTOCOL_QMAPV5 = 0x09,
+};
+
+struct qmi_wda_data_format {
+ uint32_t ll_protocol;
+ uint32_t ul_aggregation_protocol;
+ uint32_t dl_aggregation_protocol;
+ uint32_t dl_max_datagrams;
+ uint32_t dl_max_size;
+};
+
+uint16_t qmi_wda_set_data_format(struct qmi_service *wda,
+ const struct qmi_endpoint_info *endpoint_info,
+ const struct qmi_wda_data_format *format,
+ qmi_service_result_func_t func,
+ void *user_data, qmi_destroy_func_t destroy);