aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-04-08 16:22:52 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-04-08 17:53:42 +0200
commit93e4c8625beb1dab16dd2ae23b6d09587200fea8 (patch)
tree4b6ccdb25a17247ab839110412faf13c82499533 /src/mm-plugin.c
parent4b058872a092fa85413fa905c37a6a1510a7a056 (diff)
plugin: don't match generic plugin by name
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r--src/mm-plugin.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index 6849218d..4f3ec18d 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -64,8 +64,9 @@ static const gchar *virtual_port[] = {"smd0", NULL};
struct _MMPluginPrivate {
- gchar *name;
+ gchar *name;
GHashTable *tasks;
+ gboolean is_generic;
/* Pre-probing filters */
gchar **subsystems;
@@ -107,6 +108,7 @@ struct _MMPluginPrivate {
enum {
PROP_0,
PROP_NAME,
+ PROP_IS_GENERIC,
PROP_ALLOWED_SUBSYSTEMS,
PROP_ALLOWED_DRIVERS,
PROP_FORBIDDEN_DRIVERS,
@@ -156,6 +158,12 @@ mm_plugin_get_allowed_product_ids (MMPlugin *self)
return self->priv->product_ids;
}
+gboolean
+mm_plugin_is_generic (MMPlugin *self)
+{
+ return self->priv->is_generic;
+}
+
/*****************************************************************************/
static gboolean
@@ -1110,6 +1118,10 @@ set_property (GObject *object,
/* Construct only */
self->priv->name = g_value_dup_string (value);
break;
+ case PROP_IS_GENERIC:
+ /* Construct only */
+ self->priv->is_generic = g_value_get_boolean (value);
+ break;
case PROP_ALLOWED_SUBSYSTEMS:
/* Construct only */
self->priv->subsystems = g_value_dup_boxed (value);
@@ -1232,6 +1244,9 @@ get_property (GObject *object,
case PROP_NAME:
g_value_set_string (value, self->priv->name);
break;
+ case PROP_IS_GENERIC:
+ g_value_set_boolean (value, self->priv->is_generic);
+ break;
case PROP_ALLOWED_SUBSYSTEMS:
g_value_set_boxed (value, self->priv->subsystems);
break;
@@ -1370,6 +1385,14 @@ mm_plugin_class_init (MMPluginClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property
+ (object_class, PROP_IS_GENERIC,
+ g_param_spec_boolean (MM_PLUGIN_IS_GENERIC,
+ "Generic",
+ "Whether the plugin is the generic one",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property
(object_class, PROP_ALLOWED_SUBSYSTEMS,
g_param_spec_boxed (MM_PLUGIN_ALLOWED_SUBSYSTEMS,
"Allowed subsystems",