diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2016-11-07 17:47:55 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2016-11-07 17:52:57 +0100 |
commit | 4f748144b05375db436364e13186936eae6bcfd2 (patch) | |
tree | 1dd45f87326286e086751d164d261c23fe2c2cc7 | |
parent | a0b95db2b98c46520adced4263dc9982d8a1c8fd (diff) | |
download | ModemManager-4f748144b05375db436364e13186936eae6bcfd2.tar.gz |
port-probe: don't probe ignored ports
If a port has been flagged as ignored with the ID_MM_PORT_IGNORE udev property,
we shouldn't open and probe the ports in any way, just flag them as ignored. We
still report them in the list of modem ports, but just with "unknown" type and
therefore not using them for anything.
-rw-r--r-- | src/mm-port-probe.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index 0b4d227bf..f5dc90d20 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -1351,6 +1351,15 @@ mm_port_probe_run (MMPortProbe *self, /* The context will be owned by the task */ g_task_set_task_data (self->priv->task, ctx, (GDestroyNotify) port_probe_run_context_free); + /* If we're told to completely ignore the port, don't do any probing */ + if (self->priv->is_ignored) { + mm_dbg ("(%s/%s) port probing finished: skipping for blacklisted port", + mm_kernel_device_get_subsystem (self->priv->port), + mm_kernel_device_get_name (self->priv->port)); + port_probe_task_return_boolean (self, TRUE); + return; + } + /* Check if we already have the requested probing results. * We will fix here the 'ctx->flags' so that we only request probing * for the missing things. */ |