nokia: add port tags for CS-xx Internet Sticks

They appear to always want PPP to happen on interface 0, according
to the Windows .INF files.
This commit is contained in:
Dan Williams
2011-11-17 12:48:36 -06:00
parent 02aa10c72a
commit 44194ac04d
3 changed files with 50 additions and 3 deletions

View File

@@ -135,6 +135,7 @@ grab_port (MMPluginBase *base,
const char *name, *subsys, *devfile, *sysfs_path;
guint32 caps;
guint16 vendor = 0, product = 0;
MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
port = mm_plugin_base_supports_task_get_port (task);
g_assert (port);
@@ -153,6 +154,12 @@ grab_port (MMPluginBase *base,
return NULL;
}
/* Look for port type hints */
if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM"))
ptype = MM_PORT_TYPE_PRIMARY;
else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX"))
ptype = MM_PORT_TYPE_SECONDARY;
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task);
if (!existing) {
@@ -173,14 +180,14 @@ grab_port (MMPluginBase *base,
}
if (modem) {
if (!mm_modem_grab_port (modem, subsys, name, MM_PORT_TYPE_UNKNOWN, NULL, error)) {
if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) {
g_object_unref (modem);
return NULL;
}
}
} else if (get_level_for_capabilities (caps)) {
modem = existing;
if (!mm_modem_grab_port (modem, subsys, name, MM_PORT_TYPE_UNKNOWN, NULL, error))
if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error))
return NULL;
}