From 377a1248658c3296a9f9ddc5e9bf17e154cb9fcf Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 22 Dec 2024 19:09:17 +0100 Subject: [PATCH] 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. --- src/mm-port-probe.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index b7ad3779..91f101e2 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -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)) {