aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Palmas <dnlplm@gmail.com>2022-05-19 15:43:18 +0200
committerDaniele Palmas <dnlplm@gmail.com>2022-08-11 09:48:38 +0200
commit15b031ce6d78a60fbf33851298a9bbaee1c3a7fa (patch)
treeb80bd2a581a431ea20fa91479d10ea9dffa8c143
parenta97b58ebf742c3bae4fab73d66f35c959ddc0639 (diff)
bearer-mbim: enable multiplex support for wwan devices
-rw-r--r--configure.ac2
-rw-r--r--meson.build2
-rw-r--r--src/mm-bearer-mbim.c3
-rw-r--r--src/mm-device.c21
4 files changed, 23 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 5a73c474..0749e0f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -413,7 +413,7 @@ dnl-----------------------------------------------------------------------------
dnl MBIM support (enabled by default)
dnl
-LIBMBIM_VERSION=1.27.7
+LIBMBIM_VERSION=1.27.8
AC_ARG_WITH(mbim, AS_HELP_STRING([--without-mbim], [Build without MBIM support]), [], [with_mbim=yes])
AM_CONDITIONAL(WITH_MBIM, test "x$with_mbim" = "xyes")
diff --git a/meson.build b/meson.build
index 0f6ae409..0bdc9d03 100644
--- a/meson.build
+++ b/meson.build
@@ -243,7 +243,7 @@ config_h.set('WITH_AT_COMMAND_VIA_DBUS', enable_at_command_via_dbus)
# MBIM support (enabled by default)
enable_mbim = get_option('mbim')
if enable_mbim
- mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.7')
+ mbim_glib_dep = dependency('mbim-glib', version: '>= 1.27.8')
endif
config_h.set('WITH_MBIM', enable_mbim)
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index 057f006a..522330a6 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -1340,9 +1340,6 @@ load_settings_from_bearer (MMBearerMbim *self,
if (!g_strcmp0 (data_port_driver, "mhi_net"))
multiplex_supported = FALSE;
- if (mm_kernel_device_get_wwandev_sysfs_path (mm_port_peek_kernel_device (ctx->data)))
- multiplex_supported = FALSE;
-
/* If no multiplex setting given by the user, assume none */
multiplex = mm_bearer_properties_get_multiplex (properties);
if (multiplex == MM_BEARER_MULTIPLEX_SUPPORT_UNKNOWN) {
diff --git a/src/mm-device.c b/src/mm-device.c
index 33528946..c2946bd9 100644
--- a/src/mm-device.c
+++ b/src/mm-device.c
@@ -234,6 +234,27 @@ mm_device_grab_port (MMDevice *self,
error->message);
return;
}
+ if (!g_strcmp0 ("net", mm_kernel_device_get_subsystem (kernel_port)) &&
+ mm_kernel_device_get_wwandev_sysfs_path (kernel_port)) {
+ /* This is a wwan netdevice, possibly a multiplexed one.
+ * Multiplexed wwan netdevices do not have a lower device, so they won't fall in the
+ * previous check verified for virtual ports, but require the same management.
+ * However, we need to make sure that the arrived netdevice is not the default one that
+ * instead requires the standard flow: for doing this we check that the name of the
+ * arrived netdevice is not the default one, found in the wwandev_sysfs_path */
+ if (!g_strstr_len (mm_kernel_device_get_wwandev_sysfs_path (kernel_port),
+ -1,
+ mm_kernel_device_get_name (kernel_port))) {
+ g_autoptr(GError) error = NULL;
+
+ mm_obj_dbg (self, "grabbing wwan multiplexed device %s", mm_kernel_device_get_name (kernel_port));
+ if (self->priv->modem && !mm_base_modem_grab_link_port (self->priv->modem, kernel_port, &error))
+ mm_obj_dbg (self, "fully ignoring link port %s from now on: %s",
+ mm_kernel_device_get_name (kernel_port),
+ error->message);
+ return;
+ }
+ }
/* Get the vendor/product IDs out of the first one that gives us
* some valid value (it seems we may get NULL reported for VID in QMI