diff options
author | Dan Williams <dan@bigw.org> | 2025-01-23 02:58:59 +0000 |
---|---|---|
committer | Dan Williams <dan@bigw.org> | 2025-01-23 02:58:59 +0000 |
commit | a5332d260cca671727fd59516d3b4ee37828d85a (patch) | |
tree | 1144c05fc371dfe289e8afbc93a902cbd572129e | |
parent | 35c0556f73a1a02b535f5aa863a02663bfe493c9 (diff) | |
parent | 59d7be365861f21853fe7b0e1ed48d99d25b7615 (diff) |
Merge request !1260 from 'main'
broadband-modem-qmi: retry when "Get Serving System" fails
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1260
Closes #667
-rw-r--r-- | src/mm-broadband-modem-qmi.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index b5f29b8b..2c817fc7 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -4173,6 +4173,7 @@ typedef struct { QmiClientNas *client; gboolean enable; /* TRUE for enabling, FALSE for disabling */ gboolean system_info_checked; + gboolean serving_system_disabled; } UnsolicitedRegistrationEventsContext; static void @@ -4225,13 +4226,14 @@ ri_serving_system_or_system_info_ready (QmiClientNas *client, UnsolicitedRegistrationEventsContext *ctx; g_autoptr(QmiMessageNasRegisterIndicationsOutput) output = NULL; g_autoptr(GError) error = NULL; + g_autoptr(QmiMessageNasRegisterIndicationsInput) input = NULL; self = g_task_get_source_object (task); ctx = g_task_get_task_data (task); output = qmi_client_nas_register_indications_finish (client, res, &error); if (!output || !qmi_message_nas_register_indications_output_get_result (output, &error)) { - if (!ctx->system_info_checked) { + if (!ctx->system_info_checked && !ctx->serving_system_disabled) { mm_obj_dbg (self, "couldn't register system info indication: '%s', falling-back to serving system", error->message); ctx->system_info_checked = TRUE; common_enable_disable_unsolicited_registration_events_serving_system (task); @@ -4245,7 +4247,25 @@ ri_serving_system_or_system_info_ready (QmiClientNas *client, } if (!ctx->system_info_checked) { + /* When enabling system info, serving system events are turned-off, since some + * modems have them active by default. + */ + if (ctx->enable && !ctx->serving_system_disabled) { + input = qmi_message_nas_register_indications_input_new (); + qmi_message_nas_register_indications_input_set_serving_system_events (input, FALSE, NULL); + qmi_client_nas_register_indications ( + ctx->client, + input, + 5, + NULL, + (GAsyncReadyCallback)ri_serving_system_or_system_info_ready, + task); + ctx->serving_system_disabled = TRUE; + return; + } + ctx->system_info_checked = TRUE; + /* registered system info indications. now try to register for system status indications */ if (self->priv->dsd_supported) { common_enable_disable_unsolicited_registration_events_system_status (task); @@ -4349,11 +4369,6 @@ common_enable_disable_unsolicited_registration_events_system_info (GTask *task) ctx = g_task_get_task_data (task); input = qmi_message_nas_register_indications_input_new (); qmi_message_nas_register_indications_input_set_system_info (input, ctx->enable, NULL); - /* When enabling, serving system events are turned-off, since some modems have them - * active by default. They will be turned-on again if setting system info events fails - */ - if (ctx->enable) - qmi_message_nas_register_indications_input_set_serving_system_events (input, FALSE, NULL); qmi_message_nas_register_indications_input_set_network_reject_information (input, ctx->enable, FALSE, NULL); qmi_client_nas_register_indications ( ctx->client, |