core: pass try_supports_port() the existing modem
This commit is contained in:
@@ -412,16 +412,21 @@ static void supports_callback (MMPlugin *plugin,
|
|||||||
|
|
||||||
static void try_supports_port (MMManager *manager,
|
static void try_supports_port (MMManager *manager,
|
||||||
MMPlugin *plugin,
|
MMPlugin *plugin,
|
||||||
|
MMModem *existing,
|
||||||
SupportsInfo *info);
|
SupportsInfo *info);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
supports_defer_timeout (gpointer user_data)
|
supports_defer_timeout (gpointer user_data)
|
||||||
{
|
{
|
||||||
SupportsInfo *info = user_data;
|
SupportsInfo *info = user_data;
|
||||||
|
MMModem *existing;
|
||||||
|
|
||||||
|
existing = find_modem_for_device (info->manager, info->physdev_path);
|
||||||
|
|
||||||
g_debug ("(%s): re-checking support...", info->name);
|
g_debug ("(%s): re-checking support...", info->name);
|
||||||
try_supports_port (info->manager,
|
try_supports_port (info->manager,
|
||||||
MM_PLUGIN (info->cur_plugin->data),
|
MM_PLUGIN (info->cur_plugin->data),
|
||||||
|
existing,
|
||||||
info);
|
info);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -429,12 +434,10 @@ supports_defer_timeout (gpointer user_data)
|
|||||||
static void
|
static void
|
||||||
try_supports_port (MMManager *manager,
|
try_supports_port (MMManager *manager,
|
||||||
MMPlugin *plugin,
|
MMPlugin *plugin,
|
||||||
|
MMModem *existing,
|
||||||
SupportsInfo *info)
|
SupportsInfo *info)
|
||||||
{
|
{
|
||||||
MMPluginSupportsResult result;
|
MMPluginSupportsResult result;
|
||||||
MMModem *existing;
|
|
||||||
|
|
||||||
existing = find_modem_for_device (manager, info->physdev_path);
|
|
||||||
|
|
||||||
result = mm_plugin_supports_port (plugin,
|
result = mm_plugin_supports_port (plugin,
|
||||||
info->subsys,
|
info->subsys,
|
||||||
@@ -611,7 +614,7 @@ supports_callback (MMPlugin *plugin,
|
|||||||
|
|
||||||
if (next_plugin) {
|
if (next_plugin) {
|
||||||
/* Try the next plugin */
|
/* Try the next plugin */
|
||||||
try_supports_port (info->manager, next_plugin, info);
|
try_supports_port (info->manager, next_plugin, existing, info);
|
||||||
} else {
|
} else {
|
||||||
/* All done; let the best modem grab the port */
|
/* All done; let the best modem grab the port */
|
||||||
info->done_id = g_idle_add (do_grab_port, info);
|
info->done_id = g_idle_add (do_grab_port, info);
|
||||||
@@ -725,7 +728,7 @@ device_added (MMManager *manager, GUdevDevice *device)
|
|||||||
if (existing)
|
if (existing)
|
||||||
plugin = MM_PLUGIN (g_object_get_data (G_OBJECT (existing), MANAGER_PLUGIN_TAG));
|
plugin = MM_PLUGIN (g_object_get_data (G_OBJECT (existing), MANAGER_PLUGIN_TAG));
|
||||||
|
|
||||||
try_supports_port (manager, plugin, info);
|
try_supports_port (manager, plugin, existing, info);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (physdev)
|
if (physdev)
|
||||||
|
Reference in New Issue
Block a user