aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@gnu.org>2011-09-18 23:23:18 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:21 +0100
commita1d2f200214c7f691e4df535490f51c398ca32d4 (patch)
tree87d4ab5b0d510a7691b1bb20af48e4d7fb10b689
parentdb356bb20b5969c9680e9f11e21ad9bc51be30ec (diff)
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.
-rw-r--r--src/mm-plugin-base.c14
1 files changed, 14 insertions, 0 deletions
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);