Always show class

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-07-18 01:35:55 +02:00
parent a17b90f0ec
commit 03f286ea9f

View file

@ -29,11 +29,11 @@
static const char *usb_classes[] = static const char *usb_classes[] =
{ {
"", "Unknown",
"Audio", "Audio",
"Communication Interface", "Communication Interface",
"HID", "HID",
"", "Unknown",
"Physical", "Physical",
"Image", "Image",
"Printer", "Printer",
@ -138,9 +138,9 @@ usb_iterate (grub_usb_device_t dev)
usb_print_str ("Vendor", dev, descdev->strvendor); usb_print_str ("Vendor", dev, descdev->strvendor);
usb_print_str ("Serial", dev, descdev->strserial); usb_print_str ("Serial", dev, descdev->strserial);
if (descdev->class > 0 && descdev->class <= 0x0E)
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
descdev->class, usb_classes[descdev->class], descdev->class, descdev->class < ARRAY_SIZE (usb_classes)
? usb_classes[descdev->class] : "Unknown",
descdev->subclass, descdev->protocol); descdev->subclass, descdev->protocol);
grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n", grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n",
descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F, descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F,
@ -164,9 +164,9 @@ usb_iterate (grub_usb_device_t dev)
grub_printf ("Interface #%d: #Endpoints: %d ", grub_printf ("Interface #%d: #Endpoints: %d ",
i, interf->endpointcnt); i, interf->endpointcnt);
if (interf->class > 0 && interf->class <= 0x0E)
grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n",
interf->class, usb_classes[interf->class], interf->class, interf->class < ARRAY_SIZE (usb_classes)
? usb_classes[interf->class] : "Unknown",
interf->subclass, interf->protocol); interf->subclass, interf->protocol);
usb_print_str ("Interface", dev, interf->strif); usb_print_str ("Interface", dev, interf->strif);