Re: usb: gadget: How should an udc handle reception of more data than req.length?

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

 



On 2014-09-03 18:07, Alan Stern wrote:
On Wed, 3 Sep 2014, Andreas Larsson wrote:

Hi!

In short: How should a udc driver handle a situation when the host sends
more data than req.length in the receiving OUT request? What
should be reported to the gadget driver? What should be done with the
excess data?

It depends.  If req.length is a multiple of the endpoint's maxpacket
size then any excess must take the form of extra packets.  The UDC
should NAK these packets or apply them toward the next request on the
endpoint's queue, if there is one.

If req.length is not a multiple of the maxpacket size then an excess
could take the form of a packet that's too long.  The UDC should store
as much of the data as possible (i.e., to up req.length) in the
request's buffer and drop the rest, and the request should complete
with a status code of -EOVERFLOW.

Thanks a lot! This case was the one I was unsure of.

Cheers,
Andreas Larsson

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