Re: [PATCH 5/7] usb: dwc3: ep0: add handling for unaligned OUT transfers

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

 



* Felipe Balbi | 2011-08-29 14:35:29 [+0300]:

>Hi,
Hi,

>On Mon, Aug 29, 2011 at 01:28:50PM +0200, Sebastian Andrzej Siewior wrote:
>> * Felipe Balbi | 2011-08-29 11:51:34 [+0300]:
>> So I'm for fixing the gadget.
>
>We could go that path, sure. But then this means that gadget driver will
>be doing something different than requested on specification, just
>because this one controller is quirky.

IMHO this is just an implementation detail and it is not seen on wire /
by the host.
So the gadget *knows* it becomes only 5 bytes but it queues
maxpacketsize anyway. On completion it should becomes only 5 bytes
right? Anything else would be wrong. So it will become 5 bytes only.
Should 6 bytes arrive then it can complain to the host.

>A better approach might be to introduce a "quirks" field on struct
>usb_gadget, as have gadget drivers check for that. Something like:
>
>	if (gadget->quirks & GADGET_NEEDS_ALIGNED_OUT)
>		req->length = gadget->ep0->maxpacket;
>	else
>		req->length = len;

This is bad because you have to ensure the buffer is large enough. For
ep0 the composite framework allocated bMaxPacketSize0 anyway right?

>but then, gadget driver needs to cope with whatever size we might need
>to send. In case of most gadget drivers, it's very simple because they
>will only receive data which is less than or equal to wMaxPacketSize,
>but on gadget drivers such as DFU, we might need to be careful here.

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