diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-07 19:51:49 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-04-17 15:19:38 +0200 |
commit | 6b379e525dbcc117a82fb367a6db2146042880ab (patch) | |
tree | 71db4ce7f6cb3b30f8d477e5139164520d951487 /src | |
parent | 00ec505e741eed62a04d2d810dcbb9c841a09445 (diff) | |
download | ModemManager-6b379e525dbcc117a82fb367a6db2146042880ab.tar.gz |
plugin: limit cdc-wdm port probing types depending on the available drivers
We'll use the given device drivers as a hint of what we can or should probe.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index dea608e40..9c280058c 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; } |