diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-09-05 09:33:38 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-09-05 09:54:55 +0200 |
commit | 31f81725e628fd94233e62752ec386215d2b9e13 (patch) | |
tree | 5a45830de07c59af8d638b9a7d9e1cf905635350 /src/mm-plugin.c | |
parent | 8450e563bb79bd1e300bba1d2e89c6d39a173694 (diff) | |
download | ModemManager-31f81725e628fd94233e62752ec386215d2b9e13.tar.gz |
plugin: allow to explicitly ignore any kind of port via udev
The new 'ID_MM_PORT_IGNORE' tag will tell ModemManager to fully avoid using a
given port.
Note that it is key to not only flag the port probe as ignored, but also to
fully ignore the ports in e.g. mm_port_probe_list_has_qmi_port() as those
methods will be used to decide which kind of modem object to create. We don't
want to create a QMI-based modem which may have all QMI ports blacklisted.
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r-- | src/mm-plugin.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index f1f3796e2..2b4adeabc 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -865,6 +865,19 @@ mm_plugin_create_modem (MMPlugin *self, "unsupported subsystem: '%s'", mm_port_probe_get_port_subsys (probe)); } + /* Ports that are explicitly blacklisted will be grabbed as ignored */ + else if (mm_port_probe_is_ignored (probe)) { + mm_dbg ("(%s/%s): port is blacklisted", + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe)); + grabbed = mm_base_modem_grab_port (modem, + mm_port_probe_get_port_subsys (probe), + mm_port_probe_get_port_name (probe), + mm_port_probe_get_parent_path (probe), + MM_PORT_TYPE_IGNORED, + MM_PORT_SERIAL_AT_FLAG_NONE, + &inner_error); + } #if !defined WITH_QMI else if (mm_port_probe_get_port_type (probe) == MM_PORT_TYPE_NET && g_str_equal (mm_device_utils_get_port_driver (mm_port_probe_peek_port (probe)), |