filter: remove bogus TTY virtual console filter

The more generic filter for virtual devices already covers all cases
covered by the TTY virtual console filter.
This commit is contained in:
Aleksander Morgado
2017-10-12 23:00:09 +02:00
parent 4e26661e67
commit 239f7ba8a2
3 changed files with 6 additions and 17 deletions

View File

@@ -1131,7 +1131,6 @@ initable_init (GInitable *initable,
MM_FILTER_RULE_NET |
MM_FILTER_RULE_CDC_WDM |
MM_FILTER_RULE_TTY |
MM_FILTER_RULE_TTY_VIRTUAL_CONSOLE |
MM_FILTER_RULE_TTY_BLACKLIST |
MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY |
MM_FILTER_RULE_TTY_PLATFORM_DRIVER);

View File

@@ -72,14 +72,6 @@ mm_filter_port (MMFilter *self,
(g_strcmp0 (subsystem, "tty") == 0)) {
const gchar *physdev_subsystem;
/* Filter out virtual consoles (e.g. tty0, tty1, tty2...) */
if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_VIRTUAL_CONSOLE) &&
(name && strncmp (name, "tty", 3) == 0) &&
(g_ascii_isdigit (name[3]))) {
mm_dbg ("[filter] (%s/%s) port filtered: virtual console", subsystem, name);
return FALSE;
}
/* Ignore blacklisted tty devices. */
if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_BLACKLIST) &&
(mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_DEVICE_IGNORE"))) {
@@ -132,7 +124,6 @@ mm_filter_new (MMFilterRule enabled_rules)
mm_dbg ("[filter] cdc-wdm devices allowed: %s", RULE_ENABLED_STR (MM_FILTER_RULE_CDC_WDM));
mm_dbg ("[filter] tty devices allowed: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY));
if (self->priv->enabled_rules & MM_FILTER_RULE_TTY) {
mm_dbg ("[filter] virtual consoles filtered: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_VIRTUAL_CONSOLE));
mm_dbg ("[filter] blacklist applied: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_BLACKLIST));
mm_dbg ("[filter] manual scan only applied: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY));
mm_dbg ("[filter] platform driver check: %s", RULE_ENABLED_STR (MM_FILTER_RULE_TTY_PLATFORM_DRIVER));

View File

@@ -49,10 +49,9 @@ typedef enum { /*< underscore_name=mm_filter_rule >*/
MM_FILTER_RULE_NET = 1 << 1,
MM_FILTER_RULE_CDC_WDM = 1 << 2,
MM_FILTER_RULE_TTY = 1 << 3,
MM_FILTER_RULE_TTY_VIRTUAL_CONSOLE = 1 << 4,
MM_FILTER_RULE_TTY_BLACKLIST = 1 << 5,
MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY = 1 << 6,
MM_FILTER_RULE_TTY_PLATFORM_DRIVER = 1 << 7,
MM_FILTER_RULE_TTY_BLACKLIST = 1 << 4,
MM_FILTER_RULE_TTY_MANUAL_SCAN_ONLY = 1 << 5,
MM_FILTER_RULE_TTY_PLATFORM_DRIVER = 1 << 6,
} MMFilterRule;
MMFilter *mm_filter_new (MMFilterRule enabled_rules);