zte: add support for pseudo-ethernet data ports

This commit is contained in:
Dan Williams
2010-12-30 16:36:47 -06:00
parent 36c87991c3
commit 05d4876b20

View File

@@ -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;