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.
This commit is contained in:
Daniele Palmas
2023-07-14 09:47:15 +02:00
parent 16f9ff68fb
commit 3082d5d37b

View File

@@ -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,10 +2150,13 @@ 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");
/* 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) &&
(((self->priv->kernel_data_modes & MM_PORT_QMI_KERNEL_DATA_MODE_RAW_IP) && (self->priv->llp == QMI_WDA_LINK_LAYER_PROTOCOL_RAW_IP)) ||
@@ -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 */