diff options
Diffstat (limited to 'src/mm-broadband-modem.c')
-rw-r--r-- | src/mm-broadband-modem.c | 17 |
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 */ |