[Linux-uvc-devel] [PATCH] lsusb.c: Fix video class output and input headers

Laurent Pinchart laurent.pinchart at skynet.be
Wed Aug 29 23:09:54 CEST 2007


On Tuesday 28 August 2007, Brandon Philips wrote:
> Fix the offsets in the printf for the video class output and input
> headers.  Tested with UVC device 046d:08cb by Logitech, Inc.
>
> Copied from USB_Video_Class_1.1.pdf Table 3.9.2.1 for reference:
>
> Offset	Field			Size	Value
> 0	bLength			1	Number
> 1	bDescriptorType		1	Constant
> 2	bDescriptorSubtype	1	Constant
> 3	bNumFormats		1	Number
> 4	wTotalLength		2	Number
> 6	bEndpointAddress	1	Endpoint
> 7	bmInfo			1	Bitmap
> 8	bTerminalLink		1	Constant
> 9	bStillCaptureMethod	1	Number
> 10	bTriggerSupport		1	Number
> 11	bTriggerUsage		1	Number
> 12	bControlSize		1	Number
>
> Output from instrumented uvcvideo.ko:
>
>         bNumFormats                        3
>         wTotalLength                      742
>         bEndPointAddress                  129
>         bmInfo                              0
>         bTerminalLink                       5
>         bStillCaptureMethod                 2
>         bTriggerSupport                     1
>         bTriggerUsage                       0
>         bControlSize                        1
>
> Output from corrected lsusb:
>
>         bNumFormats                        3
>         wTotalLength                      742
>         bEndPointAddress                  129
>         bmInfo                              0
>         bTerminalLink                       5
>         bStillCaptureMethod                 2
>         bTriggerSupport                     1
>         bTriggerUsage                       0
>         bControlSize                        1
>
>
> Signed-off-by: Brandon Philips <bphilips at suse.de>

Acked-by: Laurent Pinchart <laurent.pinchart at skynet.be>

>
> ---
>  lsusb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Index: usbutils-0.72/lsusb.c
> ===================================================================
> --- usbutils-0.72.orig/lsusb.c
> +++ usbutils-0.72/lsusb.c
> @@ -1497,7 +1497,7 @@ static void dump_videostreaming_interfac
>  		n = buf[12];
>  		if (buf[0] < 13+p*n)
>  			printf("      Warning: Descriptor too short\n");
> -		printf("        bNumFormarts                    %5u\n"
> +		printf("        bNumFormats                    %5u\n"
>  		       "        wTotalLength                    %5u\n"
>  		       "        bEndPointAddress                %5u\n"
>  		       "        bmInfo                          %5u\n"
> @@ -1506,8 +1506,8 @@ static void dump_videostreaming_interfac
>  		       "        bTriggerSupport                 %5u\n"
>  		       "        bTriggerUsage                   %5u\n"
>  		       "        bControlSize                    %5u\n",
> -		       p, buf[5] | (buf[6] << 8), buf[7], buf[8], buf[9],
> -		       buf[10], buf[11], buf[12], n);
> +		       p, buf[4] | (buf[5] << 8), buf[6], buf[7], buf[8],
> +		       buf[9], buf[10], buf[11], n);
>  		for(i = 0; i < p; i++)
>  			printf("        bmaControls(%2u)                 %5u\n", i,
> buf[13+p*n]); dump_junk(buf, "        ", 13+p*n);
> @@ -1524,7 +1524,7 @@ static void dump_videostreaming_interfac
>  		       "        bEndpointAddress            %5u\n"
>  		       "        bTerminalLink               %5u\n"
>  		       "        bControlSize                %5u\n",
> -		       p, buf[4] | (buf[5] << 8), buf[6], buf[8], n);
> +		       p, buf[4] | (buf[5] << 8), buf[6], buf[7], n);
>  		for(i = 0; i < p; i++)
>  			printf("        bmaControls(%2u)             %5u\n", i, buf[9+p*n]);
>  		dump_junk(buf, "        ", 9+p*n);



More information about the Linux-uvc-devel mailing list