| Index: src/mm-plugin-base.c
|
| diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
|
| index 202eaac9f017bd681264cd417825ab31cc6e7f86..8537b4d0cfc208144cf21ccb5df67a02fea704a9 100644
|
| --- a/src/mm-plugin-base.c
|
| +++ b/src/mm-plugin-base.c
|
| @@ -44,6 +44,8 @@ G_DEFINE_TYPE_EXTENDED (MMPluginBase, mm_plugin_base, G_TYPE_OBJECT,
|
| */
|
| static GHashTable *cached_caps = NULL;
|
|
|
| +/* Virtual port corresponding to the embeded modem */
|
| +static gchar *virtual_port[] = {"smd0", NULL};
|
|
|
| typedef struct {
|
| char *name;
|
| @@ -911,6 +913,7 @@ supports_port (MMPlugin *plugin,
|
| MMPluginSupportsResult result = MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
|
| MMModem *existing;
|
| const char *master_path;
|
| + int idx;
|
|
|
| key = get_key (subsys, name);
|
| task = g_hash_table_lookup (priv->tasks, key);
|
| @@ -923,6 +926,17 @@ supports_port (MMPlugin *plugin,
|
| if (!port)
|
| goto out;
|
|
|
| + // Detect any modems accessible through the list of virtual ports
|
| + for (idx = 0; virtual_port[idx]; idx++) {
|
| + if (strcmp(name, virtual_port[idx]))
|
| + continue;
|
| + task = supports_task_new (self, port, port, "virtual", callback, callback_data);
|
| + g_assert (task);
|
| + g_hash_table_insert (priv->tasks, g_strdup (key), g_object_ref (task));
|
| + master_path = g_udev_device_get_sysfs_path (port);
|
| + goto find_plugin;
|
| + }
|
| +
|
| physdev = MM_PLUGIN_BASE_GET_CLASS (self)->find_physical_device (self, port);
|
| if (!physdev)
|
| goto out;
|
| @@ -937,6 +951,8 @@ supports_port (MMPlugin *plugin,
|
|
|
| /* Help the plugin out a bit by finding an existing modem for this port */
|
| master_path = g_udev_device_get_sysfs_path (physdev);
|
| +
|
| +find_plugin:
|
| existing = g_hash_table_lookup (priv->modems, master_path);
|
|
|
| result = MM_PLUGIN_BASE_GET_CLASS (self)->supports_port (self, existing, task);
|
|
|