Add more standard USB identifier GUIDs

These are specified in:
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/standard-usb-identifiers
This commit is contained in:
Richard Hughes 2018-11-29 11:08:05 +00:00
parent 57908bebc1
commit 74f976a821

View File

@ -228,6 +228,7 @@ fu_usb_device_probe (FuDevice *device, GError **error)
g_autofree gchar *devid1 = NULL;
g_autofree gchar *devid2 = NULL;
g_autofree gchar *vendor_id = NULL;
g_autoptr(GPtrArray) intfs = NULL;
/* set vendor ID */
vendor_id = g_strdup_printf ("USB:0x%04X", g_usb_device_get_vid (priv->usb_device));
@ -255,6 +256,29 @@ fu_usb_device_probe (FuDevice *device, GError **error)
g_usb_device_get_vid (priv->usb_device));
fu_device_add_guid (device, devid0);
/* add the interface GUIDs */
intfs = g_usb_device_get_interfaces (priv->usb_device, error);
if (intfs == NULL)
return FALSE;
for (guint i = 0; i < intfs->len; i++) {
GUsbInterface *intf = g_ptr_array_index (intfs, i);
g_autofree gchar *intid1 = NULL;
g_autofree gchar *intid2 = NULL;
g_autofree gchar *intid3 = NULL;
intid1 = g_strdup_printf ("USB\\CLASS_%02X&SUBCLASS_%02X&PROT_%02X",
g_usb_interface_get_class (intf),
g_usb_interface_get_subclass (intf),
g_usb_interface_get_protocol (intf));
fu_device_add_guid (device, intid1);
intid2 = g_strdup_printf ("USB\\CLASS_%02X&SUBCLASS_%02X",
g_usb_interface_get_class (intf),
g_usb_interface_get_subclass (intf));
fu_device_add_guid (device, intid2);
intid3 = g_strdup_printf ("USB\\CLASS_%02X",
g_usb_interface_get_class (intf));
fu_device_add_guid (device, intid3);
}
/* subclassed */
if (klass->probe != NULL) {
if (!klass->probe (self, error))