diff options
author | imp <imp@FreeBSD.org> | 2004-08-15 23:39:18 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-08-15 23:39:18 +0000 |
commit | 0c243144c1343f5acd3e77bba947376e73b004cc (patch) | |
tree | 923b659ccab332b52af22d65eda3007d5a0265aa /sys/dev/usb/usb_subr.c | |
parent | 7a3bb5bd7ec70b9c0f9b5b04f647f22db5c4b9f6 (diff) | |
download | FreeBSD-src-0c243144c1343f5acd3e77bba947376e73b004cc.zip FreeBSD-src-0c243144c1343f5acd3e77bba947376e73b004cc.tar.gz |
Tweak the compatibility macros a little so that the device printing is
moved into them.
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r-- | sys/dev/usb/usb_subr.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 3f50e63..6b930d1 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -321,15 +321,17 @@ void usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) { usb_device_descriptor_t *udd = &dev->ddesc; + usbd_interface_handle iface; char vendor[USB_MAX_STRING_LEN]; char product[USB_MAX_STRING_LEN]; int bcdDevice, bcdUSB; + usb_interface_descriptor_t *id; usbd_devinfo_vp(dev, vendor, product, 1); cp += sprintf(cp, "%s %s", vendor, product); - if (showclass) + if (showclass & USBD_SHOW_DEVICE_CLASS) cp += sprintf(cp, ", class %d/%d", - udd->bDeviceClass, udd->bDeviceSubClass); + udd->bDeviceClass, udd->bDeviceSubClass); bcdUSB = UGETW(udd->bcdUSB); bcdDevice = UGETW(udd->bcdDevice); cp += sprintf(cp, ", rev "); @@ -337,6 +339,14 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) *cp++ = '/'; cp += usbd_printBCD(cp, bcdDevice); cp += sprintf(cp, ", addr %d", dev->address); + if (showclass & USBD_SHOW_INTERFACE_CLASS) + { + /* fetch the interface handle for the first interface */ + (void)usbd_device2interface_handle(dev, 0, &iface); + id = usbd_get_interface_descriptor(iface); + cp += sprintf(cp, ", iclass %d/%d", + id->bInterfaceClass, id->bInterfaceSubClass); + } *cp = 0; } |