diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2024-12-22 18:58:19 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2024-12-27 15:24:01 +0000 |
commit | e2633b46f05d1e998139ea1317d1e041b7a6b3f3 (patch) | |
tree | f043b8c6e9dc9c5a51594a6ef0adc8c75c0f0cdb | |
parent | 0744ebd1c0928522b39cbf2c9cf1cc4fd0a88c26 (diff) |
port-probe: only run custom init on ports that will go through AT probing
-rw-r--r-- | src/mm-port-probe.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 2d49cf3c..b7ad3779 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -373,8 +373,8 @@ mm_port_probe_set_result_mbim (MMPortProbe *self, typedef enum { PROBE_STEP_FIRST, - PROBE_STEP_CUSTOM_INIT_OPEN_PORT, - PROBE_STEP_CUSTOM_INIT, + PROBE_STEP_AT_CUSTOM_INIT_OPEN_PORT, + PROBE_STEP_AT_CUSTOM_INIT, PROBE_STEP_AT_OPEN_PORT, PROBE_STEP_AT, PROBE_STEP_AT_VENDOR, @@ -1341,22 +1341,22 @@ probe_step (MMPortProbe *self) ctx->step++; /* Fall through */ - case PROBE_STEP_CUSTOM_INIT_OPEN_PORT: - if (ctx->at_custom_init && ctx->at_custom_init_finish) { - mm_obj_msg (self, "probe step: custom init open port"); + case PROBE_STEP_AT_CUSTOM_INIT_OPEN_PORT: + if ((ctx->flags & MM_PORT_PROBE_AT) && (ctx->at_custom_init && ctx->at_custom_init_finish)) { + mm_obj_msg (self, "probe step: AT custom init open port"); ctx->source_id = g_idle_add ((GSourceFunc) serial_open_at, self); return; } ctx->step++; /* Fall through */ - case PROBE_STEP_CUSTOM_INIT: + case PROBE_STEP_AT_CUSTOM_INIT: /* If we got some custom initialization setup requested, go on with it * first. We completely ignore the custom initialization if the serial port * that we receive in the context isn't an AT port (e.g. if it was flagged * as not being an AT port early) */ - if (ctx->at_custom_init && ctx->at_custom_init_finish) { - mm_obj_msg (self, "probe step: custom init run"); + if ((ctx->flags & MM_PORT_PROBE_AT) && (ctx->at_custom_init && ctx->at_custom_init_finish)) { + mm_obj_msg (self, "probe step: AT custom init run"); g_assert (MM_IS_PORT_SERIAL_AT (ctx->serial)); ctx->at_custom_init (self, MM_PORT_SERIAL_AT (ctx->serial), |