aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-zte.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mm-plugin-zte.c')
-rw-r--r--plugins/mm-plugin-zte.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/mm-plugin-zte.c b/plugins/mm-plugin-zte.c
index 6329c3ab..3db4936d 100644
--- a/plugins/mm-plugin-zte.c
+++ b/plugins/mm-plugin-zte.c
@@ -156,7 +156,8 @@ grab_port (MMPluginBase *base,
MMModem *modem = NULL;
const char *name, *subsys, *sysfs_path;
guint32 caps;
- MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
+ MMPortType ptype;
+ MMAtPortFlags pflags = MM_AT_PORT_FLAG_NONE;
guint16 vendor = 0, product = 0;
port = mm_plugin_base_supports_task_get_port (task);
@@ -164,9 +165,9 @@ grab_port (MMPluginBase *base,
/* Look for port type hints */
if (g_udev_device_get_property_as_boolean (port, "ID_MM_ZTE_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_ZTE_PORT_TYPE_AUX"))
- ptype = MM_PORT_TYPE_SECONDARY;
+ pflags = MM_AT_PORT_FLAG_SECONDARY;
subsys = g_udev_device_get_subsystem (port);
name = g_udev_device_get_name (port);
@@ -178,6 +179,7 @@ grab_port (MMPluginBase *base,
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task);
+ ptype = mm_plugin_base_probed_capabilities_to_port_type (caps);
if (!existing) {
if (caps & MM_PLUGIN_BASE_PORT_CAP_GSM) {
modem = mm_modem_zte_new (sysfs_path,
@@ -196,17 +198,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) || (!strcmp (subsys, "net"))) {
- 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;
}