iface-modem-3gpp: new 5GS network support
This commit is contained in:
@@ -505,9 +505,10 @@ run_registration_checks_ready (MMIfaceModem3gpp *self,
|
||||
|
||||
static void
|
||||
modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
gboolean cs_supported,
|
||||
gboolean ps_supported,
|
||||
gboolean eps_supported,
|
||||
gboolean is_cs_supported,
|
||||
gboolean is_ps_supported,
|
||||
gboolean is_eps_supported,
|
||||
gboolean is_5gs_supported,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -517,9 +518,10 @@ modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
|
||||
g_assert (iface_modem_3gpp_parent->run_registration_checks);
|
||||
iface_modem_3gpp_parent->run_registration_checks (self,
|
||||
cs_supported,
|
||||
ps_supported,
|
||||
eps_supported,
|
||||
is_cs_supported,
|
||||
is_ps_supported,
|
||||
is_eps_supported,
|
||||
is_5gs_supported,
|
||||
(GAsyncReadyCallback) run_registration_checks_ready,
|
||||
task);
|
||||
}
|
||||
|
@@ -4066,9 +4066,10 @@ register_state_query_ready (MbimDevice *device,
|
||||
|
||||
static void
|
||||
modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
gboolean cs_supported,
|
||||
gboolean ps_supported,
|
||||
gboolean eps_supported,
|
||||
gboolean is_cs_supported,
|
||||
gboolean is_ps_supported,
|
||||
gboolean is_eps_supported,
|
||||
gboolean is_5gs_supported,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@@ -3312,9 +3312,10 @@ get_system_info_ready (QmiClientNas *client,
|
||||
|
||||
static void
|
||||
modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
gboolean cs_supported,
|
||||
gboolean ps_supported,
|
||||
gboolean eps_supported,
|
||||
gboolean is_cs_supported,
|
||||
gboolean is_ps_supported,
|
||||
gboolean is_eps_supported,
|
||||
gboolean is_5gs_supported,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
@@ -106,6 +106,7 @@ enum {
|
||||
PROP_MODEM_3GPP_CS_NETWORK_SUPPORTED,
|
||||
PROP_MODEM_3GPP_PS_NETWORK_SUPPORTED,
|
||||
PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED,
|
||||
PROP_MODEM_3GPP_5GS_NETWORK_SUPPORTED,
|
||||
PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS,
|
||||
PROP_MODEM_3GPP_INITIAL_EPS_BEARER,
|
||||
PROP_MODEM_CDMA_CDMA1X_REGISTRATION_STATE,
|
||||
@@ -179,6 +180,7 @@ struct _MMBroadbandModemPrivate {
|
||||
gboolean modem_3gpp_cs_network_supported;
|
||||
gboolean modem_3gpp_ps_network_supported;
|
||||
gboolean modem_3gpp_eps_network_supported;
|
||||
gboolean modem_3gpp_5gs_network_supported;
|
||||
/* Implementation helpers */
|
||||
GPtrArray *modem_3gpp_registration_regex;
|
||||
MMModem3gppFacility modem_3gpp_ignored_facility_locks;
|
||||
@@ -4860,9 +4862,9 @@ modem_3gpp_register_in_network (MMIfaceModem3gpp *self,
|
||||
/* Registration checks (3GPP interface) */
|
||||
|
||||
typedef struct {
|
||||
gboolean cs_supported;
|
||||
gboolean ps_supported;
|
||||
gboolean eps_supported;
|
||||
gboolean is_cs_supported;
|
||||
gboolean is_ps_supported;
|
||||
gboolean is_eps_supported;
|
||||
gboolean run_cs;
|
||||
gboolean run_ps;
|
||||
gboolean run_eps;
|
||||
@@ -5100,10 +5102,10 @@ run_registration_checks_context_step (GTask *task)
|
||||
}
|
||||
|
||||
/* If all run checks returned errors we fail */
|
||||
if ((ctx->cs_supported || ctx->ps_supported || ctx->eps_supported) &&
|
||||
(!ctx->cs_supported || ctx->cs_error) &&
|
||||
(!ctx->ps_supported || ctx->ps_error) &&
|
||||
(!ctx->eps_supported || ctx->eps_error)) {
|
||||
if ((ctx->is_cs_supported || ctx->is_ps_supported || ctx->is_eps_supported) &&
|
||||
(!ctx->is_cs_supported || ctx->cs_error) &&
|
||||
(!ctx->is_ps_supported || ctx->ps_error) &&
|
||||
(!ctx->is_eps_supported || ctx->eps_error)) {
|
||||
/* Prefer the EPS, and then PS error if any */
|
||||
if (ctx->eps_error) {
|
||||
g_propagate_error (&error, ctx->eps_error);
|
||||
@@ -5127,9 +5129,10 @@ run_registration_checks_context_step (GTask *task)
|
||||
|
||||
static void
|
||||
modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
gboolean cs_supported,
|
||||
gboolean ps_supported,
|
||||
gboolean eps_supported,
|
||||
gboolean is_cs_supported,
|
||||
gboolean is_ps_supported,
|
||||
gboolean is_eps_supported,
|
||||
gboolean is_5gs_supported,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -5137,12 +5140,13 @@ modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
GTask *task;
|
||||
|
||||
ctx = g_new0 (RunRegistrationChecksContext, 1);
|
||||
ctx->cs_supported = cs_supported;
|
||||
ctx->ps_supported = ps_supported;
|
||||
ctx->eps_supported = eps_supported;
|
||||
ctx->run_cs = cs_supported;
|
||||
ctx->run_ps = ps_supported;
|
||||
ctx->run_eps = eps_supported;
|
||||
ctx->is_cs_supported = is_cs_supported;
|
||||
ctx->is_ps_supported = is_ps_supported;
|
||||
ctx->is_eps_supported = is_eps_supported;
|
||||
ctx->run_cs = is_cs_supported;
|
||||
ctx->run_ps = is_ps_supported;
|
||||
ctx->run_eps = is_eps_supported;
|
||||
/* TODO: 5gs */
|
||||
|
||||
task = g_task_new (self, NULL, callback, user_data);
|
||||
g_task_set_task_data (task, ctx, (GDestroyNotify)run_registration_checks_context_free);
|
||||
@@ -11915,6 +11919,9 @@ set_property (GObject *object,
|
||||
case PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED:
|
||||
self->priv->modem_3gpp_eps_network_supported = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_MODEM_3GPP_5GS_NETWORK_SUPPORTED:
|
||||
self->priv->modem_3gpp_5gs_network_supported = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS:
|
||||
self->priv->modem_3gpp_ignored_facility_locks = g_value_get_flags (value);
|
||||
break;
|
||||
@@ -12051,6 +12058,9 @@ get_property (GObject *object,
|
||||
case PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED:
|
||||
g_value_set_boolean (value, self->priv->modem_3gpp_eps_network_supported);
|
||||
break;
|
||||
case PROP_MODEM_3GPP_5GS_NETWORK_SUPPORTED:
|
||||
g_value_set_boolean (value, self->priv->modem_3gpp_5gs_network_supported);
|
||||
break;
|
||||
case PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS:
|
||||
g_value_set_flags (value, self->priv->modem_3gpp_ignored_facility_locks);
|
||||
break;
|
||||
@@ -12131,6 +12141,7 @@ mm_broadband_modem_init (MMBroadbandModem *self)
|
||||
self->priv->modem_3gpp_cs_network_supported = TRUE;
|
||||
self->priv->modem_3gpp_ps_network_supported = TRUE;
|
||||
self->priv->modem_3gpp_eps_network_supported = FALSE;
|
||||
self->priv->modem_3gpp_5gs_network_supported = FALSE;
|
||||
self->priv->modem_3gpp_ignored_facility_locks = MM_MODEM_3GPP_FACILITY_NONE;
|
||||
self->priv->modem_cdma_cdma1x_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
|
||||
self->priv->modem_cdma_evdo_registration_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
|
||||
@@ -12618,6 +12629,10 @@ mm_broadband_modem_class_init (MMBroadbandModemClass *klass)
|
||||
PROP_MODEM_3GPP_EPS_NETWORK_SUPPORTED,
|
||||
MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
PROP_MODEM_3GPP_5GS_NETWORK_SUPPORTED,
|
||||
MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
PROP_MODEM_3GPP_IGNORED_FACILITY_LOCKS,
|
||||
MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS);
|
||||
|
@@ -38,9 +38,10 @@ static GQuark private_quark;
|
||||
|
||||
typedef struct {
|
||||
/* Registration state */
|
||||
MMModem3gppRegistrationState cs;
|
||||
MMModem3gppRegistrationState ps;
|
||||
MMModem3gppRegistrationState eps;
|
||||
MMModem3gppRegistrationState state_cs;
|
||||
MMModem3gppRegistrationState state_ps;
|
||||
MMModem3gppRegistrationState state_eps;
|
||||
MMModem3gppRegistrationState state_5gs;
|
||||
gboolean manual_registration;
|
||||
gchar *manual_registration_operator_id;
|
||||
GCancellable *pending_registration_cancellable;
|
||||
@@ -74,9 +75,10 @@ get_private (MMIfaceModem3gpp *self)
|
||||
priv = g_object_get_qdata (G_OBJECT (self), private_quark);
|
||||
if (!priv) {
|
||||
priv = g_slice_new0 (Private);
|
||||
priv->cs = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->ps = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->eps = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->state_cs = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->state_ps = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->state_eps = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
priv->state_5gs = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free);
|
||||
}
|
||||
|
||||
@@ -140,50 +142,59 @@ get_consolidated_reg_state (MMIfaceModem3gpp *self)
|
||||
* So here we prefer the +CREG response, but if we never got a successful
|
||||
* +CREG response, we'll take +CGREG instead.
|
||||
*/
|
||||
if (priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->cs;
|
||||
if (priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->state_cs;
|
||||
goto out;
|
||||
}
|
||||
if (priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->ps;
|
||||
if (priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->state_ps;
|
||||
goto out;
|
||||
}
|
||||
if (priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->eps;
|
||||
if (priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->state_eps;
|
||||
goto out;
|
||||
}
|
||||
if (priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
|
||||
priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
|
||||
consolidated = priv->state_5gs;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Searching? */
|
||||
if (priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING ||
|
||||
priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING ||
|
||||
priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) {
|
||||
if (priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING ||
|
||||
priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING ||
|
||||
priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING ||
|
||||
priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING) {
|
||||
consolidated = MM_MODEM_3GPP_REGISTRATION_STATE_SEARCHING;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* If at least one state is DENIED and the others are UNKNOWN or IDLE, use DENIED */
|
||||
if ((priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||
priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||
priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->cs) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->ps) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->eps)) {
|
||||
if ((priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||
priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||
priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED ||
|
||||
priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_DENIED) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->state_cs) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->state_ps) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->state_eps) &&
|
||||
REG_STATE_IS_UNKNOWN_IDLE_DENIED (priv->state_5gs)) {
|
||||
consolidated = MM_MODEM_3GPP_REGISTRATION_STATE_DENIED;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Emergency services? */
|
||||
if (priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY ||
|
||||
priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY ||
|
||||
priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY) {
|
||||
if (priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY ||
|
||||
priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY ||
|
||||
priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY ||
|
||||
priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY) {
|
||||
consolidated = MM_MODEM_3GPP_REGISTRATION_STATE_EMERGENCY_ONLY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Support for additional registration states reported when on LTE.
|
||||
/* Support for additional registration states reported when on LTE/5GNR.
|
||||
*
|
||||
* For example, we may see the modem registered in LTE (EPS==HOME), and we
|
||||
* may get "SMS only" reported for CS.
|
||||
@@ -195,29 +206,31 @@ get_consolidated_reg_state (MMIfaceModem3gpp *self)
|
||||
* We also warn in that case, because ideally we should always report the
|
||||
* LTE registration state first, not this one.
|
||||
*/
|
||||
if (priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY ||
|
||||
priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY ||
|
||||
priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED ||
|
||||
priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) {
|
||||
if (priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_SMS_ONLY ||
|
||||
priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_SMS_ONLY ||
|
||||
priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_HOME_CSFB_NOT_PREFERRED ||
|
||||
priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) {
|
||||
mm_obj_warn (self, "3GPP CSFB registration state is consolidated: %s",
|
||||
mm_modem_3gpp_registration_state_get_string (priv->cs));
|
||||
consolidated = priv->cs;
|
||||
mm_modem_3gpp_registration_state_get_string (priv->state_cs));
|
||||
consolidated = priv->state_cs;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Idle? */
|
||||
if (priv->cs == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE ||
|
||||
priv->ps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE ||
|
||||
priv->eps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE) {
|
||||
if (priv->state_cs == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE ||
|
||||
priv->state_ps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE ||
|
||||
priv->state_eps == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE ||
|
||||
priv->state_5gs == MM_MODEM_3GPP_REGISTRATION_STATE_IDLE) {
|
||||
consolidated = MM_MODEM_3GPP_REGISTRATION_STATE_IDLE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
mm_obj_dbg (self, "building consolidated registration state: cs '%s', ps '%s', eps '%s' --> '%s'",
|
||||
mm_modem_3gpp_registration_state_get_string (priv->cs),
|
||||
mm_modem_3gpp_registration_state_get_string (priv->ps),
|
||||
mm_modem_3gpp_registration_state_get_string (priv->eps),
|
||||
mm_obj_dbg (self, "building consolidated registration state: cs '%s', ps '%s', eps '%s', 5gs '%s' --> '%s'",
|
||||
mm_modem_3gpp_registration_state_get_string (priv->state_cs),
|
||||
mm_modem_3gpp_registration_state_get_string (priv->state_ps),
|
||||
mm_modem_3gpp_registration_state_get_string (priv->state_eps),
|
||||
mm_modem_3gpp_registration_state_get_string (priv->state_5gs),
|
||||
mm_modem_3gpp_registration_state_get_string (consolidated));
|
||||
|
||||
return consolidated;
|
||||
@@ -1141,27 +1154,31 @@ mm_iface_modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean cs_supported = FALSE;
|
||||
gboolean ps_supported = FALSE;
|
||||
gboolean eps_supported = FALSE;
|
||||
gboolean is_cs_supported = FALSE;
|
||||
gboolean is_ps_supported = FALSE;
|
||||
gboolean is_eps_supported = FALSE;
|
||||
gboolean is_5gs_supported = FALSE;
|
||||
|
||||
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->run_registration_checks != NULL);
|
||||
|
||||
g_object_get (self,
|
||||
MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED, &cs_supported,
|
||||
MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED, &ps_supported,
|
||||
MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &eps_supported,
|
||||
MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED, &is_cs_supported,
|
||||
MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED, &is_ps_supported,
|
||||
MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED, &is_eps_supported,
|
||||
MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED, &is_5gs_supported,
|
||||
NULL);
|
||||
|
||||
mm_obj_dbg (self, "running registration checks (CS: '%s', PS: '%s', EPS: '%s')",
|
||||
cs_supported ? "yes" : "no",
|
||||
ps_supported ? "yes" : "no",
|
||||
eps_supported ? "yes" : "no");
|
||||
mm_obj_dbg (self, "running registration checks (CS: '%s', PS: '%s', EPS: '%s', 5GS: '%s')",
|
||||
is_cs_supported ? "yes" : "no",
|
||||
is_ps_supported ? "yes" : "no",
|
||||
is_eps_supported ? "yes" : "no",
|
||||
is_5gs_supported ? "yes" : "no");
|
||||
|
||||
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->run_registration_checks (self,
|
||||
cs_supported,
|
||||
ps_supported,
|
||||
eps_supported,
|
||||
is_cs_supported,
|
||||
is_ps_supported,
|
||||
is_eps_supported,
|
||||
is_5gs_supported,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
@@ -1531,7 +1548,7 @@ mm_iface_modem_3gpp_update_cs_registration_state (MMIfaceModem3gpp *
|
||||
return;
|
||||
|
||||
priv = get_private (self);
|
||||
priv->cs = state;
|
||||
priv->state_cs = state;
|
||||
update_registration_state (self, get_consolidated_reg_state (self), TRUE);
|
||||
}
|
||||
|
||||
@@ -1550,7 +1567,7 @@ mm_iface_modem_3gpp_update_ps_registration_state (MMIfaceModem3gpp *
|
||||
return;
|
||||
|
||||
priv = get_private (self);
|
||||
priv->ps = state;
|
||||
priv->state_ps = state;
|
||||
update_registration_state (self, get_consolidated_reg_state (self), TRUE);
|
||||
}
|
||||
|
||||
@@ -1569,7 +1586,26 @@ mm_iface_modem_3gpp_update_eps_registration_state (MMIfaceModem3gpp
|
||||
return;
|
||||
|
||||
priv = get_private (self);
|
||||
priv->eps = state;
|
||||
priv->state_eps = state;
|
||||
update_registration_state (self, get_consolidated_reg_state (self), TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
mm_iface_modem_3gpp_update_5gs_registration_state (MMIfaceModem3gpp *self,
|
||||
MMModem3gppRegistrationState state)
|
||||
{
|
||||
Private *priv;
|
||||
gboolean supported = FALSE;
|
||||
|
||||
g_object_get (self,
|
||||
MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED, &supported,
|
||||
NULL);
|
||||
|
||||
if (!supported)
|
||||
return;
|
||||
|
||||
priv = get_private (self);
|
||||
priv->state_5gs = state;
|
||||
update_registration_state (self, get_consolidated_reg_state (self), TRUE);
|
||||
}
|
||||
|
||||
@@ -2627,6 +2663,14 @@ iface_modem_3gpp_init (gpointer g_iface)
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_interface_install_property
|
||||
(g_iface,
|
||||
g_param_spec_boolean (MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED,
|
||||
"5GS network supported",
|
||||
"Whether the modem works in the 5GS network",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_interface_install_property
|
||||
(g_iface,
|
||||
g_param_spec_flags (MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS,
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#define MM_IFACE_MODEM_3GPP_CS_NETWORK_SUPPORTED "iface-modem-3gpp-cs-network-supported"
|
||||
#define MM_IFACE_MODEM_3GPP_PS_NETWORK_SUPPORTED "iface-modem-3gpp-ps-network-supported"
|
||||
#define MM_IFACE_MODEM_3GPP_EPS_NETWORK_SUPPORTED "iface-modem-3gpp-eps-network-supported"
|
||||
#define MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED "iface-modem-3gpp-5gs-network-supported"
|
||||
#define MM_IFACE_MODEM_3GPP_IGNORED_FACILITY_LOCKS "iface-modem-3gpp-ignored-facility-locks"
|
||||
#define MM_IFACE_MODEM_3GPP_INITIAL_EPS_BEARER "iface-modem-3gpp-initial-eps-bearer"
|
||||
|
||||
@@ -167,13 +168,14 @@ struct _MMIfaceModem3gpp {
|
||||
MMBaseBearer * (*create_initial_eps_bearer) (MMIfaceModem3gpp *self,
|
||||
MMBearerProperties *properties);
|
||||
|
||||
/* Run CS/PS/EPS registration state checks..
|
||||
/* Run CS/PS/EPS/5GS registration state checks..
|
||||
* Note that no registration state is returned, implementations should call
|
||||
* mm_iface_modem_3gpp_update_registration_state(). */
|
||||
void (* run_registration_checks) (MMIfaceModem3gpp *self,
|
||||
gboolean cs_supported,
|
||||
gboolean ps_supported,
|
||||
gboolean eps_supported,
|
||||
gboolean is_cs_supported,
|
||||
gboolean is_ps_supported,
|
||||
gboolean is_eps_supported,
|
||||
gboolean is_5gs_supported,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (*run_registration_checks_finish) (MMIfaceModem3gpp *self,
|
||||
@@ -274,6 +276,8 @@ void mm_iface_modem_3gpp_update_ps_registration_state (MMIfaceModem3gpp *self,
|
||||
MMModem3gppRegistrationState state);
|
||||
void mm_iface_modem_3gpp_update_eps_registration_state (MMIfaceModem3gpp *self,
|
||||
MMModem3gppRegistrationState state);
|
||||
void mm_iface_modem_3gpp_update_5gs_registration_state (MMIfaceModem3gpp *self,
|
||||
MMModem3gppRegistrationState state);
|
||||
void mm_iface_modem_3gpp_update_subscription_state (MMIfaceModem3gpp *self,
|
||||
MMModem3gppSubscriptionState state);
|
||||
void mm_iface_modem_3gpp_update_access_technologies (MMIfaceModem3gpp *self,
|
||||
|
@@ -4256,22 +4256,33 @@ load_current_capabilities_ready (MMIfaceModem *self,
|
||||
return;
|
||||
}
|
||||
|
||||
/* If LTE capability is reported, enable EPS network registration checks */
|
||||
/* By default CS/PS/CDMA1X/EVDO network registration checks are the only
|
||||
* ones enabled, so fix them up based on capabilities, enabling EPS or 5GS
|
||||
* checks if required, and disabling CS/PS/CDMA1X/EVDO if required. */
|
||||
if (caps & MM_MODEM_CAPABILITY_LTE) {
|
||||
mm_obj_dbg (self, "setting EPS network as supported");
|
||||
g_object_set (G_OBJECT (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_obj_dbg (self, "setting CS/PS/CDMA1x/EVDO networks as unsupported");
|
||||
if (caps & MM_MODEM_CAPABILITY_5GNR) {
|
||||
mm_obj_dbg (self, "setting 5GS network as supported");
|
||||
g_object_set (G_OBJECT (self),
|
||||
MM_IFACE_MODEM_3GPP_5GS_NETWORK_SUPPORTED, TRUE,
|
||||
NULL);
|
||||
}
|
||||
if (!(caps & MM_MODEM_CAPABILITY_CDMA_EVDO)) {
|
||||
mm_obj_dbg (self, "setting CDMA1x/EVDO networks as unsupported");
|
||||
g_object_set (G_OBJECT (self),
|
||||
MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED, FALSE,
|
||||
MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED, FALSE,
|
||||
NULL);
|
||||
}
|
||||
if (!(caps & MM_MODEM_CAPABILITY_GSM_UMTS)) {
|
||||
mm_obj_dbg (self, "setting CS/PS networks as unsupported");
|
||||
g_object_set (G_OBJECT (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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user