aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-base.c
diff options
context:
space:
mode:
authorElly Jones <ellyjones@google.com>2010-12-20 11:05:49 -0500
committerElly Jones <ellyjones@google.com>2010-12-20 11:05:49 -0500
commitd32eeec9eaeddb1e560499a1a1afda956b3a1114 (patch)
tree0107074376022836c21d97673edd6f698c0d7ab3 /src/mm-plugin-base.c
parent00b0b70f5dd7e6896cc533e7ac3e9584467858e6 (diff)
Update from Qualcomm to support smd devices in Modem Manager
Review URL: http://codereview.chromium.org/661471 (cherry picked from commit 8475eb44b7ea41afa823919b017a39d82b07a5a2) Conflicts: src/mm-plugin-base.c Change-Id: I825886cad62a27acb39dfe74da7028d83adf692a
Diffstat (limited to 'src/mm-plugin-base.c')
-rw-r--r--src/mm-plugin-base.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index e9000519..a5f53a20 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -48,6 +48,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;
@@ -1034,6 +1036,7 @@ supports_port (MMPlugin *plugin,
char *driver = NULL, *key = NULL;
MMPluginBaseSupportsTask *task;
MMPluginSupportsResult result = MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
+ int idx;
key = get_key (subsys, name);
task = g_hash_table_lookup (priv->tasks, key);
@@ -1046,6 +1049,16 @@ 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, physdev_path, "virtual", callback, callback_data);
+ g_assert (task);
+ g_hash_table_insert (priv->tasks, g_strdup (key), g_object_ref (task));
+ goto find_plugin;
+ }
+
driver = get_driver_name (port);
if (!driver)
goto out;
@@ -1054,6 +1067,7 @@ supports_port (MMPlugin *plugin,
g_assert (task);
g_hash_table_insert (priv->tasks, g_strdup (key), g_object_ref (task));
+find_plugin:
result = MM_PLUGIN_BASE_GET_CLASS (self)->supports_port (self, existing, task);
if (result != MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS) {
/* If the plugin doesn't support the port at all, the supports task is