core: grab probed QCDM ports for plugins where they are useful

This commit is contained in:
Dan Williams
2010-03-23 01:36:00 -07:00
parent c36aacee0a
commit bcfb75d88d
16 changed files with 133 additions and 76 deletions
+12 -7
View File
@@ -42,9 +42,11 @@ mm_plugin_create (void)
static guint32
get_level_for_capabilities (guint32 capabilities)
{
/* Only CDMA for now */
/* Only CDMA and QCDM for now */
if (capabilities & CAP_CDMA)
return 10;
if (capabilities & MM_PLUGIN_BASE_PORT_CAP_QCDM)
return 10;
return 0;
}
@@ -150,12 +152,15 @@ grab_port (MMPluginBase *base,
return NULL;
}
}
} else {
if (caps & 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;