aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-x22x.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mm-plugin-x22x.c')
-rw-r--r--plugins/mm-plugin-x22x.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/mm-plugin-x22x.c b/plugins/mm-plugin-x22x.c
index 10a1b4c8..dfac6649 100644
--- a/plugins/mm-plugin-x22x.c
+++ b/plugins/mm-plugin-x22x.c
@@ -168,8 +168,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);
@@ -179,15 +180,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_X22X_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_X22X_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_X22X_TAGGED"))
ptype = MM_PORT_TYPE_IGNORED;
@@ -199,7 +203,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) {
@@ -211,17 +214,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;
}