nokia: include port type hints
Ported commit 44194ac
to the new codebase.
This commit is contained in:
@@ -84,8 +84,10 @@ grab_port (MMPluginBase *base,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
MMBaseModem *modem = NULL;
|
MMBaseModem *modem = NULL;
|
||||||
|
GUdevDevice *port;
|
||||||
const gchar *name, *subsys, *driver;
|
const gchar *name, *subsys, *driver;
|
||||||
guint16 vendor = 0, product = 0;
|
guint16 vendor = 0, product = 0;
|
||||||
|
MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
|
||||||
|
|
||||||
/* The Nokia plugin cannot do anything with non-AT ports */
|
/* The Nokia plugin cannot do anything with non-AT ports */
|
||||||
if (!mm_port_probe_is_at (probe)) {
|
if (!mm_port_probe_is_at (probe)) {
|
||||||
@@ -93,6 +95,7 @@ grab_port (MMPluginBase *base,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
port = mm_port_probe_get_port (probe); /* transfer none */
|
||||||
subsys = mm_port_probe_get_port_subsys (probe);
|
subsys = mm_port_probe_get_port_subsys (probe);
|
||||||
name = mm_port_probe_get_port_name (probe);
|
name = mm_port_probe_get_port_name (probe);
|
||||||
driver = mm_port_probe_get_port_driver (probe);
|
driver = mm_port_probe_get_port_driver (probe);
|
||||||
@@ -102,12 +105,11 @@ grab_port (MMPluginBase *base,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: */
|
/* Look for port type hints */
|
||||||
/* /\* Look for port type hints *\/ */
|
if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM"))
|
||||||
/* if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM")) */
|
ptype = MM_PORT_TYPE_PRIMARY;
|
||||||
/* ptype = MM_PORT_TYPE_PRIMARY; */
|
else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX"))
|
||||||
/* else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX")) */
|
ptype = MM_PORT_TYPE_SECONDARY;
|
||||||
/* ptype = MM_PORT_TYPE_SECONDARY; */
|
|
||||||
|
|
||||||
/* If this is the first port being grabbed, create a new modem object */
|
/* If this is the first port being grabbed, create a new modem object */
|
||||||
if (!existing)
|
if (!existing)
|
||||||
@@ -120,7 +122,7 @@ grab_port (MMPluginBase *base,
|
|||||||
if (!mm_base_modem_grab_port (existing ? existing : modem,
|
if (!mm_base_modem_grab_port (existing ? existing : modem,
|
||||||
subsys,
|
subsys,
|
||||||
name,
|
name,
|
||||||
MM_PORT_TYPE_UNKNOWN)) {
|
ptype)) {
|
||||||
if (modem)
|
if (modem)
|
||||||
g_object_unref (modem);
|
g_object_unref (modem);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user