core: find the existing modem for a port in the manager

This commit is contained in:
Dan Williams
2010-03-30 15:03:35 -07:00
parent 720e38aec0
commit df08f6a43f
5 changed files with 21 additions and 51 deletions

View File

@@ -383,11 +383,15 @@ try_supports_port (MMManager *manager,
SupportsInfo *info)
{
MMPluginSupportsResult result;
MMModem *existing;
existing = find_modem_for_device (manager, info->physdev_path);
result = mm_plugin_supports_port (plugin,
info->subsys,
info->name,
info->physdev_path,
existing,
supports_callback,
info);
@@ -426,8 +430,12 @@ do_grab_port (gpointer user_data)
/* No more plugins to try */
if (info->best_plugin) {
MMModem *existing;
existing = g_hash_table_lookup (priv->modems, info->physdev_path);
/* Create the modem */
modem = mm_plugin_grab_port (info->best_plugin, info->subsys, info->name, &error);
modem = mm_plugin_grab_port (info->best_plugin, info->subsys, info->name, existing, &error);
if (modem) {
guint32 modem_type = MM_MODEM_TYPE_UNKNOWN;
const char *type_name = "UNKNOWN";