summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/uvideo.c25
-rw-r--r--sys/dev/usb/uvideo.h13
2 files changed, 35 insertions, 3 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;
diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h
index 3c3fcdd4530..f1673a6907c 100644
--- a/sys/dev/usb/uvideo.h
+++ b/sys/dev/usb/uvideo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.h,v 1.17 2008/07/02 21:28:50 mglocker Exp $ */
+/* $OpenBSD: uvideo.h,v 1.18 2008/07/03 09:50:04 mglocker Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -208,6 +208,17 @@ struct usb_video_camera_terminal_desc {
uByte *bmControls; /* XXX */
};
+/* Table 3-9: VC Extension Unit Descriptor */
+struct usb_video_vc_extension_desc {
+ uByte bLength;
+ uByte bDescriptorType;
+ uByte bDescriptorSubtype;
+ uByte bUnitID;
+ uByte guidExtensionCode[16];
+ uByte bNumControls;
+ uByte bNrInPins;
+} __packed;
+
/* Table 3-11: VC Endpoint Descriptor */
struct usb_video_vc_endpoint_desc {
uByte bLength;