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.
This commit is contained in:
@@ -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)),
|
||||
|
Reference in New Issue
Block a user