diff options
Diffstat (limited to 'plugins/mm-plugin-simtech.c')
-rw-r--r-- | plugins/mm-plugin-simtech.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/mm-plugin-simtech.c b/plugins/mm-plugin-simtech.c index 76ab33d2..1eb28229 100644 --- a/plugins/mm-plugin-simtech.c +++ b/plugins/mm-plugin-simtech.c @@ -116,8 +116,9 @@ grab_port (MMPluginBase *base, MMModem *modem = NULL; const char *name, *subsys, *sysfs_path; guint32 caps; - MMPortType ptype = MM_PORT_TYPE_UNKNOWN; + MMPortType ptype; guint16 vendor = 0, product = 0; + MMAtPortFlags pflags = MM_AT_PORT_FLAG_NONE; port = mm_plugin_base_supports_task_get_port (task); g_assert (port); @@ -127,15 +128,18 @@ grab_port (MMPluginBase *base, * what the Windows .INF files say the port layout should be. */ if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_MODEM")) - ptype = MM_PORT_TYPE_PRIMARY; + pflags = MM_AT_PORT_FLAG_PRIMARY; else if (g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_PORT_TYPE_AUX")) - ptype = MM_PORT_TYPE_SECONDARY; + pflags = MM_AT_PORT_FLAG_SECONDARY; - /* If the device was tagged by the udev rules, then ignore any other ports - * to guard against race conditions if a device just happens to show up - * with more than two AT-capable ports. + caps = mm_plugin_base_supports_task_get_probed_capabilities (task); + ptype = mm_plugin_base_probed_capabilities_to_port_type (caps); + + /* If the port was tagged by the udev rules but isn't a primary or secondary, + * then ignore it to guard against race conditions if a device just happens + * to show up with more than two AT-capable ports. */ - if ( (ptype == MM_PORT_TYPE_UNKNOWN) + if ( (pflags == MM_AT_PORT_FLAG_NONE) && g_udev_device_get_property_as_boolean (port, "ID_MM_SIMTECH_TAGGED")) ptype = MM_PORT_TYPE_IGNORED; @@ -147,7 +151,6 @@ grab_port (MMPluginBase *base, return NULL; } - caps = mm_plugin_base_supports_task_get_probed_capabilities (task); sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task); if (!existing) { if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) { @@ -167,17 +170,14 @@ grab_port (MMPluginBase *base, } if (modem) { - if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) { + if (!mm_modem_grab_port (modem, subsys, name, ptype, pflags, NULL, error)) { g_object_unref (modem); return NULL; } } } else if (get_level_for_capabilities (caps)) { - if (caps & MM_PLUGIN_BASE_PORT_CAP_QCDM) - ptype = MM_PORT_TYPE_QCDM; - modem = existing; - if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) + if (!mm_modem_grab_port (modem, subsys, name, ptype, pflags, NULL, error)) return NULL; } |