diff options
-rw-r--r-- | sys/dev/usb/uvideo.c | 19 | ||||
-rw-r--r-- | sys/dev/usb/uvideo.h | 9 |
2 files changed, 11 insertions, 17 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index aaa42f919cd..91d40e1b765 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.141 2010/10/09 08:41:28 jakemsr Exp $ */ +/* $OpenBSD: uvideo.c,v 1.142 2010/10/09 09:48:03 jakemsr Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -674,20 +674,14 @@ uvideo_vc_parse_desc_pu(struct uvideo_softc *sc, { struct usb_video_vc_processing_desc *d; - d = (struct usb_video_vc_processing_desc *)(uint8_t *)desc; + /* PU descriptor is variable sized */ + d = (void *)desc; if (sc->sc_desc_vc_pu_num == UVIDEO_MAX_PU) { printf("%s: too many PU descriptors found!\n", DEVNAME(sc)); return (USBD_INVAL); } - /* XXX support variable bmControls fields */ - if (d->bControlSize != 2) { - printf("%s: video control not supported for this device.\n", - DEVNAME(sc)); - return (USBD_INVAL); - } - sc->sc_desc_vc_pu[sc->sc_desc_vc_pu_num] = d; sc->sc_desc_vc_pu_num++; @@ -2573,7 +2567,8 @@ uvideo_dump_desc_processing(struct uvideo_softc *sc, { struct usb_video_vc_processing_desc *d; - d = (struct usb_video_vc_processing_desc *)(uint8_t *)desc; + /* PU descriptor is variable sized */ + d = (void *)desc; printf("bLength=%d\n", d->bLength); printf("bDescriptorType=0x%02x\n", d->bDescriptorType); @@ -2584,8 +2579,8 @@ uvideo_dump_desc_processing(struct uvideo_softc *sc, printf("bControlSize=%d\n", d->bControlSize); printf("bmControls=0x"); uvideo_hexdump(d->bmControls, d->bControlSize, 1); - printf("iProcessing=0x%02x\n", d->iProcessing); - printf("bmVideoStandards=0x%02x\n", d->bmVideoStandards); + printf("iProcessing=0x%02x\n", d->bmControls[d->bControlSize]); + printf("bmVideoStandards=0x%02x\n", d->bmControls[d->bControlSize + 1]); } void diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h index 509f6f8deb4..44cb38d37a9 100644 --- a/sys/dev/usb/uvideo.h +++ b/sys/dev/usb/uvideo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.h,v 1.49 2010/10/09 08:41:28 jakemsr Exp $ */ +/* $OpenBSD: uvideo.h,v 1.50 2010/10/09 09:48:04 jakemsr Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -217,10 +217,9 @@ struct usb_video_vc_processing_desc { uByte bSourceID; uWord wMaxMultiplier; uByte bControlSize; - uWord bmControls; /* XXX must be variable size of bControlSize */ - uByte iProcessing; - uByte bmVideoStandards; - + uByte bmControls[255]; /* [bControlSize] */ + /* uByte iProcessing; */ + /* uByte bmVideoStandards; */ } __packed; /* Table 3-9: VC Extension Unit Descriptor */ |