diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-25 15:04:17 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:27 +0100 |
commit | c0d3bd944c9644aca556221fce4d4b1e5ae0ed6b (patch) | |
tree | c27f238085e63f79b4a644ed0712ff906ce92ada | |
parent | 7fa372d1185dc9ea195d3d7d8b8a5cfffe26963e (diff) |
iface-modem: send flow control setup commands during enable
-rw-r--r-- | src/mm-iface-modem.c | 14 | ||||
-rw-r--r-- | src/mm-iface-modem.h | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 5e13a0c4..4236f5ad 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -756,6 +756,7 @@ typedef enum { ENABLING_STEP_MODEM_INIT, ENABLING_STEP_MODEM_POWER_UP, ENABLING_STEP_MODEM_AFTER_POWER_UP, + ENABLING_STEP_FLOW_CONTROL, ENABLING_STEP_LAST } EnablingStep; @@ -856,6 +857,7 @@ mm_iface_modem_enable_finish (MMIfaceModem *self, VOID_REPLY_READY_FN (modem_init); VOID_REPLY_READY_FN (modem_power_up); VOID_REPLY_READY_FN (modem_after_power_up); +VOID_REPLY_READY_FN (modem_flow_control); static void interface_enabling_flash_done (MMSerialPort *port, @@ -942,6 +944,18 @@ interface_enabling_step (EnablingContext *ctx) /* Fall down to next step */ ctx->step++; + case ENABLING_STEP_FLOW_CONTROL: + if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_flow_control && + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_flow_control_finish) { + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->modem_flow_control ( + ctx->self, + (GAsyncReadyCallback)modem_flow_control_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.h b/src/mm-iface-modem.h index cac7b54e..e488ac85 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -207,6 +207,14 @@ struct _MMIfaceModem { gboolean (*modem_after_power_up_finish) (MMIfaceModem *self, GAsyncResult *res, GError **error); + + /* Asynchronous flow control setup */ + void (*modem_flow_control) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*modem_flow_control_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); }; GType mm_iface_modem_get_type (void); |