aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-09-22 10:56:59 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-10-17 08:31:46 +0000
commit27405a44ca0015918c493af50e92dfb56f5d6cf8 (patch)
tree516befd17a4aa9142d44a478b58034ef4cbfbc5e
parentd555c4c45caee603abf90869728c46402e26db68 (diff)
broadband-modem: new initialization step when failed/locked
Instead of using the firmware step as fallback when the modem goes into failed or locked state, use an independent step in the initialization state machine, just to make it clearer.
-rw-r--r--src/mm-broadband-modem.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index adc285e9..f3935519 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -11000,6 +11000,7 @@ typedef enum {
INITIALIZE_STEP_IFACE_TIME,
INITIALIZE_STEP_IFACE_SIGNAL,
INITIALIZE_STEP_IFACE_OMA,
+ INITIALIZE_STEP_FALLBACK_LIMITED,
INITIALIZE_STEP_IFACE_FIRMWARE,
INITIALIZE_STEP_SIM_HOT_SWAP,
INITIALIZE_STEP_IFACE_SIMPLE,
@@ -11106,9 +11107,9 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
mm_iface_modem_update_failed_state (MM_IFACE_MODEM (self), failed_reason);
- /* Jump to the firmware step. We allow firmware switching even in failed
- * state */
- ctx->step = INITIALIZE_STEP_IFACE_FIRMWARE;
+ /* Jump to the fallback step when on failure, we will allow some additional
+ * interfaces even in failed state. */
+ ctx->step = INITIALIZE_STEP_FALLBACK_LIMITED;
initialize_step (task);
return;
}
@@ -11121,9 +11122,9 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
* the initialization sequence. Instead, we will re-initialize once
* we are unlocked. */
if (ctx->self->priv->modem_state == MM_MODEM_STATE_LOCKED) {
- /* Jump to the Firmware interface. We do allow modems to export
- * both the Firmware and Simple interfaces when locked. */
- ctx->step = INITIALIZE_STEP_IFACE_FIRMWARE;
+ /* Jump to the fallback step when locked, we will allow some additional
+ * interfaces even in locked state. */
+ ctx->step = INITIALIZE_STEP_FALLBACK_LIMITED;
initialize_step (task);
return;
}
@@ -11323,6 +11324,12 @@ initialize_step (GTask *task)
task);
return;
+ case INITIALIZE_STEP_FALLBACK_LIMITED:
+ /* All the initialization steps after this one will be run both on
+ * successful and locked/failed initializations.
+ * Fall down to next step */
+ ctx->step++;
+
case INITIALIZE_STEP_IFACE_FIRMWARE:
/* Initialize the Firmware interface */
mm_iface_modem_firmware_initialize (MM_IFACE_MODEM_FIRMWARE (ctx->self),