From 947af13a5560b17a897a18616f6af51d1facc0b7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:05:23 +0200 Subject: patch libiqm --- patches/attachment-0003.patch | 446 ++++++++++++++++++++++++++++++++++++++++++ patches/attachment-0004.patch | 329 +++++++++++++++++++++++++++++++ patches/attachment-0005.patch | 50 +++++ 3 files changed, 825 insertions(+) create mode 100644 patches/attachment-0003.patch create mode 100644 patches/attachment-0004.patch create mode 100644 patches/attachment-0005.patch (limited to 'patches') diff --git a/patches/attachment-0003.patch b/patches/attachment-0003.patch new file mode 100644 index 00000000..35923a90 --- /dev/null +++ b/patches/attachment-0003.patch @@ -0,0 +1,446 @@ +>From 35f6f9c86c3dc66f2855b513e389a99bbcbb74c4 Mon Sep 17 00:00:00 2001 +From: Collin McMillan +Date: Mon, 4 Apr 2016 11:33:46 +0200 +Subject: [PATCH] QMI via MBIM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + build-aux/mbim-codegen/Message.py | 8 ++++---- + build-aux/mbim-codegen/Struct.py | 8 ++++---- + data/Makefile.am | 3 ++- + src/libmbim-glib/generated/Makefile.am | 18 +++++++++++++++--- + src/libmbim-glib/libmbim-glib.h | 1 + + src/libmbim-glib/mbim-cid.c | 25 +++++++++++++++++++++---- + src/libmbim-glib/mbim-cid.h | 12 ++++++++++++ + src/libmbim-glib/mbim-message-private.h | 2 ++ + src/libmbim-glib/mbim-message.c | 31 +++++++++++++++++++------------ + src/libmbim-glib/mbim-uuid.c | 18 ++++++++++++++++-- + src/libmbim-glib/mbim-uuid.h | 11 +++++++++++ + 11 files changed, 107 insertions(+), 30 deletions(-) + +diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py +index aa4e7b7..e66335d 100644 +--- a/build-aux/mbim-codegen/Message.py ++++ b/build-aux/mbim-codegen/Message.py +@@ -394,13 +394,13 @@ class Message: + inner_template += (' {\n') + + if field['format'] == 'byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${field}, ${array_size});\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, TRUE, ${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, FALSE, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, TRUE, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array-no-offset': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, TRUE, ${field}, ${field}_size);\n') + elif field['format'] == 'uuid': + inner_template += (' _mbim_message_command_builder_append_uuid (builder, ${field});\n') + elif field['format'] == 'guint32': +diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py +index 495e22f..8797f3a 100644 +--- a/build-aux/mbim-codegen/Struct.py ++++ b/build-aux/mbim-codegen/Struct.py +@@ -498,14 +498,14 @@ class Struct: + if field['format'] == 'uuid': + inner_template = (' _mbim_struct_builder_append_uuid (builder, &(value->${field}));\n') + elif field['format'] == 'byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, value->${field}, ${array_size});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, TRUE, value->${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, FALSE, value->${field}, value->${field}_size);\n') + elif field['format'] == 'ref-byte-array': + if 'array-size-field' in field: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, value->${field}, value->${array_size_field});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, TRUE, value->${field}, value->${array_size_field});\n') + else: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, TRUE, value->${field}, value->${field}_size);\n') + elif field['format'] == 'guint32': + inner_template = (' _mbim_struct_builder_append_guint32 (builder, value->${field});\n') + elif field['format'] == 'guint32-array': +diff --git a/data/Makefile.am b/data/Makefile.am +index 111e028..8c8891a 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -10,4 +10,5 @@ EXTRA_DIST = \ + mbim-service-dss.json \ + mbim-service-ms-firmware-id.json \ + mbim-service-ms-host-shutdown.json \ +- mbim-service-proxy-control.json ++ mbim-service-proxy-control.json \ ++ mbim-service-qmi.json +diff --git a/src/libmbim-glib/generated/Makefile.am b/src/libmbim-glib/generated/Makefile.am +index ce81a71..c8b153a 100644 +--- a/src/libmbim-glib/generated/Makefile.am ++++ b/src/libmbim-glib/generated/Makefile.am +@@ -12,7 +12,8 @@ GENERATED_H = \ + mbim-dss.h \ + mbim-ms-firmware-id.h \ + mbim-ms-host-shutdown.h \ +- mbim-proxy-control.h ++ mbim-proxy-control.h \ ++ mbim-qmi.h + + GENERATED_C = \ + mbim-error-types.c \ +@@ -27,7 +28,8 @@ GENERATED_C = \ + mbim-dss.c \ + mbim-ms-firmware-id.c \ + mbim-ms-host-shutdown.c \ +- mbim-proxy-control.c ++ mbim-proxy-control.c \ ++ mbim-qmi.c + + GENERATED_SECTIONS = \ + mbim-basic-connect.sections \ +@@ -39,7 +41,8 @@ GENERATED_SECTIONS = \ + mbim-dss.sections \ + mbim-ms-firmware-id.sections \ + mbim-ms-host-shutdown.sections \ +- mbim-proxy-control.sections ++ mbim-proxy-control.sections \ ++ mbim-qmi.sections + + # Error types + mbim-error-types.h: $(top_srcdir)/src/libmbim-glib/mbim-errors.h $(top_srcdir)/build-aux/templates/mbim-error-types-template.h +@@ -170,6 +173,15 @@ mbim-proxy-control.h mbim-proxy-control.c mbim-proxy-control.sections: $(top_src + --input $(top_srcdir)/data/mbim-service-proxy-control.json \ + --output mbim-proxy-control + ++# QMI-over-MBIM service ++mbim-qmi.h mbim-qmi.c mbim-qmi.sections: $(top_srcdir)/data/mbim-service-qmi.json $(top_srcdir)/build-aux/mbim-codegen/*.py $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen ++ $(AM_V_GEN) \ ++ rm -f mbim-qmi.h && \ ++ rm -f mbim-qmi.c && \ ++ $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \ ++ --input $(top_srcdir)/data/mbim-service-qmi.json \ ++ --output mbim-qmi ++ + BUILT_SOURCES = $(GENERATED_H) $(GENERATED_C) + + nodist_libmbim_glib_generated_la_SOURCES = \ +diff --git a/src/libmbim-glib/libmbim-glib.h b/src/libmbim-glib/libmbim-glib.h +index b41122b..88d0be8 100644 +--- a/src/libmbim-glib/libmbim-glib.h ++++ b/src/libmbim-glib/libmbim-glib.h +@@ -48,6 +48,7 @@ + #include "mbim-dss.h" + #include "mbim-ms-firmware-id.h" + #include "mbim-ms-host-shutdown.h" ++#include "mbim-qmi.h" + + /* backwards compatibility */ + #include "mbim-compat.h" +diff --git a/src/libmbim-glib/mbim-cid.c b/src/libmbim-glib/mbim-cid.c +index 50dc4f1..cbfd81e 100644 +--- a/src/libmbim-glib/mbim-cid.c ++++ b/src/libmbim-glib/mbim-cid.c +@@ -38,6 +38,9 @@ typedef struct { + gboolean notify; + } CidConfig; + ++/* Note: MBIM_SERVICE_LAST from mbim-uuid.c should probably be visible ++ * here somehow, since MBIM_SERVICE_QMI must be used in the error checks */ ++ + /* Note: index of the array is CID-1 */ + #define MBIM_CID_BASIC_CONNECT_LAST MBIM_CID_BASIC_CONNECT_MULTICARRIER_PROVIDERS + static const CidConfig cid_basic_connect_config [MBIM_CID_BASIC_CONNECT_LAST] = { +@@ -132,6 +135,12 @@ static const CidConfig cid_proxy_control_config [MBIM_CID_PROXY_CONTROL_LAST] = + { TRUE, FALSE, FALSE }, /* MBIM_CID_PROXY_CONTROL_CONFIGURATION */ + }; + ++/* Note: index of the array is CID-1 */ ++#define MBIM_CID_QMI_LAST MBIM_CID_QMI_MSG ++static const CidConfig cid_qmi_config [MBIM_CID_QMI_LAST] = { ++ { TRUE, FALSE, FALSE }, /* MBIM_CID_QMI_MSG */ ++}; ++ + /** + * mbim_cid_can_set: + * @service: a #MbimService. +@@ -149,7 +158,7 @@ mbim_cid_can_set (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -172,6 +181,8 @@ mbim_cid_can_set (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].set; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].set; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].set; + default: + g_assert_not_reached (); + return FALSE; +@@ -195,7 +206,7 @@ mbim_cid_can_query (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -218,6 +229,8 @@ mbim_cid_can_query (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].query; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].query; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].query; + default: + g_assert_not_reached (); + return FALSE; +@@ -241,7 +254,7 @@ mbim_cid_can_notify (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -264,6 +277,8 @@ mbim_cid_can_notify (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].notify; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].notify; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].notify; + default: + g_assert_not_reached (); + return FALSE; +@@ -288,7 +303,7 @@ mbim_cid_get_printable (MbimService service, + g_return_val_if_fail (cid > 0, NULL); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, NULL); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, NULL); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, NULL); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -311,6 +326,8 @@ mbim_cid_get_printable (MbimService service, + return mbim_cid_ms_host_shutdown_get_string (cid); + case MBIM_SERVICE_PROXY_CONTROL: + return mbim_cid_proxy_control_get_string (cid); ++ case MBIM_SERVICE_QMI: ++ return mbim_cid_qmi_get_string (cid); + default: + g_assert_not_reached (); + return FALSE; +diff --git a/src/libmbim-glib/mbim-cid.h b/src/libmbim-glib/mbim-cid.h +index 3315340..36930cd 100644 +--- a/src/libmbim-glib/mbim-cid.h ++++ b/src/libmbim-glib/mbim-cid.h +@@ -219,6 +219,18 @@ typedef enum { + MBIM_CID_PROXY_CONTROL_CONFIGURATION = 1 + } MbimCidProxyControl; + ++/** ++ * MbimCidQmi: ++ * @MBIM_CID_QMI_UNKNOWN: Unknown command. ++ * @MBIM_CID_QMI_MSG: Configuration. ++ * ++ * MBIM commands in the %MBIM_SERVICE_QMI service. ++ */ ++typedef enum { ++ MBIM_CID_QMI_UNKNOWN = 0, ++ MBIM_CID_QMI_MSG = 1 ++} MbimCidQmi; ++ + /* Command helpers */ + + gboolean mbim_cid_can_set (MbimService service, +diff --git a/src/libmbim-glib/mbim-message-private.h b/src/libmbim-glib/mbim-message-private.h +index b5606e0..0459d00 100644 +--- a/src/libmbim-glib/mbim-message-private.h ++++ b/src/libmbim-glib/mbim-message-private.h +@@ -177,6 +177,7 @@ GByteArray *_mbim_struct_builder_complete (MbimStructBuilder + void _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_struct_builder_append_uuid (MbimStructBuilder *builder, +@@ -225,6 +226,7 @@ MbimMessage *_mbim_message_command_builder_complete (M + void _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_message_command_builder_append_uuid (MbimMessageCommandBuilder *builder, +diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c +index b625ee5..7ab28f0 100644 +--- a/src/libmbim-glib/mbim-message.c ++++ b/src/libmbim-glib/mbim-message.c +@@ -492,6 +492,7 @@ void + _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len) + { +@@ -501,12 +502,14 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + */ + if (!with_offset && !with_length) { + g_byte_array_append (builder->fixed_buffer, buffer, buffer_len); +- while (buffer_len % 4 != 0) { +- const guint8 padding = 0; +- +- g_byte_array_append (builder->fixed_buffer, &padding, 1); +- buffer_len++; +- } ++ if(permit_padding) { ++ while (buffer_len % 4 != 0) { ++ const guint8 padding = 0; ++ ++ g_byte_array_append (builder->fixed_buffer, &padding, 1); ++ buffer_len++; ++ } ++ } + return; + } + +@@ -550,12 +553,15 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + if (buffer_len) { + g_byte_array_append (builder->variable_buffer, (const guint8 *)buffer, (guint)buffer_len); + +- while (buffer_len % 4 != 0) { +- const guint8 padding = 0; ++ /* Note: adding zero padding causes trouble for QMI service */ ++ if(permit_padding) { ++ while (buffer_len % 4 != 0) { ++ const guint8 padding = 0; + +- g_byte_array_append (builder->variable_buffer, &padding, 1); +- buffer_len++; +- } ++ g_byte_array_append (builder->variable_buffer, &padding, 1); ++ buffer_len++; ++ } ++ } + } + } + +@@ -824,10 +830,11 @@ void + _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len) + { +- _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, buffer, buffer_len); ++ _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, permit_padding, buffer, buffer_len); + } + + void +diff --git a/src/libmbim-glib/mbim-uuid.c b/src/libmbim-glib/mbim-uuid.c +index 6497645..cdc9ba3 100644 +--- a/src/libmbim-glib/mbim-uuid.c ++++ b/src/libmbim-glib/mbim-uuid.c +@@ -38,7 +38,7 @@ + * This section defines the data type for unique identifiers. + */ + +-#define MBIM_SERVICE_LAST MBIM_SERVICE_PROXY_CONTROL ++#define MBIM_SERVICE_LAST MBIM_SERVICE_QMI + + /*****************************************************************************/ + +@@ -229,6 +229,15 @@ static const MbimUuid uuid_proxy_control = { + .e = { 0xd7, 0x1d , 0xbe, 0xfb, 0xb3, 0x9b } + }; + ++/* Note: this UUID is likely to work only for Sierra modems */ ++static const MbimUuid uuid_qmi = { ++ .a = { 0xd1, 0xa3, 0x0b, 0xc2 }, ++ .b = { 0xf9, 0x7a }, ++ .c = { 0x6e, 0x43 }, ++ .d = { 0xbf, 0x65 }, ++ .e = { 0xc7, 0xe2 , 0x4f, 0xb0, 0xf0, 0xd3 } ++}; ++ + static GList *mbim_custom_service_list = NULL; + + typedef struct { +@@ -367,7 +376,7 @@ mbim_uuid_from_service (MbimService service) + GList *l; + + g_return_val_if_fail (service >= MBIM_SERVICE_INVALID && +- (service <= MBIM_SERVICE_PROXY_CONTROL || ++ (service <= MBIM_SERVICE_LAST || + mbim_service_id_is_custom (service)), + &uuid_invalid); + +@@ -394,6 +403,8 @@ mbim_uuid_from_service (MbimService service) + return &uuid_ms_host_shutdown; + case MBIM_SERVICE_PROXY_CONTROL: + return &uuid_proxy_control; ++ case MBIM_SERVICE_QMI: ++ return &uuid_qmi; + default: + for (l = mbim_custom_service_list; l != NULL; l = l->next) { + if (service == ((MbimCustomService *)l->data)->service_id) +@@ -446,6 +457,9 @@ mbim_uuid_to_service (const MbimUuid *uuid) + if (mbim_uuid_cmp (uuid, &uuid_proxy_control)) + return MBIM_SERVICE_PROXY_CONTROL; + ++ if (mbim_uuid_cmp (uuid, &uuid_qmi)) ++ return MBIM_SERVICE_QMI; ++ + for (l = mbim_custom_service_list; l != NULL; l = l->next) { + if (mbim_uuid_cmp (&((MbimCustomService *)l->data)->uuid, uuid)) + return ((MbimCustomService *)l->data)->service_id; +diff --git a/src/libmbim-glib/mbim-uuid.h b/src/libmbim-glib/mbim-uuid.h +index 91def98..d42a256 100644 +--- a/src/libmbim-glib/mbim-uuid.h ++++ b/src/libmbim-glib/mbim-uuid.h +@@ -71,6 +71,7 @@ gboolean mbim_uuid_from_printable (const gchar *str, + * @MBIM_SERVICE_MS_FIRMWARE_ID: Microsoft Firmware ID service. + * @MBIM_SERVICE_MS_HOST_SHUTDOWN: Microsoft Host Shutdown service. + * @MBIM_SERVICE_PROXY_CONTROL: Proxy Control service. ++ * @MBIM_SERVICE_QMI: QMI-over-MBIM service. + * + * Enumeration of the generic MBIM services. + */ +@@ -86,6 +87,7 @@ typedef enum { + MBIM_SERVICE_MS_FIRMWARE_ID = 8, + MBIM_SERVICE_MS_HOST_SHUTDOWN = 9, + MBIM_SERVICE_PROXY_CONTROL = 10, ++ MBIM_SERVICE_QMI = 11 + /* Note: update MBIM_SERVICE_LAST when a new value is added */ + } MbimService; + +@@ -188,6 +190,15 @@ typedef enum { + */ + #define MBIM_UUID_PROXY_CONTROL mbim_uuid_from_service (MBIM_SERVICE_PROXY_CONTROL) + ++/** ++ * MBIM_UUID_QMI: ++ * ++ * Get the UUID of the %MBIM_SERVICE_QMI service. ++ * ++ * Returns: (transfer none): a #MbimUuid. ++ */ ++#define MBIM_UUID_QMI mbim_uuid_from_service (MBIM_SERVICE_QMI) ++ + const gchar *mbim_service_lookup_name (guint service); + + guint mbim_register_custom_service (const MbimUuid *uuid, +-- +2.1.4 + diff --git a/patches/attachment-0004.patch b/patches/attachment-0004.patch new file mode 100644 index 00000000..b1110feb --- /dev/null +++ b/patches/attachment-0004.patch @@ -0,0 +1,329 @@ +>From 4ffa5693bcaf283bc3c8ea7808226eb6e92aaaf5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 4 Apr 2016 14:44:01 +0200 +Subject: [PATCH 1/2] libqmi: support MBIM EXT_QMUX service +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + configure.ac | 13 ++++ + src/libqmi-glib/Makefile.am | 4 +- + src/libqmi-glib/qmi-device.c | 156 ++++++++++++++++++++++++++++++++++++++++++- + src/libqmi-glib/qmi-device.h | 4 +- + 4 files changed, 172 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3e05993..fe6225e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -95,6 +95,18 @@ fi + + AM_CONDITIONAL([QMI_USERNAME_ENABLED], [test "x$QMI_USERNAME_ENABLED" = "xyes"]) + ++# MBIM QMUX service support ++AC_ARG_ENABLE(mbim-qmux, ++ AS_HELP_STRING([--enable-mbim-qmux], [support QMI over MBIM QMUX service])) ++if test -n "$enable_mbim_qmux"; then ++ PKG_CHECK_MODULES(MBIM, mbim-glib >= 1.13) ++ MBIM_CFLAGS="$MBIM_CFLAGS -DMBIM_QMUX" ++ AC_SUBST(MBIM_CFLAGS) ++ AC_SUBST(MBIM_LIBS) ++fi ++ ++AM_CONDITIONAL(MBIM_QMUX, [test -n "$MBIM_CFLAGS"]) ++ + # udev base directory + AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is])) + if test -n "$with_udev_base_dir" ; then +@@ -146,4 +158,5 @@ echo " + udev base directory: ${UDEV_BASE_DIR} + Documentation: ${enable_gtk_doc} + QMI username: ${QMI_USERNAME_ENABLED} (${QMI_USERNAME}) ++ QMUX over MBIM: ${enable_mbim_qmux} + " +diff --git a/src/libqmi-glib/Makefile.am b/src/libqmi-glib/Makefile.am +index b24e3ae..6ff4e66 100644 +--- a/src/libqmi-glib/Makefile.am ++++ b/src/libqmi-glib/Makefile.am +@@ -5,6 +5,7 @@ lib_LTLIBRARIES = libqmi-glib.la + + libqmi_glib_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ ++ $(MBIM_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/src/libqmi-glib \ +@@ -39,7 +40,8 @@ libqmi_glib_la_SOURCES = \ + + libqmi_glib_la_LIBADD = \ + ${top_builddir}/src/libqmi-glib/generated/libqmi-glib-generated.la \ +- $(GLIB_LIBS) ++ $(GLIB_LIBS) \ ++ $(MBIM_LIBS) + + libqmi_glib_la_LDFLAGS = \ + -version-info $(QMI_GLIB_LT_CURRENT):$(QMI_GLIB_LT_REVISION):$(QMI_GLIB_LT_AGE) +diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c +index c4abbbc..6c46bca 100644 +--- a/src/libqmi-glib/qmi-device.c ++++ b/src/libqmi-glib/qmi-device.c +@@ -32,6 +32,10 @@ + #include + #include + ++#ifdef MBIM_QMUX ++#include ++#endif ++ + #include "qmi-device.h" + #include "qmi-message.h" + #include "qmi-ctl.h" +@@ -92,6 +96,10 @@ struct _QmiDevicePrivate { + gchar *path_display; + gboolean no_file_check; + gchar *proxy_path; ++ gboolean mbim_qmux; ++#ifdef MBIM_QMUX ++ MbimDevice *mbimdev; ++#endif + + /* WWAN interface */ + gboolean no_wwan_check; +@@ -1689,7 +1697,6 @@ input_ready_cb (GInputStream *istream, + self->priv->buffer = g_byte_array_sized_new (r); + g_byte_array_append (self->priv->buffer, buffer, r); + +- /* Try to parse input messages */ + parse_response (self); + + return TRUE; +@@ -2134,6 +2141,56 @@ internal_proxy_open_ready (QmiClientCtl *client_ctl, + device_open_context_step (ctx); + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_open_ready (MbimDevice *dev, ++ GAsyncResult *res, ++ DeviceOpenContext *ctx) ++{ ++ GError *error = NULL; ++ ++ if (!mbim_device_open_finish (dev, res, &error)) { ++ g_simple_async_result_take_error (ctx->result, error); ++ device_open_context_complete_and_free (ctx); ++ return; ++ } ++ g_debug ("[%s] MBIM device Open..", ++ ctx->self->priv->path_display); ++ ++ /* Go on */ ++ ctx->step++; ++ device_open_context_step (ctx); ++ return; ++} ++ ++static void ++mbim_device_new_ready (GObject *source, ++ GAsyncResult *res, ++ DeviceOpenContext *ctx) ++{ ++ MbimDeviceOpenFlags open_flags = MBIM_DEVICE_OPEN_FLAGS_NONE; ++ GError *error = NULL; ++ MbimDevice *device; ++ ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY) ++ open_flags |= MBIM_DEVICE_OPEN_FLAGS_PROXY; ++ device = mbim_device_new_finish (res, &error); ++ if (!device) { ++ g_simple_async_result_take_error (ctx->result, error); ++ device_open_context_complete_and_free (ctx); ++ return; ++ } ++ ctx->self->priv->mbimdev = device; ++ ++ mbim_device_open_full(device, ++ open_flags, ++ 30, ++ ctx->cancellable, ++ (GAsyncReadyCallback)mbim_device_open_ready, ++ ctx); ++} ++#endif ++ + static void + create_iostream_ready (QmiDevice *self, + GAsyncResult *res, +@@ -2166,6 +2223,20 @@ device_open_context_step (DeviceOpenContext *ctx) + /* Fall down */ + + case DEVICE_OPEN_CONTEXT_STEP_CREATE_IOSTREAM: ++#ifdef MBIM_QMUX ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) { ++ GFile *file; ++ ++ ctx->self->priv->mbim_qmux = TRUE; ++ file = g_file_new_for_path (ctx->self->priv->path); ++ mbim_device_new (file, ++ ctx->cancellable, ++ (GAsyncReadyCallback)mbim_device_new_ready, ++ ctx); ++ g_object_unref (file); ++ return; ++ } ++#endif + create_iostream (ctx->self, + !!(ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY), + (GAsyncReadyCallback)create_iostream_ready, +@@ -2174,7 +2245,8 @@ device_open_context_step (DeviceOpenContext *ctx) + + case DEVICE_OPEN_CONTEXT_STEP_FLAGS_PROXY: + /* Initialize communication with proxy? */ +- if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY) { ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY && ++ !(ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM)) { + QmiMessageCtlInternalProxyOpenInput *input; + + input = qmi_message_ctl_internal_proxy_open_input_new (); +@@ -2369,6 +2441,21 @@ destroy_iostream (QmiDevice *self, + return TRUE; + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_close_ready (MbimDevice *dev, ++ GAsyncResult *res) ++{ ++ GError *error = NULL; ++ ++ if (!mbim_device_close_finish (dev, res, &error)) { ++ g_printerr ("error: couldn't close device: %s", error->message); ++ g_error_free (error); ++ } else ++ g_debug ("Device closed"); ++} ++#endif ++ + /** + * qmi_device_close: + * @self: a #QmiDevice +@@ -2386,6 +2473,15 @@ qmi_device_close (QmiDevice *self, + { + g_return_val_if_fail (QMI_IS_DEVICE (self), FALSE); + ++#ifdef MBIM_QMUX ++ if (self->priv->mbim_qmux) ++ mbim_device_close (self->priv->mbimdev, ++ 15, ++ NULL, ++ (GAsyncReadyCallback) mbim_device_close_ready, ++ NULL); ++ else ++#endif + if (!destroy_iostream (self, error)) { + g_prefix_error (error, "Cannot close QMI device: "); + return FALSE; +@@ -2394,6 +2490,42 @@ qmi_device_close (QmiDevice *self, + return TRUE; + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_command_ready (MbimDevice *dev, ++ GAsyncResult *res, ++ QmiDevice *qmidev) ++{ ++ MbimMessage *response; ++ GError *error = NULL; ++ const guint8 *buf; ++ guint32 len; ++ ++ response = mbim_device_command_finish (dev, res, &error); ++ if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { ++ g_prefix_error (&error, "MBIM error: "); ++ // transaction_complete_and_free (tr, NULL, error); ++ g_error_free (error); ++ mbim_message_unref (response); ++ return; ++ } ++ ++ g_debug ("[%s] Received MBIM message\n", qmidev->priv->path_display); ++ ++ ++ /* get the information buffer */ ++ buf = mbim_message_command_done_get_raw_information_buffer (response, &len); ++ if (!G_UNLIKELY (qmidev->priv->buffer)) ++ qmidev->priv->buffer = g_byte_array_sized_new (len); ++ g_byte_array_append (qmidev->priv->buffer, buf, len); ++ ++ /* and parse it as QMI */ ++ parse_response(qmidev); ++ mbim_message_unref (response); ++ return; ++} ++#endif ++ + /*****************************************************************************/ + /* Command */ + +@@ -2462,7 +2594,7 @@ qmi_device_command (QmiDevice *self, + tr = transaction_new (self, message, cancellable, callback, user_data); + + /* Device must be open */ +- if (!self->priv->istream || !self->priv->ostream) { ++ if ((!self->priv->istream || !self->priv->ostream) && !self->priv->mbim_qmux) { + error = g_error_new (QMI_CORE_ERROR, + QMI_CORE_ERROR_WRONG_STATE, + "Device must be open to send commands"); +@@ -2531,6 +2663,24 @@ qmi_device_command (QmiDevice *self, + g_free (printable); + } + ++#ifdef MBIM_QMUX ++ /* wrap QMUX in MBIM? */ ++ if (self->priv->mbim_qmux) { ++ MbimMessage *mbim; ++ ++ mbim = (mbim_message_qmi_msg_set_new (raw_message_len, raw_message, &error)); ++ mbim_device_command (self->priv->mbimdev, ++ mbim, ++ 30, ++ NULL, /* cancellable */ ++ (GAsyncReadyCallback)mbim_device_command_ready, ++ self); ++ g_debug ("[%s] Message sent as MBIM\n", self->priv->path_display); ++ ++ /* FIXME: check errors, set proper MBIM TID */ ++ return; ++ } ++#endif + if (!g_output_stream_write_all (self->priv->ostream, + raw_message, + raw_message_len, +diff --git a/src/libqmi-glib/qmi-device.h b/src/libqmi-glib/qmi-device.h +index 58651e1..957efac 100644 +--- a/src/libqmi-glib/qmi-device.h ++++ b/src/libqmi-glib/qmi-device.h +@@ -97,6 +97,7 @@ gboolean qmi_device_is_open (QmiDevice *self); + * @QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER: set network port to transmit/receive QoS headers; mutually exclusive with @QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER + * @QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER: set network port to not transmit/receive QoS headers; mutually exclusive with @QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER + * @QMI_DEVICE_OPEN_FLAGS_PROXY: Try to open the port through the 'qmi-proxy'. ++ * @QMI_DEVICE_OPEN_FLAGS_MBIM: open an MBIM port with QMUX tunneling service + * + * Flags to specify which actions to be performed when the device is open. + */ +@@ -108,7 +109,8 @@ typedef enum { + QMI_DEVICE_OPEN_FLAGS_NET_RAW_IP = 1 << 3, + QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER = 1 << 4, + QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER = 1 << 5, +- QMI_DEVICE_OPEN_FLAGS_PROXY = 1 << 6 ++ QMI_DEVICE_OPEN_FLAGS_PROXY = 1 << 6, ++ QMI_DEVICE_OPEN_FLAGS_MBIM = 1 << 7 + } QmiDeviceOpenFlags; + + void qmi_device_open (QmiDevice *self, +-- +2.1.4 + diff --git a/patches/attachment-0005.patch b/patches/attachment-0005.patch new file mode 100644 index 00000000..ef455bce --- /dev/null +++ b/patches/attachment-0005.patch @@ -0,0 +1,50 @@ +>From cfa1df1527d81bf8cf3deeaf9ce341cd6c2a954c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 4 Apr 2016 14:47:01 +0200 +Subject: [PATCH 2/2] qmicli: support MBIM EXT_QMUX devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + src/qmicli/qmicli.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c +index 85c2faa..c591da2 100644 +--- a/src/qmicli/qmicli.c ++++ b/src/qmicli/qmicli.c +@@ -56,6 +56,7 @@ static gboolean device_open_version_info_flag; + static gboolean device_open_sync_flag; + static gchar *device_open_net_str; + static gboolean device_open_proxy_flag; ++static gboolean device_open_mbim_flag; + static gchar *client_cid_str; + static gboolean client_no_release_cid_flag; + static gboolean verbose_flag; +@@ -99,6 +100,10 @@ static GOptionEntry main_entries[] = { + "Request to use the 'qmi-proxy' proxy", + NULL + }, ++ { "device-open-mbim", 0, 0, G_OPTION_ARG_NONE, &device_open_mbim_flag, ++ "Open an MBIM device with EXT_QMUX support", ++ NULL ++ }, + { "device-open-net", 0, 0, G_OPTION_ARG_STRING, &device_open_net_str, + "Open device with specific link protocol and QoS flags", + "[net-802-3|net-raw-ip|net-qos-header|net-no-qos-header]" +@@ -603,7 +608,9 @@ device_new_ready (GObject *unused, + open_flags |= QMI_DEVICE_OPEN_FLAGS_SYNC; + if (device_open_proxy_flag) + open_flags |= QMI_DEVICE_OPEN_FLAGS_PROXY; +- if (device_open_net_str) ++ if (device_open_mbim_flag) ++ open_flags |= QMI_DEVICE_OPEN_FLAGS_MBIM; ++ if (device_open_net_str) + if (!qmicli_read_net_open_flags_from_string (device_open_net_str, &open_flags)) + exit (EXIT_FAILURE); + +-- +2.1.4 + -- cgit v1.2.3 From 69ea49f29e3e22d5de4e5fa09badff06cdabe9d9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:38:34 +0200 Subject: json! --- patches/attachment-0001.patch | 158 ++++++++++++++++++++++++++++++++++++++++++ patches/attachment.patch | 34 +++++++++ 2 files changed, 192 insertions(+) create mode 100644 patches/attachment-0001.patch create mode 100644 patches/attachment.patch (limited to 'patches') diff --git a/patches/attachment-0001.patch b/patches/attachment-0001.patch new file mode 100644 index 00000000..54882d44 --- /dev/null +++ b/patches/attachment-0001.patch @@ -0,0 +1,158 @@ +From 9550bd568371995acca003d6250ba4535db7d59f Mon Sep 17 00:00:00 2001 +From: Emil Ljungdahl +Date: Wed, 6 Apr 2016 19:25:27 +0200 +Subject: [PATCH 3/3] Avoid affecting the padding behavior for other services + than QMI + +--- + build-aux/mbim-codegen/Message.py | 9 +++++---- + build-aux/mbim-codegen/Struct.py | 9 +++++---- + data/mbim-service-qmi.json | 6 ++++-- + src/libmbim-glib/mbim-message-private.h | 4 ++-- + src/libmbim-glib/mbim-message.c | 10 +++++----- + 5 files changed, 21 insertions(+), 17 deletions(-) + +diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py +index e66335d..a569685 100644 +--- a/build-aux/mbim-codegen/Message.py ++++ b/build-aux/mbim-codegen/Message.py +@@ -381,6 +381,7 @@ class Message: + translations['struct'] = field['struct-type'] if 'struct-type' in field else '' + translations['struct_underscore'] = utils.build_underscore_name_from_camelcase (translations['struct']) + translations['array_size'] = field['array-size'] if 'array-size' in field else '' ++ translations['pad_array'] = field['pad-array'] if 'pad-array' in field else 'TRUE' + + inner_template = '' + if 'available-if' in field: +@@ -394,13 +395,13 @@ class Message: + inner_template += (' {\n') + + if field['format'] == 'byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, TRUE, ${field}, ${array_size});\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, ${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, FALSE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array-no-offset': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'uuid': + inner_template += (' _mbim_message_command_builder_append_uuid (builder, ${field});\n') + elif field['format'] == 'guint32': +diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py +index 8797f3a..84570de 100644 +--- a/build-aux/mbim-codegen/Struct.py ++++ b/build-aux/mbim-codegen/Struct.py +@@ -494,18 +494,19 @@ class Struct: + translations['field'] = utils.build_underscore_name_from_camelcase(field['name']) + translations['array_size'] = field['array-size'] if 'array-size' in field else '' + translations['array_size_field'] = utils.build_underscore_name_from_camelcase(field['array-size-field']) if 'array-size-field' in field else '' ++ translations['pad_array'] = field['pad-array'] if 'pad-array' in field else 'TRUE' + + if field['format'] == 'uuid': + inner_template = (' _mbim_struct_builder_append_uuid (builder, &(value->${field}));\n') + elif field['format'] == 'byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, TRUE, value->${field}, ${array_size});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, value->${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, FALSE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, value->${field}, value->${field}_size);\n') + elif field['format'] == 'ref-byte-array': + if 'array-size-field' in field: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, TRUE, value->${field}, value->${array_size_field});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, ${pad_array}, value->${field}, value->${array_size_field});\n') + else: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, TRUE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, ${pad_array}, value->${field}, value->${field}_size);\n') + elif field['format'] == 'guint32': + inner_template = (' _mbim_struct_builder_append_guint32 (builder, value->${field});\n') + elif field['format'] == 'guint32-array': +diff --git a/data/mbim-service-qmi.json b/data/mbim-service-qmi.json +index b764d01..c11857f 100644 +--- a/data/mbim-service-qmi.json ++++ b/data/mbim-service-qmi.json +@@ -9,7 +9,9 @@ + "service" : "QMI", + "type" : "Command", + "set" : [ { "name" : "QmiMsg", +- "format" : "unsized-byte-array" } ], ++ "format" : "unsized-byte-array", ++ "pad-array" : "FALSE" } ], + "response" : [ { "name" : "QMUX", +- "format" : "unsized-byte-array" } ] } ++ "format" : "unsized-byte-array", ++ "pad-array" : "FALSE" } ] } + ] +diff --git a/src/libmbim-glib/mbim-message-private.h b/src/libmbim-glib/mbim-message-private.h +index 0082026..79071d8 100644 +--- a/src/libmbim-glib/mbim-message-private.h ++++ b/src/libmbim-glib/mbim-message-private.h +@@ -177,7 +177,7 @@ GByteArray *_mbim_struct_builder_complete (MbimStructBuilder + void _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_struct_builder_append_uuid (MbimStructBuilder *builder, +@@ -226,7 +226,7 @@ MbimMessage *_mbim_message_command_builder_complete (M + void _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_message_command_builder_append_uuid (MbimMessageCommandBuilder *builder, +diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c +index ad67059..1a0d492 100644 +--- a/src/libmbim-glib/mbim-message.c ++++ b/src/libmbim-glib/mbim-message.c +@@ -492,7 +492,7 @@ void + _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len) + { +@@ -502,7 +502,7 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + */ + if (!with_offset && !with_length) { + g_byte_array_append (builder->fixed_buffer, buffer, buffer_len); +- if(permit_padding) { ++ if(pad_buffer) { + while (buffer_len % 4 != 0) { + const guint8 padding = 0; + +@@ -554,7 +554,7 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + g_byte_array_append (builder->variable_buffer, (const guint8 *)buffer, (guint)buffer_len); + + /* Note: adding zero padding causes trouble for QMI service */ +- if(permit_padding) { ++ if(pad_buffer) { + while (buffer_len % 4 != 0) { + const guint8 padding = 0; + +@@ -830,11 +830,11 @@ void + _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len) + { +- _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, permit_padding, buffer, buffer_len); ++ _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, pad_buffer, buffer, buffer_len); + } + + void +-- +1.9.1 + diff --git a/patches/attachment.patch b/patches/attachment.patch new file mode 100644 index 00000000..32d4b053 --- /dev/null +++ b/patches/attachment.patch @@ -0,0 +1,34 @@ +From 65d4a4bb0420794ece5082da2cac0b6771e75be7 Mon Sep 17 00:00:00 2001 +From: Emil Ljungdahl +Date: Wed, 6 Apr 2016 19:16:47 +0200 +Subject: [PATCH 2/3] Added json file lost in original qmi-over-mbim patch + +--- + data/mbim-service-qmi.json | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + create mode 100644 data/mbim-service-qmi.json + +diff --git a/data/mbim-service-qmi.json b/data/mbim-service-qmi.json +new file mode 100644 +index 0000000..b764d01 +--- /dev/null ++++ b/data/mbim-service-qmi.json +@@ -0,0 +1,15 @@ ++ ++[ ++ // ********************************************************************************* ++ { "type" : "Service", ++ "name" : "QMI" }, ++ ++ // ********************************************************************************* ++ { "name" : "msg", ++ "service" : "QMI", ++ "type" : "Command", ++ "set" : [ { "name" : "QmiMsg", ++ "format" : "unsized-byte-array" } ], ++ "response" : [ { "name" : "QMUX", ++ "format" : "unsized-byte-array" } ] } ++] +-- +1.9.1 + -- cgit v1.2.3