Skip to content
Permalink
Browse files
usb: webcam: Invalid size of Processing Unit Descriptor
According with USB Device Class Definition for Video Device the
Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
but it has 11.

Invalid length caused that Processing Unit Descriptor Test Video form
CV tool failed. To fix this issue patch adds bmVideoStandards into
uvc_processing_unit_descriptor structure.

The bmVideoStandards field was added in UVC 1.1 and it wasn't part of
UVC 1.0a.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
  • Loading branch information
pawellcdns authored and intel-lab-lkp committed Mar 15, 2021
1 parent 4524cb7 commit 02bcbb1b029ca0cc6dd33c70363125bc2f3ce0d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
@@ -817,6 +817,7 @@ static struct usb_function_instance *uvc_alloc_inst(void)
pd->bmControls[0] = 1;
pd->bmControls[1] = 0;
pd->iProcessing = 0;
pd->bmVideoStandards = 0;

od = &opts->uvc_output_terminal;
od->bLength = UVC_DT_OUTPUT_TERMINAL_SIZE;
@@ -125,6 +125,7 @@ static const struct uvc_processing_unit_descriptor uvc_processing = {
.bmControls[0] = 1,
.bmControls[1] = 0,
.iProcessing = 0,
.bmVideoStandrads = 0,
};

static const struct uvc_output_terminal_descriptor uvc_output_terminal = {
@@ -302,9 +302,10 @@ struct uvc_processing_unit_descriptor {
__u8 bControlSize;
__u8 bmControls[2];
__u8 iProcessing;
__u8 bmVideoStandards;
} __attribute__((__packed__));

#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))
#define UVC_DT_PROCESSING_UNIT_SIZE(n) (10+(n))

/* 3.7.2.6. Extension Unit Descriptor */
struct uvc_extension_unit_descriptor {

0 comments on commit 02bcbb1

Please sign in to comment.