diff options
author | Dan Williams <dcbw@redhat.com> | 2011-11-17 12:48:36 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-11-17 12:48:36 -0600 |
commit | 44194ac04d7926cb80de03fe95ce98bd64a1c6c6 (patch) | |
tree | 2fc348e1a8beadba005591a59746b84909d91610 /plugins/mm-plugin-nokia.c | |
parent | 02aa10c72ab6f3bad24b0977268b0d9d56674311 (diff) |
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.
Diffstat (limited to 'plugins/mm-plugin-nokia.c')
-rw-r--r-- | plugins/mm-plugin-nokia.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/mm-plugin-nokia.c b/plugins/mm-plugin-nokia.c index 12a00d36..8cfa9936 100644 --- a/plugins/mm-plugin-nokia.c +++ b/plugins/mm-plugin-nokia.c @@ -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; } |