aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-3gpp.c
diff options
context:
space:
mode:
authorMichal Mazur <michamazur@google.com>2023-02-07 13:15:12 +0000
committerMichaƂ Mazur <mkm@semihalf.com>2023-02-15 15:00:41 +0000
commit6f00fb867bdac03ea273a58e2d14ae85468e7857 (patch)
tree49e4a469b79563e9790db612ec9ffa79878afbb0 /src/mm-iface-modem-3gpp.c
parent7cd28955a076f08b6b9fa999429a2a506e314af0 (diff)
iface-modem-3gpp: enable reading of IMEI in FAILED state
It was not possible to read IMEI of modem when SIM was not inserted or initialization failed due to modem facility locks. To load IMEI, the 3gpp interface need to be initialized before going to FALLBACK_LIMITED.
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r--src/mm-iface-modem-3gpp.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index 786d2bc0..50246791 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -3053,8 +3053,8 @@ static void interface_initialization_step (GTask *task);
typedef enum {
INITIALIZATION_STEP_FIRST,
INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS,
- INITIALIZATION_STEP_TEST_LOCKED,
INITIALIZATION_STEP_IMEI,
+ INITIALIZATION_STEP_TEST_LOCKED_OR_FAILED,
INITIALIZATION_STEP_EPS_UE_MODE_OPERATION,
INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS,
INITIALIZATION_STEP_NR5G_REGISTRATION_SETTINGS,
@@ -3254,20 +3254,6 @@ interface_initialization_step (GTask *task)
ctx->step++;
/* fall through */
- case INITIALIZATION_STEP_TEST_LOCKED:
- modem_state = MM_MODEM_STATE_UNKNOWN;
- g_object_get (self,
- MM_IFACE_MODEM_STATE, &modem_state,
- NULL);
- if (modem_state == MM_MODEM_STATE_LOCKED) {
- /* Skip some steps and export the interface if modem is locked */
- ctx->step = INITIALIZATION_STEP_LAST;
- interface_initialization_step (task);
- return;
- }
- ctx->step++;
- /* fall through */
-
case INITIALIZATION_STEP_IMEI:
/* IMEI value is meant to be loaded only once during the whole
* lifetime of the modem. Therefore, if we already have it loaded,
@@ -3284,6 +3270,21 @@ interface_initialization_step (GTask *task)
ctx->step++;
/* fall through */
+ case INITIALIZATION_STEP_TEST_LOCKED_OR_FAILED:
+ modem_state = MM_MODEM_STATE_UNKNOWN;
+ g_object_get (self,
+ MM_IFACE_MODEM_STATE, &modem_state,
+ NULL);
+ if (modem_state == MM_MODEM_STATE_LOCKED ||
+ modem_state == MM_MODEM_STATE_FAILED) {
+ /* Skip some steps and export the interface if modem is locked or failed */
+ ctx->step = INITIALIZATION_STEP_LAST;
+ interface_initialization_step (task);
+ return;
+ }
+ ctx->step++;
+ /* fall through */
+
case INITIALIZATION_STEP_EPS_UE_MODE_OPERATION:
if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation &&
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_eps_ue_mode_operation_finish) {