plugin: for non-AT ports, don't expect vendor/product string probing

When running the pre-probing VID/PID filters, the ports were not filtered out if
the plugin had configured post-probing vendor/product string filters. But, these
post-probing filters are only applicable to AT ports.

From now on, this logic will not be applied to non-serial ports. In other words,
pre-probing VID/PID filters applied to non-serial ports will always result in
the port being filtered out or being allowed, regardless of any additional
vendor/product string post-probing filter configured by the plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=710437
This commit is contained in:
Aleksander Morgado
2013-10-28 18:13:14 +01:00
parent 9c2be510f6
commit b09044bcb3

View File

@@ -311,12 +311,17 @@ apply_pre_probing_filters (MMPlugin *self,
}
}
/* If we got filtered by vendor or product IDs and we do not have vendor
* or product strings to compare with: unsupported */
/* If we got filtered by vendor or product IDs; mark it as unsupported only if:
* a) we do not have vendor or product strings to compare with (i.e. plugin
* doesn't have explicit vendor/product strings
* b) the port is NOT an AT port which we can use for AT probing
*/
if ((vendor_filtered || product_filtered) &&
!self->priv->vendor_strings &&
!self->priv->product_strings &&
!self->priv->forbidden_product_strings) {
((!self->priv->vendor_strings &&
!self->priv->product_strings &&
!self->priv->forbidden_product_strings) ||
g_str_equal (g_udev_device_get_subsystem (port), "net") ||
g_str_has_prefix (g_udev_device_get_name (port), "cdc-wdm"))) {
mm_dbg ("(%s) [%s] filtered by vendor/product IDs",
self->priv->name,
g_udev_device_get_name (port));