diff options
author | Akash Aggarwal <quic_akasagga@quicinc.com> | 2022-07-28 11:25:57 +0530 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-08-04 14:26:33 +0000 |
commit | 213cd81b3ade35024e2d702e2726273f00344185 (patch) | |
tree | da58e3985cfd5e63f6b6edbcfa4cfe0906afa66f /src/mm-iface-modem-simple.c | |
parent | d008e437c3fadd7ee3442d1b8160140d6f6d02c0 (diff) |
iface-modem-simple: wait for packet service 'attach' state in ConnectionStep
Diffstat (limited to 'src/mm-iface-modem-simple.c')
-rw-r--r-- | src/mm-iface-modem-simple.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index e7746f54..fcf959ca 100644 --- a/src/mm-iface-modem-simple.c +++ b/src/mm-iface-modem-simple.c @@ -13,6 +13,7 @@ * Copyright (C) 2009 Novell, Inc. * Copyright (C) 2009 - 2011 Red Hat, Inc. * Copyright (C) 2011 Google, Inc. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. */ #include <ModemManager.h> @@ -217,6 +218,7 @@ typedef enum { CONNECTION_STEP_WAIT_FOR_ENABLED, CONNECTION_STEP_WAIT_AFTER_ENABLED, CONNECTION_STEP_REGISTER, + CONNECTION_STEP_PACKET_SERVICE_ATTACH, CONNECTION_STEP_BEARER, CONNECTION_STEP_CONNECT, CONNECTION_STEP_LAST @@ -315,6 +317,24 @@ create_bearer_ready (MMIfaceModem *self, } static void +wait_for_packet_service_attach_ready (MMIfaceModem3gpp *self, + GAsyncResult *res, + ConnectionContext *ctx) +{ + GError *error = NULL; + + if (!mm_iface_modem_3gpp_wait_for_packet_service_state_finish (self, res, &error)) { + g_dbus_method_invocation_take_error (ctx->invocation, error); + connection_context_free (ctx); + return; + } + + /* Packet service attached now! */ + ctx->step++; + connection_step (ctx); +} + +static void register_in_3gpp_or_cdma_network_ready (MMIfaceModemSimple *self, GAsyncResult *res, ConnectionContext *ctx) @@ -601,6 +621,15 @@ connection_step (ConnectionContext *ctx) ctx->step++; /* fall through */ + case CONNECTION_STEP_PACKET_SERVICE_ATTACH: + mm_obj_info (ctx->self, "simple connect state (%d/%d): wait to get packet service state attached", + ctx->step, CONNECTION_STEP_LAST); + mm_iface_modem_3gpp_wait_for_packet_service_state (MM_IFACE_MODEM_3GPP (ctx->self), + MM_MODEM_3GPP_PACKET_SERVICE_STATE_ATTACHED, /* attached state */ + (GAsyncReadyCallback)wait_for_packet_service_attach_ready, + ctx); + return; + case CONNECTION_STEP_BEARER: { g_autoptr(MMBearerProperties) bearer_properties = NULL; |