[PATCH] iface-modem: improve network registration checks for LTE devices

Dan Williams dcbw at redhat.com
Mon Mar 13 16:34:43 UTC 2017


On Sun, 2017-03-12 at 20:41 +0100, Aleksander Morgado wrote:
> If a device reports "LTE" in the list of current capabilities, we'll
> set EPS network supported by default. This will enable CEREG
> registration checks for AT based devices.
> 
> If a device reports only "LTE" in the list of current capabilities,
> we
> disable all the other network support flags (e.g. will disable CREG
> and CGREG checks among others).
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=100170
> ---
> 
> Hey Dan and everyone,
> 
> This patch tries to improve the registration checks implemented in
> the 'generic' MMBroadbandModem for devices reporting LTE
> capabilities.
> 
> What does everyone think about it?

Seems like the right thing to do.

Dan

> ---
>  src/mm-iface-modem.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
> index 046b3455..6ca5cf57 100644
> --- a/src/mm-iface-modem.c
> +++ b/src/mm-iface-modem.c
> @@ -20,6 +20,8 @@
> 
>  #include "mm-modem-helpers.h"
>  #include "mm-iface-modem.h"
> +#include "mm-iface-modem-3gpp.h"
> +#include "mm-iface-modem-cdma.h"
>  #include "mm-base-modem.h"
>  #include "mm-base-modem-at.h"
>  #include "mm-base-sim.h"
> @@ -3905,6 +3907,25 @@ load_current_capabilities_ready (MMIfaceModem
> *self,
>          return;
>      }
> 
> +    /* If LTE capability is reported, enable EPS network
> registration checks */
> +    if (caps & MM_MODEM_CAPABILITY_LTE) {
> +        mm_dbg ("Setting EPS network as supported");
> +        g_object_set (G_OBJECT (ctx->self),
> +                      MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED,
> TRUE,
> +                      NULL);
> +    }
> +
> +    /* If LTE capability is the only one reported, disable all other
> network registration checks */
> +    if (caps == MM_MODEM_CAPABILITY_LTE) {
> +        mm_dbg ("Setting CS/PS/CDMA1x/EVDO networks as
> unsupported");
> +        g_object_set (G_OBJECT (ctx->self),
> +                      MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED,     
> FALSE,
> +                      MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED,     
> FALSE,
> +                      MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED,
> FALSE,
> +                      MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED,   
> FALSE,
> +                      NULL);
> +    }
> +
>      /* Update current caps right away, even if we may fix them
> during the
>       * multimode device check. No big deal in updating them twice,
> as we're not
>       * exposed in DBus yet. */
> --
> 2.12.0


More information about the ModemManager-devel mailing list