plugin-base: keep track of the probe for the net port, even if it wasn't run
This commit is contained in:
@@ -559,19 +559,14 @@ supports_port (MMPlugin *plugin,
|
|||||||
gboolean need_product_probing;
|
gboolean need_product_probing;
|
||||||
guint32 probe_run_flags;
|
guint32 probe_run_flags;
|
||||||
|
|
||||||
|
/* Setup key */
|
||||||
|
key = get_key (subsys, name);
|
||||||
|
|
||||||
async_result = g_simple_async_result_new (G_OBJECT (self),
|
async_result = g_simple_async_result_new (G_OBJECT (self),
|
||||||
callback,
|
callback,
|
||||||
user_data,
|
user_data,
|
||||||
supports_port);
|
supports_port);
|
||||||
|
|
||||||
/* Lookup current probes, there shouldn't be any */
|
|
||||||
key = get_key (subsys, name);
|
|
||||||
probe = g_hash_table_lookup (priv->tasks, key);
|
|
||||||
if (probe) {
|
|
||||||
g_warn_if_reached ();
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get port device */
|
/* Get port device */
|
||||||
if (!(port = g_udev_client_query_by_subsystem_and_name (priv->client,
|
if (!(port = g_udev_client_query_by_subsystem_and_name (priv->client,
|
||||||
subsys,
|
subsys,
|
||||||
@@ -616,11 +611,25 @@ supports_port (MMPlugin *plugin,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Need to launch new probing */
|
||||||
|
|
||||||
|
/* Lookup current probes, there shouldn't be any (unless for net devices) */
|
||||||
|
probe = g_hash_table_lookup (priv->tasks, key);
|
||||||
|
if (!probe)
|
||||||
|
probe = mm_port_probe_cache_get (port, physdev_path, driver);
|
||||||
|
g_assert (probe);
|
||||||
|
|
||||||
/* Before launching any probing, check if the port is a net device (which
|
/* Before launching any probing, check if the port is a net device (which
|
||||||
* cannot be probed).
|
* cannot be probed).
|
||||||
* TODO: With the new defer-until-suggested we probably don't need the modem
|
* TODO: With the new defer-until-suggested we probably don't need the modem
|
||||||
* object being passed down here just for this. */
|
* object being passed down here just for this. */
|
||||||
if (g_str_equal (subsys, "net")) {
|
if (g_str_equal (subsys, "net")) {
|
||||||
|
/* Keep track of the probe object, which is considered finished */
|
||||||
|
if (!g_hash_table_lookup (priv->tasks, key))
|
||||||
|
g_hash_table_insert (priv->tasks,
|
||||||
|
g_strdup (key),
|
||||||
|
g_object_ref (probe));
|
||||||
|
|
||||||
/* If we already have a existing modem, then mark it as supported.
|
/* If we already have a existing modem, then mark it as supported.
|
||||||
* Otherwise, just defer a bit */
|
* Otherwise, just defer a bit */
|
||||||
g_simple_async_result_set_op_res_gpointer (
|
g_simple_async_result_set_op_res_gpointer (
|
||||||
@@ -633,10 +642,6 @@ supports_port (MMPlugin *plugin,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need to launch new probing */
|
|
||||||
probe = mm_port_probe_cache_get (port, physdev_path, driver);
|
|
||||||
g_assert (probe);
|
|
||||||
|
|
||||||
/* Build flags depending on what probing needed */
|
/* Build flags depending on what probing needed */
|
||||||
probe_run_flags = 0;
|
probe_run_flags = 0;
|
||||||
if (priv->at)
|
if (priv->at)
|
||||||
@@ -647,7 +652,6 @@ supports_port (MMPlugin *plugin,
|
|||||||
probe_run_flags |= MM_PORT_PROBE_AT_PRODUCT;
|
probe_run_flags |= MM_PORT_PROBE_AT_PRODUCT;
|
||||||
if (priv->qcdm)
|
if (priv->qcdm)
|
||||||
probe_run_flags |= MM_PORT_PROBE_QCDM;
|
probe_run_flags |= MM_PORT_PROBE_QCDM;
|
||||||
|
|
||||||
g_assert (probe_run_flags != 0);
|
g_assert (probe_run_flags != 0);
|
||||||
|
|
||||||
/* Setup async call context */
|
/* Setup async call context */
|
||||||
|
Reference in New Issue
Block a user