[PATCH] iface-modem-3gpp: used DENIED registration state if others are UNKNOWN

Aleksander Morgado aleksander at aleksander.es
Mon Feb 23 08:40:57 PST 2015


On Mon, Feb 23, 2015 at 5:35 PM, Dan Williams <dcbw at redhat.com> wrote:
> If all other registration states are UNKNOWN, use a registration state
> of DENIED as the modem registration state.
> ---

+1, go on and merge it.

>  src/mm-iface-modem-3gpp.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
> index 919954c..199b880 100644
> --- a/src/mm-iface-modem-3gpp.c
> +++ b/src/mm-iface-modem-3gpp.c
> @@ -130,24 +130,34 @@ get_consolidated_reg_state (RegistrationStateContext *ctx)
>      if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
>          ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING)
>          return ctx->cs;
> -
>      if (ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
>          ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING)
>          return ctx->ps;
> -
>      if (ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
>          ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING)
>          return ctx->eps;
>
>      if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING)
>          return ctx->cs;
> -
>      if (ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING)
>          return ctx->ps;
> -
>      if (ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING)
>          return ctx->eps;
>
> +    /* If one state is DENIED and the others are UNKNOWN, 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)
> +        return ctx->cs;
> +    if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
> +        ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED &&
> +        ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN)
> +        return ctx->ps;
> +    if (ctx->cs == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
> +        ctx->ps == MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN &&
> +        ctx->eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED)
> +        return ctx->eps;
> +
>      return ctx->cs;
>  }
>
> --
> 2.1.0
>
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list