diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2023-03-27 12:48:51 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksandermj@chromium.org> | 2023-03-27 13:10:17 +0000 |
commit | 024485e321e1b8de2695a857f32dd37ae2192042 (patch) | |
tree | b6524c9863836afae3b23517a1b9cfb8e7b62d0a /src/mm-port-probe.c | |
parent | 7787c34af019634a2fd89099510cd27eeb859170 (diff) | |
download | ModemManager-024485e321e1b8de2695a857f32dd37ae2192042.tar.gz |
port-probe: don't assume port is QCDM when QCDM is not required
When QCDM is not required we don't run an explicit QCDM port probing
operation.
In this case, though, we should not assume that the port is QCDM
capable, even if it is also flagged as ignored.
Instead, we'll flag the port as QCDM capable and ignored only if there
was a udev port type hint associated to the port. Otherwise, we'll
report the port as not being QCDM capable, and the port won't even be
reported in the list of ports as its type is unknown.
Diffstat (limited to 'src/mm-port-probe.c')
-rw-r--r-- | src/mm-port-probe.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 87551c158..e3298ed8a 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -758,11 +758,19 @@ serial_probe_qcdm (MMPortProbe *self) if (port_probe_task_return_error_if_cancelled (self)) return G_SOURCE_REMOVE; - /* Check if port requires QCDM probing */ + /* If the plugin specifies QCDM is not required, we can right away complete the QCDM + * probing task. */ if (!ctx->qcdm_required) { mm_obj_dbg (self, "Maybe a QCDM port, but plugin does not require probing and grabbing..."); - mm_port_probe_set_result_qcdm (self, TRUE); - self->priv->is_ignored = TRUE; + /* If we had a port type hint, flag the port as QCDM capable but ignored. Otherwise, + * no QCDM capable and not ignored. The outcome is really the same, i.e. the port is not + * used any more, but the way it's reported in DBus will be different (i.e. "ignored" vs + "unknown" */ + if (self->priv->maybe_qcdm) { + mm_port_probe_set_result_qcdm (self, TRUE); + self->priv->is_ignored = TRUE; + } else + mm_port_probe_set_result_qcdm (self, FALSE); /* Reschedule probing */ serial_probe_schedule (self); return G_SOURCE_REMOVE; |