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

Dan Williams dcbw at redhat.com
Mon Feb 23 08:49:33 PST 2015


On Mon, 2015-02-23 at 17:40 +0100, Aleksander Morgado wrote:
> 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.

Done.  Background: my new EM7345 apparently doesn't know about Verizon
bands (LTE B13), yet that's the SIM I had.  AT&T and T-Mobile denied
registration, leading to the scenario here.

Dan

> >  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
> 
> 
> 




More information about the ModemManager-devel mailing list