iface-modem-3gpp: fix reporting 'denied' registration state
If all CS/PS/EPS report 'denied', we should not report 'unknown' as consolidated... <debug> [1568556573.833928] building consolidated registration state: cs 'denied', ps 'denied', eps 'denied' --> 'unknown'
This commit is contained in:

committed by
Dan Williams

parent
abede5b9e3
commit
76b8c7d0ba
@@ -123,9 +123,10 @@ get_registration_state_context (MMIfaceModem3gpp *self)
|
|||||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED || \
|
state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED || \
|
||||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED)
|
state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED)
|
||||||
|
|
||||||
#define REG_STATE_IS_UNKNOWN_OR_IDLE(state) \
|
#define REG_STATE_IS_UNKNOWN_OR_IDLE_OR_DENIED(state) \
|
||||||
(state == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN || \
|
(state == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN || \
|
||||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE)
|
state == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE || \
|
||||||
|
state == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED)
|
||||||
|
|
||||||
static MMModem3gppRegistrationState
|
static MMModem3gppRegistrationState
|
||||||
get_consolidated_reg_state (RegistrationStateContext *ctx)
|
get_consolidated_reg_state (RegistrationStateContext *ctx)
|
||||||
@@ -161,23 +162,14 @@ get_consolidated_reg_state (RegistrationStateContext *ctx)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If one state is DENIED and the others are UNKNOWN or IDLE, use DENIED */
|
/* If at least one state is DENIED and the others are UNKNOWN or IDLE, use DENIED */
|
||||||
if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED &&
|
if ((ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->ps) &&
|
ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->eps)) {
|
ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) &&
|
||||||
consolidated = ctx->cs;
|
REG_STATE_IS_UNKNOWN_OR_IDLE_OR_DENIED (ctx->cs) &&
|
||||||
goto out;
|
REG_STATE_IS_UNKNOWN_OR_IDLE_OR_DENIED (ctx->ps) &&
|
||||||
}
|
REG_STATE_IS_UNKNOWN_OR_IDLE_OR_DENIED (ctx->eps)) {
|
||||||
if (REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->cs) &&
|
consolidated = MM_MODEM_3GPP_REGISTRATION_STATE_DENIED;
|
||||||
ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED &&
|
|
||||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->eps)) {
|
|
||||||
consolidated = ctx->ps;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
if (REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->cs) &&
|
|
||||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->ps) &&
|
|
||||||
ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) {
|
|
||||||
consolidated = ctx->eps;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +211,6 @@ get_consolidated_reg_state (RegistrationStateContext *ctx)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mm_dbg ("building consolidated registration state: cs '%s', ps '%s', eps '%s' --> '%s'",
|
mm_dbg ("building consolidated registration state: cs '%s', ps '%s', eps '%s' --> '%s'",
|
||||||
mm_modem_3gpp_registration_state_get_string (ctx->cs),
|
mm_modem_3gpp_registration_state_get_string (ctx->cs),
|
||||||
|
Reference in New Issue
Block a user