aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-02-06 18:38:32 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-02-16 17:30:38 +0100
commit51ab292802e21d1031c54bcab8c449d18b97ceaa (patch)
tree1e8426240d53378c9cceb2487ed1e0d68b8ddc7c /src
parentb1159453998e6dc89ba31a803c4c3886c8da0605 (diff)
plugin: let vendor/product filter be complementary
So that a plugin can specify a full VID and a specific PID subset of another VID as supported.
Diffstat (limited to 'src')
-rw-r--r--src/mm-plugin.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index a83baea8..372f1fc0 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -308,6 +308,14 @@ apply_pre_probing_filters (MMPlugin *self,
if (!self->priv->product_ids[i].l)
product_filtered = TRUE;
}
+
+ /* When both vendor ids and product ids are given, it may be the case that
+ * we're allowing a full VID1 and only a subset of another VID2, so try to
+ * handle that properly. */
+ if (vendor_filtered && !product_filtered)
+ vendor_filtered = FALSE;
+ if (product_filtered && self->priv->vendor_ids && !vendor_filtered)
+ product_filtered = FALSE;
}
/* If we got filtered by vendor or product IDs; mark it as unsupported only if: