Re: [PATCH] USB: accept some invalid ep0-maxpacket values

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

 



On Wed, 20 Oct 2010, Sarah Sharp wrote:

> On Thu, Oct 14, 2010 at 03:25:21PM -0400, Alan Stern wrote:
> > A few devices (such as the RCA VR5220 voice recorder) are so
> > non-compliant with the USB spec that they have invalid maxpacket sizes
> > for endpoint 0.  Nevertheless, as long as we can safely use them, we
> > may as well do so.
> > 
> > This patch (as1432) softens our acceptance criterion by allowing
> > high-speed devices to have ep0-maxpacket sizes other than 64.  A
> > warning is printed in the system log when this happens, and the
> > existing error message is clarified.
> 
> Alan, it looks like this patch allows udev->ep0.desc.wMaxPacketSize to
> be set to the illegal value.

Yes.

>  The xHCI driver has to communicate the max
> packet size to the host hardware, and the driver will update the control
> endpoint's max packet size once the descriptor is fetched.
> 
> However, the code in xhci_urb_enqueue() to update the max packet size is
> only called if the device is running at full speed.  So I think this
> buggy device will work fine under xHCI, but the control transfers will
> be broken up into 64-byte packets rather than whatever illegal size the
> device wanted.  Do you know if this will be an issue?

Certainly it will.  The device doesn't accept 64-byte control packets; 
the original bug report demonstrated that.

>  How will EHCI
> schedule the control transfers with an illegal max packet size?

EHCI hardware doesn't care that the maxpacket size is illegal.  It just 
uses whatever size the driver tells it.

> I could change the xHCI driver to update the max packet size for
> non-full speed devices as well, but I'm not sure what the host hardware
> will do with an illegal value.  It may just reject the Evaluate Context
> command, which would show up as a bunch of failed control transfers
> after the descriptor was fetched.

That's okay.  It means this non-compliant device simply won't work when 
plugged into an xHCI controller, regardless of the OS.  Not much we can 
do about that.  You might as well go ahead and make the change.

Alan Stern

--
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