aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-plugin-generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mm-plugin-generic.c')
-rw-r--r--plugins/mm-plugin-generic.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/plugins/mm-plugin-generic.c b/plugins/mm-plugin-generic.c
index e5e2ade..cdf2c66 100644
--- a/plugins/mm-plugin-generic.c
+++ b/plugins/mm-plugin-generic.c
@@ -59,6 +59,8 @@ get_level_for_capabilities (guint32 capabilities)
return 5;
if (capabilities & CAP_CDMA)
return 5;
+ if (capabilities & MM_PLUGIN_BASE_PORT_CAP_QCDM)
+ return 5;
return 0;
}
@@ -106,7 +108,7 @@ grab_port (MMPluginBase *base,
MMPluginBaseSupportsTask *task,
GError **error)
{
- GUdevDevice *port = NULL, *physdev = NULL;
+ GUdevDevice *port = NULL;
MMModem *modem = NULL;
const char *name, *subsys, *devfile, *sysfs_path, *driver;
guint32 caps;
@@ -131,15 +133,8 @@ grab_port (MMPluginBase *base,
}
}
- physdev = mm_plugin_base_supports_task_get_physdev (task);
- g_assert (physdev);
- sysfs_path = g_udev_device_get_sysfs_path (physdev);
- if (!sysfs_path) {
- g_set_error (error, 0, 0, "Could not get port's physical device sysfs path.");
- 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) {
modem = mm_generic_gsm_new (sysfs_path,
@@ -159,12 +154,15 @@ grab_port (MMPluginBase *base,
return NULL;
}
}
- } else {
- if (caps & (MM_PLUGIN_BASE_PORT_CAP_GSM | CAP_CDMA)) {
- modem = existing;
- if (!mm_modem_grab_port (modem, subsys, name, MM_PORT_TYPE_UNKNOWN, NULL, error))
- return NULL;
- }
+ } else if (get_level_for_capabilities (caps)) {
+ MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
+
+ 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))
+ return NULL;
}
return modem;