aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-iface-modem-simple.c')
-rw-r--r--src/mm-iface-modem-simple.c29
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;