diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-03 09:50:05 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-07-03 09:50:05 +0000 |
commit | 5a0754bfe0405005d4644eea69c448e9c919787e (patch) | |
tree | b438a4c38f1236698ba9e13c204002e9689560e6 /sys/dev/usb/uvideo.c | |
parent | 4c44a880ad8826139c59a040d699dd08cf4c6e85 (diff) |
Add struct for VC_EXTENSION_UNIT and dump it in debug mode.
Diffstat (limited to 'sys/dev/usb/uvideo.c')
-rw-r--r-- | sys/dev/usb/uvideo.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 87d3d8653d8..375b7dff244 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.45 2008/07/02 21:28:50 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.46 2008/07/03 09:50:04 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -134,6 +134,8 @@ void uvideo_dump_desc_format_uncompressed(struct uvideo_softc *, const usb_descriptor_t *); void uvideo_dump_desc_frame_uncompressed(struct uvideo_softc *, const usb_descriptor_t *); +void uvideo_dump_desc_extension(struct uvideo_softc *, + const usb_descriptor_t *); void uvideo_hexdump(void *, int); int uvideo_debug_file_open(struct uvideo_softc *); void uvideo_debug_file_write_sample(void *); @@ -1429,7 +1431,8 @@ uvideo_dump_desc_all(struct uvideo_softc *sc) } else { printf(" (UDESCSUB_VC_EXTENSION_" "UNIT)\n"); - /* TODO */ + printf("|\n"); + uvideo_dump_desc_extension(sc, desc); } break; case UDESCSUB_VS_FRAME_MJPEG: @@ -1768,6 +1771,24 @@ uvideo_dump_desc_format_uncompressed(struct uvideo_softc *sc, } void +uvideo_dump_desc_extension(struct uvideo_softc *sc, + const usb_descriptor_t *desc) +{ + struct usb_video_vc_extension_desc *d; + + d = (struct usb_video_vc_extension_desc *)(uint8_t *)desc; + + printf("bLength=%d\n", d->bLength); + printf("bDescriptorType=0x%02x\n", d->bDescriptorType); + printf("bDescriptorSubtype=0x%02x\n", d->bDescriptorSubtype); + printf("bUnitID=0x%02x\n", d->bUnitID); + /* XXX we need a hexdump here */ + printf("guidExtensionCode=%s\n", d->guidExtensionCode); + printf("bNumControls=0x%02x\n", d->bNumControls); + printf("bNrInPins=0x%02x\n", d->bNrInPins); +} + +void uvideo_hexdump(void *buf, int len) { int i; |