iface-modem-3gpp: denied if all reg states idle except for one
If there is one registration state which is denied and the remaining ones are either unknown or idle, then report denied.
This commit is contained in:
committed by
Dan Williams
parent
e9f5700d5f
commit
417c0ed882
@@ -123,6 +123,10 @@ get_registration_state_context (MMIfaceModem3gpp *self)
|
||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED || \
|
||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED)
|
||||
|
||||
#define REG_STATE_IS_UNKNOWN_OR_IDLE(state) \
|
||||
(state == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN || \
|
||||
state == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE)
|
||||
|
||||
static MMModem3gppRegistrationState
|
||||
get_consolidated_reg_state (RegistrationStateContext *ctx)
|
||||
{
|
||||
@@ -159,19 +163,19 @@ get_consolidated_reg_state (RegistrationStateContext *ctx)
|
||||
|
||||
/* If one state is DENIED and the others are UNKNOWN or IDLE, use DENIED */
|
||||
if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED &&
|
||||
ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
|
||||
ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) {
|
||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->ps) &&
|
||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->eps)) {
|
||||
consolidated = ctx->cs;
|
||||
goto out;
|
||||
}
|
||||
if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
|
||||
if (REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->cs) &&
|
||||
ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED &&
|
||||
ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) {
|
||||
REG_STATE_IS_UNKNOWN_OR_IDLE (ctx->eps)) {
|
||||
consolidated = ctx->ps;
|
||||
goto out;
|
||||
}
|
||||
if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
|
||||
ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user