diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem-3gpp.c | 36 | ||||
-rw-r--r-- | src/mm-iface-modem-3gpp.h | 8 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c index 7caa1750..55b657f6 100644 --- a/src/mm-iface-modem-3gpp.c +++ b/src/mm-iface-modem-3gpp.c @@ -570,6 +570,7 @@ static void interface_disabling_step (DisablingContext *ctx); typedef enum { DISABLING_STEP_FIRST, + DISABLING_STEP_CLEANUP_UNSOLICITED_REGISTRATION, DISABLING_STEP_LAST } DisablingStep; @@ -623,6 +624,29 @@ mm_iface_modem_3gpp_disable_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,DISPLAY) \ + static void \ + NAME##_ready (MMIfaceModem3gpp *self, \ + GAsyncResult *res, \ + DisablingContext *ctx) \ + { \ + GError *error = NULL; \ + \ + MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->NAME##_finish (self, res, &error); \ + if (error) { \ + mm_dbg ("Couldn't %s: '%s'", DISPLAY, error->message); \ + g_error_free (error); \ + } \ + \ + /* Go on to next step */ \ + ctx->step++; \ + interface_disabling_step (ctx); \ + } + +VOID_REPLY_READY_FN (cleanup_unsolicited_registration, + "cleanup unsolicited registration") + static void interface_disabling_step (DisablingContext *ctx) { @@ -631,6 +655,18 @@ interface_disabling_step (DisablingContext *ctx) /* Fall down to next step */ ctx->step++; + case DISABLING_STEP_CLEANUP_UNSOLICITED_REGISTRATION: + if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration && + MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration_finish) { + MM_IFACE_MODEM_3GPP_GET_INTERFACE (ctx->self)->cleanup_unsolicited_registration ( + ctx->self, + (GAsyncReadyCallback)cleanup_unsolicited_registration_ready, + ctx); + return; + } + /* Fall down to next step */ + ctx->step++; + case DISABLING_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 b545078b..4b58a6df 100644 --- a/src/mm-iface-modem-3gpp.h +++ b/src/mm-iface-modem-3gpp.h @@ -50,6 +50,14 @@ struct _MMIfaceModem3gpp { GAsyncResult *res, GError **error); + /* Cleanup unsolicited registration messages */ + void (* cleanup_unsolicited_registration) (MMIfaceModem3gpp *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*cleanup_unsolicited_registration_finish) (MMIfaceModem3gpp *self, + GAsyncResult *res, + GError **error); + /* Setup CS Registration */ void (* setup_cs_registration) (MMIfaceModem3gpp *self, GAsyncReadyCallback callback, |