diff options
author | Dylan Van Assche <me@dylanvanassche.be> | 2021-03-13 19:28:19 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-05-26 13:14:52 +0000 |
commit | 84aa134ad9c94ed42cdc1f8387e8fbf227ee4103 (patch) | |
tree | 83f01344a7255a372a9283d2e03469169f510e49 /src/mm-broadband-modem.c | |
parent | a9868638a7fe7eca953902743fc569ec12e1483d (diff) |
iface-modem-3gpp: synchronize state when resuming
On resume, refresh the EPS bearers and 3GPP registration
as the registration and bearers may expired during suspend.
Diffstat (limited to 'src/mm-broadband-modem.c')
-rw-r--r-- | src/mm-broadband-modem.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index fe4d53b5..6bcc924b 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -11943,6 +11943,7 @@ enable (MMBaseModem *self, typedef enum { SYNCING_STEP_FIRST, + SYNCING_STEP_IFACE_3GPP, SYNCING_STEP_IFACE_TIME, SYNCING_STEP_LAST, } SyncingStep; @@ -11980,6 +11981,24 @@ iface_modem_time_sync_ready (MMIfaceModemTime *self, } static void +iface_modem_3gpp_sync_ready (MMBroadbandModem *self, + GAsyncResult *res, + GTask *task) +{ + SyncingContext *ctx; + g_autoptr(GError) error = NULL; + + ctx = g_task_get_task_data (task); + + if (!mm_iface_modem_3gpp_sync_finish (MM_IFACE_MODEM_3GPP (self), res, &error)) + mm_obj_warn (self, "3GPP interface synchronization failed: %s", error->message); + + /* Go on to next step */ + ctx->step++; + syncing_step (task); +} + +static void syncing_step (GTask *task) { MMBroadbandModem *self; @@ -11993,6 +12012,18 @@ syncing_step (GTask *task) ctx->step++; /* fall through */ + case SYNCING_STEP_IFACE_3GPP: + /* + * Start interface 3GPP synchronization. + * We hardly depend on the registration and bearer status, + * therefore we cannot continue with the other steps until + * this one is finished. + */ + mm_obj_info (self, "resume synchronization state (%d/%d): 3GPP interface sync", + ctx->step, SYNCING_STEP_LAST); + mm_iface_modem_3gpp_sync (MM_IFACE_MODEM_3GPP (self), (GAsyncReadyCallback)iface_modem_3gpp_sync_ready, task); + return; + case SYNCING_STEP_IFACE_TIME: /* * Synchronize asynchronously the Time interface. |