From a1d2f200214c7f691e4df535490f51c398ca32d4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 18 Sep 2011 23:23:18 +0200 Subject: [PATCH] plugin-base: avoid trying to probe 'net' devices Some devices support 'net' devices, which cannot be AT or QCDM probed. If the port being checked for support corresponds to an already existing modem, the port will be reported as SUPPORTED. If this is the first port of the modem being checked for support, we will just DEFER the support check until we get a modem created. --- src/mm-plugin-base.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c index b9eae160..4186d43e 100644 --- a/src/mm-plugin-base.c +++ b/src/mm-plugin-base.c @@ -603,6 +603,20 @@ supports_port (MMPlugin *plugin, goto out; } + /* Before launching any probing, check if the port is a net device (which + * cannot be probed). */ + if (g_str_equal (subsys, "net")) { + /* If we already have a existing modem, then mark it as supported. + * Otherwise, just defer a bit */ + g_simple_async_result_set_op_res_gpointer (async_result, + GUINT_TO_POINTER ((existing ? + MM_PLUGIN_SUPPORTS_PORT_SUPPORTED : + MM_PLUGIN_SUPPORTS_PORT_DEFER)), + NULL); + g_simple_async_result_complete_in_idle (async_result); + goto out; + } + /* Need to launch new probing */ probe = mm_port_probe_cache_get (port, physdev_path, driver); g_assert (probe);