Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: src/mm-plugin-base.c

Issue 661471: Update from Qualcomm to support smd devices in Modem Manager (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698