diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-11-28 23:07:04 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-12-24 12:41:27 +0000 |
commit | 60fe68f6093a449253281cc76ab47061638cea52 (patch) | |
tree | 7c7128e9ebfbe9390d9dc8582d305e6d77a6c7aa /src/mm-iface-modem-3gpp.c | |
parent | a6dd7ac60f1868c74346996aa7adced4ab94885c (diff) |
iface-modem-3gpp: implement loading 5GNR registration settings during init
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index 1e18b5b7..e2ae6f42 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -2816,6 +2816,7 @@ typedef enum { INITIALIZATION_STEP_IMEI, INITIALIZATION_STEP_EPS_UE_MODE_OPERATION, INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS, + INITIALIZATION_STEP_NR5G_REGISTRATION_SETTINGS, INITIALIZATION_STEP_CONNECT_SIGNALS, INITIALIZATION_STEP_LAST } InitializationStep; @@ -2849,6 +2850,32 @@ sim_pin_lock_enabled_cb (MMBaseSim *self, } static void +load_nr5g_registration_settings_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + GTask *task) +{ + InitializationContext *ctx; + g_autoptr(GError) error = NULL; + g_autoptr(MMNr5gRegistrationSettings) settings = NULL; + + ctx = g_task_get_task_data (task); + + settings = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_nr5g_registration_settings_finish (self, res, &error); + if (!settings) { + mm_obj_warn (self, "couldn't load 5GNR registration settings: %s", error->message); + } else { + g_autoptr(GVariant) dictionary = NULL; + + dictionary = mm_nr5g_registration_settings_get_dictionary (settings); + mm_gdbus_modem3gpp_set_nr5g_registration_settings (ctx->skeleton, dictionary); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (task); +} + +static void load_initial_eps_bearer_settings_ready (MMIfaceModem3gpp *self, GAsyncResult *res, GTask *task) @@ -3053,6 +3080,18 @@ interface_initialization_step (GTask *task) ctx->step++; /* fall through */ + case INITIALIZATION_STEP_NR5G_REGISTRATION_SETTINGS: + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_nr5g_registration_settings && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_nr5g_registration_settings_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_nr5g_registration_settings ( + self, + (GAsyncReadyCallback)load_nr5g_registration_settings_ready, + task); + return; + } + ctx->step++; + /* fall through */ + case INITIALIZATION_STEP_CONNECT_SIGNALS: /* We are done without errors! */ |