aboutsummaryrefslogtreecommitdiff
path: root/src/mm-broadband-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-01 18:12:44 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:59 +0100
commitcd5e9c27a37ae2994dfab344ff83912c66cc4c12 (patch)
tree2a7c74d02f92be4fc0ec1a2d586a4ecaa41a1eeb /src/mm-broadband-modem.c
parent47a990390175747b2d213681eda4f41a6edb7a7b (diff)
broadband-modem: if locked, don't try to initialize remaining interfaces
Whenever we get unlocked, the modem initialization sequence will be run again.
Diffstat (limited to 'src/mm-broadband-modem.c')
-rw-r--r--src/mm-broadband-modem.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 88fd7462..52e2f6e7 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -5377,6 +5377,7 @@ enable (MMBaseModem *self,
typedef enum {
INITIALIZE_STEP_FIRST,
INITIALIZE_STEP_IFACE_MODEM,
+ INITIALIZE_STEP_ABORT_IF_LOCKED,
INITIALIZE_STEP_IFACE_3GPP,
INITIALIZE_STEP_IFACE_3GPP_USSD,
INITIALIZE_STEP_IFACE_CDMA,
@@ -5504,6 +5505,22 @@ initialize_step (InitializeContext *ctx)
ctx);
return;
+ case INITIALIZE_STEP_ABORT_IF_LOCKED:
+ /* If we find ourselves in a LOCKED state, we shouldn't keep on
+ * the initialization sequence. Instead, we will re-initialize once
+ * we are unlocked. */
+ if (ctx->self->priv->modem_state == MM_MODEM_STATE_LOCKED) {
+ g_simple_async_result_set_error (ctx->result,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_WRONG_STATE,
+ "Modem is currently locked, "
+ "cannot fully initialize");
+ initialize_context_complete_and_free (ctx);
+ return;
+ }
+ /* Fall down to next step */
+ ctx->step++;
+
case INITIALIZE_STEP_IFACE_3GPP:
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (ctx->self))) {
/* Initialize the 3GPP interface */