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
This commit is contained in:
Aleksander Morgado
2017-03-07 11:12:51 +01:00
parent 957195469e
commit 875ade3e41

View File

@@ -20,6 +20,8 @@
#include "mm-modem-helpers.h" #include "mm-modem-helpers.h"
#include "mm-iface-modem.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.h"
#include "mm-base-modem-at.h" #include "mm-base-modem-at.h"
#include "mm-base-sim.h" #include "mm-base-sim.h"
@@ -3905,6 +3907,25 @@ load_current_capabilities_ready (MMIfaceModem *self,
return; 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 /* 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 * multimode device check. No big deal in updating them twice, as we're not
* exposed in DBus yet. */ * exposed in DBus yet. */