aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-09-06 15:13:49 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-09-06 15:17:30 +0200
commitc1257579f84b1d353d515e11d2e1ac9130d0ad72 (patch)
tree277396b9f64d0b7778395653028e422cc0454d9b /src/mm-plugin-manager.c
parenta45508ba40fd6d1b76493cbe12b4e58a314938c4 (diff)
filter: new plugin whitelist logic
Several plugins define specific udev tags that must be available in the device in order for the plugins to use them. Let's use these tags as a direct indication that ModemManager can probe the devices. In particular, this change would make all Ericsson MBM modems probed right away also in STRICT filter mode, without needing to check the ttyACM interface type or the available net ports.
Diffstat (limited to 'src/mm-plugin-manager.c')
-rw-r--r--src/mm-plugin-manager.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c
index 2123bded..557c2d5d 100644
--- a/src/mm-plugin-manager.c
+++ b/src/mm-plugin-manager.c
@@ -1496,6 +1496,21 @@ mm_plugin_manager_peek_plugin (MMPluginManager *self,
/*****************************************************************************/
+static void
+register_plugin_whitelist_tags (MMPluginManager *self,
+ MMPlugin *plugin)
+{
+ const gchar **tags;
+ guint i;
+
+ if (!mm_filter_check_rule_enabled (self->priv->filter, MM_FILTER_RULE_PLUGIN_WHITELIST))
+ return;
+
+ tags = mm_plugin_get_allowed_udev_tags (plugin);
+ for (i = 0; tags && tags[i]; i++)
+ mm_filter_register_plugin_whitelist_tag (self->priv->filter, tags[i]);
+}
+
static MMPlugin *
load_plugin (const gchar *path)
{
@@ -1609,6 +1624,9 @@ load_plugins (MMPluginManager *self,
else
/* Vendor specific plugin */
self->priv->plugins = g_list_append (self->priv->plugins, plugin);
+
+ /* Register plugin whitelist tags in filter, if any */
+ register_plugin_whitelist_tags (self, plugin);
}
/* Check the generic plugin once all looped */