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.
This commit is contained in:

committed by
Michał Mazur

parent
7cd28955a0
commit
6f00fb867b
@@ -12453,18 +12453,12 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
|
||||
g_error_free (error);
|
||||
|
||||
mm_iface_modem_update_failed_state (MM_IFACE_MODEM (self), failed_reason);
|
||||
|
||||
/* 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;
|
||||
} else {
|
||||
/* bind simple properties */
|
||||
mm_iface_modem_bind_simple_status (MM_IFACE_MODEM (self),
|
||||
self->priv->modem_simple_status);
|
||||
}
|
||||
|
||||
/* bind simple properties */
|
||||
mm_iface_modem_bind_simple_status (MM_IFACE_MODEM (self),
|
||||
self->priv->modem_simple_status);
|
||||
|
||||
/* Go on to next step */
|
||||
ctx->step++;
|
||||
initialize_step (task);
|
||||
@@ -12592,9 +12586,10 @@ initialize_step (GTask *task)
|
||||
/* fall through */
|
||||
|
||||
case INITIALIZE_STEP_JUMP_TO_LIMITED:
|
||||
if (ctx->self->priv->modem_state == MM_MODEM_STATE_LOCKED) {
|
||||
/* Jump to the fallback step when locked, we will allow some additional
|
||||
* interfaces even in locked state. */
|
||||
if (ctx->self->priv->modem_state == MM_MODEM_STATE_LOCKED ||
|
||||
ctx->self->priv->modem_state == MM_MODEM_STATE_FAILED) {
|
||||
/* Jump to the fallback step when locked or failed, we will allow some additional
|
||||
* interfaces even in locked or failed state. */
|
||||
ctx->step = INITIALIZE_STEP_FALLBACK_LIMITED;
|
||||
initialize_step (task);
|
||||
return;
|
||||
@@ -12736,7 +12731,6 @@ initialize_step (GTask *task)
|
||||
* leave the Voice interface around so that we can attempt
|
||||
* emergency voice calls.
|
||||
*/
|
||||
mm_iface_modem_3gpp_shutdown (MM_IFACE_MODEM_3GPP (ctx->self));
|
||||
mm_iface_modem_3gpp_profile_manager_shutdown (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (ctx->self));
|
||||
mm_iface_modem_3gpp_ussd_shutdown (MM_IFACE_MODEM_3GPP_USSD (ctx->self));
|
||||
mm_iface_modem_cdma_shutdown (MM_IFACE_MODEM_CDMA (ctx->self));
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user