port-probe: explicit close port steps

If by any chance the same ports needs to go through AT and
QMI/MBIM probing, make sure the serial port created during
AT probing is closed before starting the QMI/MBIM probing.
This commit is contained in:
Aleksander Morgado
2024-12-27 15:24:01 +00:00
parent e2633b46f0
commit 377a124865
+18
View File
@@ -381,7 +381,9 @@ typedef enum {
PROBE_STEP_AT_PRODUCT,
PROBE_STEP_AT_ICERA,
PROBE_STEP_AT_XMM,
PROBE_STEP_AT_CLOSE_PORT,
PROBE_STEP_QCDM,
PROBE_STEP_QCDM_CLOSE_PORT,
PROBE_STEP_QMI,
PROBE_STEP_MBIM,
PROBE_STEP_LAST
@@ -1445,6 +1447,14 @@ probe_step (MMPortProbe *self)
ctx->step++;
/* Fall through */
case PROBE_STEP_AT_CLOSE_PORT:
if (ctx->serial) {
mm_obj_msg (self, "probe step: AT close port");
clear_probe_serial_port (ctx);
}
ctx->step++;
/* Fall through */
case PROBE_STEP_QCDM:
/* QCDM requested and not already probed? */
if ((ctx->flags & MM_PORT_PROBE_QCDM) && !(self->priv->flags & MM_PORT_PROBE_QCDM)) {
@@ -1455,6 +1465,14 @@ probe_step (MMPortProbe *self)
ctx->step++;
/* Fall through */
case PROBE_STEP_QCDM_CLOSE_PORT:
if (ctx->serial) {
mm_obj_msg (self, "probe step: QCDM close port");
clear_probe_serial_port (ctx);
}
ctx->step++;
/* Fall through */
case PROBE_STEP_QMI:
/* QMI probing needed? */
if ((ctx->flags & MM_PORT_PROBE_QMI) && !(self->priv->flags & MM_PORT_PROBE_QMI)) {