aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkash Aggarwal <quic_akasagga@quicinc.com>2022-08-22 22:28:58 +0530
committerAleksander Morgado <aleksander@aleksander.es>2022-08-26 15:15:41 +0200
commite68cee832b8264996abc7e2d0913e9810f666cdc (patch)
tree60273aba764e1e161a81143bb1e8c078bd78b6a1
parent87ced3dff7e64fac55a6519a9f43df0a0bc39255 (diff)
mm-iface-modem-3gpp: fix packet service state updation
Modem could be in 'registered' state if CS is 'attached', but packet service state might be 'detached'. Check if packet service state needs to be updated in update_registration_state(), even if registration state is same. Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/618
-rw-r--r--src/mm-iface-modem-3gpp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index ac35c52b..bf01972f 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -300,7 +300,9 @@ get_consolidated_packet_service_state (MMIfaceModem3gpp *self)
if (REG_STATE_IS_REGISTERED (priv->state_cs))
return MM_MODEM_3GPP_PACKET_SERVICE_STATE_DETACHED;
- return MM_MODEM_3GPP_PACKET_SERVICE_STATE_UNKNOWN;
+ /* If not registered in any of CS, PS, EPS or 5GS, then packet service
+ * domain is detached. */
+ return MM_MODEM_3GPP_PACKET_SERVICE_STATE_DETACHED;
}
static MMModem3gppRegistrationState
@@ -2072,17 +2074,19 @@ update_registration_state (MMIfaceModem3gpp *self,
MMModem3gppRegistrationState new_state,
gboolean deferrable)
{
- Private *priv;
- MMModem3gppRegistrationState old_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
+ Private *priv;
+ MMModem3gppRegistrationState old_state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
+ MMModem3gppPacketServiceState old_packet_service_state = MM_MODEM_3GPP_PACKET_SERVICE_STATE_UNKNOWN;
priv = get_private (self);
g_object_get (self,
- MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, &old_state,
+ MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, &old_state,
+ MM_IFACE_MODEM_3GPP_PACKET_SERVICE_STATE, &old_packet_service_state,
NULL);
/* Only set new state if different */
- if (new_state == old_state)
+ if (new_state == old_state && old_packet_service_state == get_consolidated_packet_service_state (self))
return;
if (REG_STATE_IS_REGISTERED (new_state)) {