aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem-3gpp.c50
-rw-r--r--src/mm-iface-modem-3gpp.h16
2 files changed, 66 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index f3e8ef59..4b57f303 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -49,6 +49,8 @@ static void interface_enabling_step (EnablingContext *ctx);
typedef enum {
ENABLING_STEP_FIRST,
+ ENABLING_STEP_SETUP_CS_REGISTRATION,
+ ENABLING_STEP_SETUP_PS_REGISTRATION,
ENABLING_STEP_LAST
} EnablingStep;
@@ -102,6 +104,30 @@ mm_iface_modem_3gpp_enable_finish (MMIfaceModem3gpp *self,
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
}
+#undef VOID_REPLY_READY_FN
+#define VOID_REPLY_READY_FN(NAME) \
+ static void \
+ NAME##_ready (MMIfaceModem3gpp *self, \
+ GAsyncResult *res, \
+ EnablingContext *ctx) \
+ { \
+ GError *error = NULL; \
+ \
+ MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->NAME##_finish (self, res, &error); \
+ if (error) { \
+ g_simple_async_result_take_error (ctx->result, error); \
+ enabling_context_complete_and_free (ctx); \
+ return; \
+ } \
+ \
+ /* Go on to next step */ \
+ ctx->step++; \
+ interface_enabling_step (ctx); \
+ }
+
+VOID_REPLY_READY_FN (setup_cs_registration)
+VOID_REPLY_READY_FN (setup_ps_registration)
+
static void
interface_enabling_step (EnablingContext *ctx)
{
@@ -110,6 +136,30 @@ interface_enabling_step (EnablingContext *ctx)
/* Fall down to next step */
ctx->step++;
+ case ENABLING_STEP_SETUP_CS_REGISTRATION:
+ if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_cs_registration &&
+ MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_cs_registration_finish) {
+ MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_cs_registration (
+ ctx->self,
+ (GAsyncReadyCallback)setup_cs_registration_ready,
+ ctx);
+ return;
+ }
+ /* Fall down to next step */
+ ctx->step++;
+
+ case ENABLING_STEP_SETUP_PS_REGISTRATION:
+ if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_ps_registration &&
+ MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_ps_registration_finish) {
+ MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->setup_ps_registration (
+ ctx->self,
+ (GAsyncReadyCallback)setup_ps_registration_ready,
+ ctx);
+ return;
+ }
+ /* Fall down to next step */
+ ctx->step++;
+
case ENABLING_STEP_LAST:
/* We are done without errors! */
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
diff --git a/src/mm-iface-modem-3gpp.h b/src/mm-iface-modem-3gpp.h
index b00c74d3..0f2ea43e 100644
--- a/src/mm-iface-modem-3gpp.h
+++ b/src/mm-iface-modem-3gpp.h
@@ -40,6 +40,22 @@ struct _MMIfaceModem3gpp {
gchar * (*load_imei_finish) (MMIfaceModem3gpp *self,
GAsyncResult *res,
GError **error);
+
+ /* Setup CS Registration */
+ void (* setup_cs_registration) (MMIfaceModem3gpp *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*setup_cs_registration_finish) (MMIfaceModem3gpp *self,
+ GAsyncResult *res,
+ GError **error);
+
+ /* Setup PS Registration */
+ void (* setup_ps_registration) (MMIfaceModem3gpp *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gboolean (*setup_ps_registration_finish) (MMIfaceModem3gpp *self,
+ GAsyncResult *res,
+ GError **error);
};
GType mm_iface_modem_3gpp_get_type (void);