aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r--src/mm-plugin.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index dea608e4..9c280058 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -628,6 +628,21 @@ mm_plugin_supports_port_finish (MMPlugin *self,
return (MMPluginSupportsResult) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)));
}
+static gboolean
+find_driver_in_device (MMDevice *device,
+ const gchar *driver)
+{
+ const gchar **device_drivers;
+ guint i;
+
+ device_drivers = mm_device_get_drivers (device);
+ for (i = 0; device_drivers[i]; i++) {
+ if (g_str_equal (driver, device_drivers[i]))
+ return TRUE;
+ }
+ return FALSE;
+}
+
void
mm_plugin_supports_port (MMPlugin *self,
MMDevice *device,
@@ -710,9 +725,9 @@ mm_plugin_supports_port (MMPlugin *self,
} else {
/* cdc-wdm ports... */
probe_run_flags = MM_PORT_PROBE_NONE;
- if (self->priv->qmi)
+ if (self->priv->qmi && find_driver_in_device (device, "qmi_wwan"))
probe_run_flags |= MM_PORT_PROBE_QMI;
- if (self->priv->mbim)
+ if (self->priv->mbim && find_driver_in_device (device, "cdc_mbim"))
probe_run_flags |= MM_PORT_PROBE_MBIM;
}