broadband-modem-mbim: run explicit packet service query

When running the 3GPP registration checks (e.g. after reaching enabled
state, or when synchronizing state after a quick suspend/resume), we
also update the current packet service state explicitly, without
needing to fully rely on the indications.
This commit is contained in:
Aleksander Morgado
2023-05-24 08:38:15 +00:00
parent b7d94a4daa
commit 3424c17688

View File

@@ -6368,12 +6368,38 @@ modem_3gpp_run_registration_checks_finish (MMIfaceModem3gpp *self,
return g_task_propagate_boolean (G_TASK (res), error); return g_task_propagate_boolean (G_TASK (res), error);
} }
static void
packet_service_query_ready (MbimDevice *device,
GAsyncResult *res,
GTask *task)
{
MMBroadbandModemMbim *self;
g_autoptr(MbimMessage) response = NULL;
g_autoptr(GError) error = NULL;
self = g_task_get_source_object (task);
response = mbim_device_command_finish (device, res, &error);
if (response &&
(mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error) ||
g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE))) {
g_autoptr(GError) inner_error = NULL;
if (!common_process_packet_service (self, device, response, NULL, NULL, &inner_error))
mm_obj_warn (self, "%s", inner_error->message);
}
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
static void static void
register_state_query_ready (MbimDevice *device, register_state_query_ready (MbimDevice *device,
GAsyncResult *res, GAsyncResult *res,
GTask *task) GTask *task)
{ {
g_autoptr(MbimMessage) response = NULL; g_autoptr(MbimMessage) response = NULL;
g_autoptr(MbimMessage) message = NULL;
MMBroadbandModemMbim *self; MMBroadbandModemMbim *self;
GError *error = NULL; GError *error = NULL;
MbimRegisterState register_state; MbimRegisterState register_state;
@@ -6438,8 +6464,14 @@ register_state_query_ready (MbimDevice *device,
provider_id, provider_id,
provider_name); provider_name);
g_task_return_boolean (task, TRUE); /* Now queue packet service state update */
g_object_unref (task); message = mbim_message_packet_service_query_new (NULL);
mbim_device_command (device,
message,
10,
NULL,
(GAsyncReadyCallback)packet_service_query_ready,
task);
} }
static void static void