aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-12-30 16:36:47 -0600
committerDan Williams <dcbw@redhat.com>2010-12-30 16:36:47 -0600
commit05d4876b20a6fa03421c77de53b74d1b81e5ea5f (patch)
treea24b4a28bd538caf64c6b0fd18b0d12b20bde0e6
parent36c87991c38188eefc184ee4780cac3517502840 (diff)
zte: add support for pseudo-ethernet data ports
-rw-r--r--plugins/mm-plugin-zte.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/mm-plugin-zte.c b/plugins/mm-plugin-zte.c
index 97bbcc36..bb2ee176 100644
--- a/plugins/mm-plugin-zte.c
+++ b/plugins/mm-plugin-zte.c
@@ -11,7 +11,7 @@
* GNU General Public License for more details:
*
* Copyright (C) 2008 - 2009 Novell, Inc.
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009 - 2010 Red Hat, Inc.
*/
#include <string.h>
@@ -73,9 +73,6 @@ supports_port (MMPluginBase *base,
/* Can't do anything with non-serial ports */
port = mm_plugin_base_supports_task_get_port (task);
- if (strcmp (g_udev_device_get_subsystem (port), "tty"))
- return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
-
subsys = g_udev_device_get_subsystem (port);
name = g_udev_device_get_name (port);
@@ -85,6 +82,20 @@ supports_port (MMPluginBase *base,
if (vendor != 0x19d2)
return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
+ if (!strcmp (subsys, "net")) {
+ /* If we don't know the modem's type yet, defer grabbing the port
+ * until we know the type.
+ */
+ if (!existing)
+ return MM_PLUGIN_SUPPORTS_PORT_DEFER;
+
+ mm_plugin_base_supports_task_complete (task, 10);
+ return MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS;
+ }
+
+ if (strcmp (subsys, "tty"))
+ return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
+
if (mm_plugin_base_get_cached_port_capabilities (base, port, &cached)) {
level = get_level_for_capabilities (cached);
if (level) {
@@ -165,7 +176,7 @@ grab_port (MMPluginBase *base,
return NULL;
}
}
- } else if (get_level_for_capabilities (caps)) {
+ } else if (get_level_for_capabilities (caps) || (!strcmp (subsys, "net"))) {
if (caps & MM_PLUGIN_BASE_PORT_CAP_QCDM)
ptype = MM_PORT_TYPE_QCDM;