From 875ade3e41b61528bbd2b018a5d34c1a1cda9b99 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 7 Mar 2017 11:12:51 +0100 Subject: iface-modem: improve network registration checks for LTE devices 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 --- src/mm-iface-modem.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') 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. */ -- cgit v1.2.3-70-g09d2