aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-01-13 15:59:39 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:50 +0100
commit983f081f309d28b391422aa53bb36da8b1b61fc0 (patch)
tree8dbbb3eecd5b1dfe9cef706348a2581a119a6e34
parent0d5c23742891aa6f9ae715875882ce16d42bcb41 (diff)
nokia: include port type hints
Ported commit 44194ac to the new codebase.
-rw-r--r--plugins/mm-plugin-nokia.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/mm-plugin-nokia.c b/plugins/mm-plugin-nokia.c
index 76fbf8e4..bdca8ff1 100644
--- a/plugins/mm-plugin-nokia.c
+++ b/plugins/mm-plugin-nokia.c
@@ -84,8 +84,10 @@ grab_port (MMPluginBase *base,
GError **error)
{
MMBaseModem *modem = NULL;
+ GUdevDevice *port;
const gchar *name, *subsys, *driver;
guint16 vendor = 0, product = 0;
+ MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
/* The Nokia plugin cannot do anything with non-AT ports */
if (!mm_port_probe_is_at (probe)) {
@@ -93,6 +95,7 @@ grab_port (MMPluginBase *base,
return NULL;
}
+ port = mm_port_probe_get_port (probe); /* transfer none */
subsys = mm_port_probe_get_port_subsys (probe);
name = mm_port_probe_get_port_name (probe);
driver = mm_port_probe_get_port_driver (probe);
@@ -102,12 +105,11 @@ grab_port (MMPluginBase *base,
return NULL;
}
- /* TODO: */
- /* /\* 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; */
+ /* 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;
/* If this is the first port being grabbed, create a new modem object */
if (!existing)
@@ -120,7 +122,7 @@ grab_port (MMPluginBase *base,
if (!mm_base_modem_grab_port (existing ? existing : modem,
subsys,
name,
- MM_PORT_TYPE_UNKNOWN)) {
+ ptype)) {
if (modem)
g_object_unref (modem);
return NULL;