diff options
author | Daniele Palmas <dnlplm@gmail.com> | 2023-07-14 09:47:15 +0200 |
---|---|---|
committer | Daniele Palmas <dnlplm@gmail.com> | 2023-07-17 13:47:19 +0200 |
commit | 3082d5d37b3bd336eb2f3d298916960d7d92605d (patch) | |
tree | eaa555a601c3b495b51e8fdcc51a31c5c58679ea | |
parent | 16f9ff68fb5460b423d3fdf9a5221c32819de3fc (diff) |
port-qmi: fix rmnet setup when QMAP is configured in the modem at MM startup
It could happen that when MM starts the aggregation protocol is already
configured on the modem side (e.g. if MM is stopped and restarted): this
prevents the links to be properly configured, resulting in using the qmimux
multiplex implementation even if rmnet is available.
Fix the issue by always performing the first time the links reset procedure,
even if the data format on the modem side is the expected one.
-rw-r--r-- | src/mm-port-qmi.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mm-port-qmi.c b/src/mm-port-qmi.c index df0909b3..908bde70 100644 --- a/src/mm-port-qmi.c +++ b/src/mm-port-qmi.c @@ -81,6 +81,8 @@ struct _MMPortQmiPrivate { MMPort *preallocated_links_main; GArray *preallocated_links; GList *preallocated_links_setup_pending; + /* first multiplex setup */ + gboolean first_multiplex_setup; }; /*****************************************************************************/ @@ -2052,8 +2054,10 @@ internal_setup_data_format_ready (MMPortQmi *self, NULL, /* not expected to update */ &error)) g_task_return_error (task, error); - else + else { + self->priv->first_multiplex_setup = FALSE; g_task_return_boolean (task, TRUE); + } g_object_unref (task); } @@ -2146,9 +2150,12 @@ mm_port_qmi_setup_data_format (MMPortQmi *self, (self->priv->kernel_data_modes & (MM_PORT_QMI_KERNEL_DATA_MODE_MUX_RMNET | MM_PORT_QMI_KERNEL_DATA_MODE_MUX_QMIWWAN)) && MM_PORT_QMI_DAP_IS_SUPPORTED_QMAP (self->priv->dap)) { mm_obj_dbg (self, "multiplex support already available when setting up data format"); - g_task_return_boolean (task, TRUE); - g_object_unref (task); - return; + /* If this is the first time that multiplex is used, perform anyway the internal reset operation, so that the links are properly managed */ + if (!self->priv->first_multiplex_setup) { + g_task_return_boolean (task, TRUE); + g_object_unref (task); + return; + } } if ((action == MM_PORT_QMI_SETUP_DATA_FORMAT_ACTION_SET_DEFAULT) && @@ -2409,6 +2416,7 @@ port_open_step (GTask *task) switch (ctx->step) { case PORT_OPEN_STEP_FIRST: mm_obj_dbg (self, "Opening QMI device..."); + self->priv->first_multiplex_setup = TRUE; ctx->step++; /* Fall through */ |