Re: [PATCH V3 1/5] usb: gadget/uvc: Fix VS_INPUT_HEADER.bEndpointAddress and Video Streaming.bEndpointAddress values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bhupesh,

On Monday 11 February 2013 11:32:14 Bhupesh SHARMA wrote:
> > > On Thursday 17 January 2013 16:23:49 Bhupesh Sharma wrote:
> > > > This patch corrects the VS_INPUT_HEADER.bEndpointAddress and Video
> > > > Streaming.bEndpointAddress values which were incorrectly set to 0 in
> > > > UVC function driver.
> > > > 
> > > > As 'usb_ep_autoconfig' function returns an un-claimed usb_ep, and
> > > > modifies the endpoint descriptor's bEndpointAddress, so there is no
> > > > need to again set the bEndpointAddress for Video Streaming and
> > > > VS_INPUT_HEADER decriptors (for all speeds: SS/HS/FS) to the
> > > > bEndpointAddress obtained for Full Speed case from
> > > > 'usb_ep_autoconfig' function call.
> > > 
> > > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@xxxxxx>
> > > > ---
> > > > 
> > > >  drivers/usb/gadget/f_uvc.c |   30 ++++++++++++++++++++----------
> > > >  1 files changed, 20 insertions(+), 10 deletions(-)
> > > > 
> > > > diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
> > > > index b34349f..1769f3e 100644
> > > > --- a/drivers/usb/gadget/f_uvc.c
> > > > +++ b/drivers/usb/gadget/f_uvc.c
> > > > @@ -550,8 +550,24 @@ uvc_copy_descriptors(struct uvc_device *uvc,
> > > 
> > > enum
> > > 
> > > > usb_device_speed speed) UVC_COPY_DESCRIPTORS(mem, dst,
> > > > 
> > > >  		(const struct usb_descriptor_header**)uvc_streaming_cls);
> > > >  	
> > > >  	uvc_streaming_header->wTotalLength =
> > > 
> > > cpu_to_le16(streaming_size);
> > > 
> > > > -	uvc_streaming_header->bEndpointAddress =
> > > > -		uvc_fs_streaming_ep.bEndpointAddress;
> > > > +
> > > > +	switch (speed) {
> > > > +	case USB_SPEED_SUPER:
> > > > +		uvc_streaming_header->bEndpointAddress =
> > > > +			uvc_ss_streaming_ep.bEndpointAddress;
> > > > +		break;
> > > > +
> > > > +	case USB_SPEED_HIGH:
> > > > +		uvc_streaming_header->bEndpointAddress =
> > > > +			uvc_hs_streaming_ep.bEndpointAddress;
> > > > +		break;
> > > > +
> > > > +	case USB_SPEED_FULL:
> > > > +	default:
> > > > +		uvc_streaming_header->bEndpointAddress =
> > > > +			uvc_fs_streaming_ep.bEndpointAddress;
> > > > +		break;
> > > > +	}
> > > 
> > > I don't think this will work. A superspeed device will see
> > > uvc_copy_descriptor called 3 times, once for each speed. As only
> > > uvc_ss_streaming_ep.bEndpointAddress is set in that case, high-speed
> > > and full-speed descriptors will have a zero endpoint value.
> > 
> > Not exactly. The uvc_copy_descriptor is called only once for a superspeed
> > device (at-least on my DWC3 UDC controller) depending on the highest
> > speed exported by the UDC controller driver.
> > 
> > I have tested this patch with DWC3 controller driver and it works fine and
> > I can confirm that my original patch works fine.
> > Maybe someone else can test the same with his UDC controller driver.
> > 
> > @Michael: Have you tested my original patch with your UDC controller and
> > does it work fine at your end?
> 
> Sorry. Ignore the noise :)

No worries.

> I had some local modifications to the code.
> I will test again only with patches in Laurent's branch.

Thank you. The git://linuxtv.org/pinchartl/uvcvideo.git uvc-gadget branch 
contains the latest code, please make sure you base new patches on top of it.

I would like to push it in the near future, so test results for that branch 
would be appreciated. We can then work on getting your remaining patches ready 
for mainline.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux