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:58:13 +0100 |
commit | db49d529602a3b60a5a2f7d3b821e3643506b535 (patch) | |
tree | 74f01ece6709188df321ea41f5c3f0c79aeb5d19 | |
parent | a6db7c06f6e5c6c9c8f1c312783892051bb1ed95 (diff) |
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.
(cherry picked from commit 4f748144b05375db436364e13186936eae6bcfd2)
-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 908b1344..26f2d135 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -1352,6 +1352,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", + g_udev_device_get_subsystem (self->priv->port), + g_udev_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. */ |