summaryrefslogtreecommitdiff
path: root/src/mm-base-bearer.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2016-10-05 13:32:41 +0200
committerAleksander Morgado <aleksander@aleksander.es>2016-10-12 13:24:08 +0200
commitfe460b2f54b6a035a207815252fe87ee3a06351c (patch)
treed58b5312284d7fe4f0d5af29bd15e53595165cce /src/mm-base-bearer.c
parenta561f6edf0317ee4eb86e6811cd8cd5a7fbf5e60 (diff)
3gpp: update registration state enumeration with CSFB related states
Introduce "sms only" and "CSFB not preferred" home/roaming states to be reported for the CS context, while already registered on LTE. Based on 3GPP TS 27.007 v13.5.0.
Diffstat (limited to 'src/mm-base-bearer.c')
-rw-r--r--src/mm-base-bearer.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mm-base-bearer.c b/src/mm-base-bearer.c
index e4234ea7..14194b9d 100644
--- a/src/mm-base-bearer.c
+++ b/src/mm-base-bearer.c
@@ -54,6 +54,7 @@ typedef enum {
CONNECTION_FORBIDDEN_REASON_NONE,
CONNECTION_FORBIDDEN_REASON_UNREGISTERED,
CONNECTION_FORBIDDEN_REASON_ROAMING,
+ CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY,
CONNECTION_FORBIDDEN_REASON_LAST
} ConnectionForbiddenReason;
@@ -120,7 +121,8 @@ struct _MMBaseBearerPrivate {
static const gchar *connection_forbidden_reason_str [CONNECTION_FORBIDDEN_REASON_LAST] = {
"none",
"Not registered in the network",
- "Registered in roaming network, and roaming not allowed"
+ "Registered in roaming network, and roaming not allowed",
+ "Emergency services only",
};
/*****************************************************************************/
@@ -401,15 +403,22 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_UNREGISTERED;
break;
case MM_MODEM_3GPP_REGISTRATION_STATE_HOME:
+ case MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY:
+ case MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED:
case MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING:
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
break;
case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING:
+ case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY:
+ case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED:
if (mm_bearer_properties_get_allow_roaming (mm_base_bearer_peek_config (self)))
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
else
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_ROAMING;
break;
+ case MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY:
+ self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY;
+ break;
}
/* If no reason to disconnect, or if it's a mixed CDMA+LTE modem without a CDMA reason,
@@ -429,6 +438,14 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
return;
}
+ /* Modem is registered under emergency services only? */
+ if (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_EMERGENCY_ONLY) {
+ mm_dbg ("Bearer not allowed to connect, emergency services only");
+ reset_deferred_unregistration (self);
+ mm_base_bearer_disconnect_force (self);
+ return;
+ }
+
/* Modem reports being unregistered */
if (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_UNREGISTERED) {
/* If there is already a notification pending, just return */