diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin.c | 13 | ||||
-rw-r--r-- | src/mm-port-probe.c | 26 | ||||
-rw-r--r-- | src/mm-port-probe.h | 1 |
3 files changed, 37 insertions, 3 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index f1f3796e..2b4adeab 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)), diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index b25663f5..52096678 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -135,6 +135,9 @@ struct _MMPortProbePrivate { gboolean is_qmi; gboolean is_mbim; + /* From udev tags */ + gboolean is_ignored; + /* Current probing task. Only one can be available at a time */ PortProbeRunTask *task; }; @@ -1404,7 +1407,9 @@ mm_port_probe_list_has_at_port (GList *list) for (l = list; l; l = g_list_next (l)){ MMPortProbe *probe = MM_PORT_PROBE (l->data); - if (probe->priv->flags & MM_PORT_PROBE_AT && + + if (!probe->priv->is_ignored && + probe->priv->flags & MM_PORT_PROBE_AT && probe->priv->is_at) return TRUE; } @@ -1456,7 +1461,10 @@ mm_port_probe_list_has_qmi_port (GList *list) GList *l; for (l = list; l; l = g_list_next (l)) { - if (mm_port_probe_is_qmi (MM_PORT_PROBE (l->data))) + MMPortProbe *probe = MM_PORT_PROBE (l->data); + + if (!probe->priv->is_ignored && + mm_port_probe_is_qmi (probe)) return TRUE; } @@ -1487,7 +1495,10 @@ mm_port_probe_list_has_mbim_port (GList *list) GList *l; for (l = list; l; l = g_list_next (l)) { - if (mm_port_probe_is_mbim (MM_PORT_PROBE (l->data))) + MMPortProbe *probe = MM_PORT_PROBE (l->data); + + if (!probe->priv->is_ignored && + mm_port_probe_is_mbim (probe)) return TRUE; } @@ -1631,6 +1642,14 @@ mm_port_probe_list_is_icera (GList *probes) return FALSE; } +gboolean +mm_port_probe_is_ignored (MMPortProbe *self) +{ + g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE); + + return self->priv->is_ignored; +} + const gchar * mm_port_probe_get_port_name (MMPortProbe *self) { @@ -1692,6 +1711,7 @@ set_property (GObject *object, /* construct only */ self->priv->port = g_value_dup_object (value); self->priv->parent = g_udev_device_get_parent (self->priv->port); + self->priv->is_ignored = g_udev_device_get_property_as_boolean (self->priv->port, "ID_MM_PORT_IGNORE"); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h index ea7c98da..0b3226a0 100644 --- a/src/mm-port-probe.h +++ b/src/mm-port-probe.h @@ -131,6 +131,7 @@ gboolean mm_port_probe_is_mbim (MMPortProbe *self); const gchar *mm_port_probe_get_vendor (MMPortProbe *self); const gchar *mm_port_probe_get_product (MMPortProbe *self); gboolean mm_port_probe_is_icera (MMPortProbe *self); +gboolean mm_port_probe_is_ignored (MMPortProbe *self); /* Additional helpers */ gboolean mm_port_probe_list_has_at_port (GList *list); |