aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-03 17:20:29 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-04 10:21:44 +0200
commit72db2a53ed114a6b46515130a6ed8238eba35bfe (patch)
treed7edf7f15716a137b07a4007a2c87c5b426a7410
parent9c2a6320a82aa301b2415227741a8bff5a33ea1b (diff)
plugin: defer task if supports check tells us to retry
Huawei modems will probe interface 0 always first; if we try to probe another interface meanwhile the supports check will give us a MM_CORE_ERROR_RETRY error, indicating that we need to defer the probing of the port.
-rw-r--r--src/mm-plugin.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index a8009976..8db4c049 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -477,8 +477,18 @@ port_probe_run_ready (MMPortProbe *probe,
g_simple_async_result_set_op_res_gpointer (ctx->result,
GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED),
NULL);
- } else {
- /* For remaining errors, just propagate them */
+ }
+ /* Probing failed but the plugin tells us to retry; so we'll defer the
+ * probing a bit */
+ else if (g_error_matches (error,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_RETRY)) {
+ g_simple_async_result_set_op_res_gpointer (ctx->result,
+ GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_DEFER),
+ NULL);
+ }
+ /* For remaining errors, just propagate them */
+ else {
g_simple_async_result_take_error (ctx->result, error);
}
} else {