On Fri, 13 Jul 2007, Skip Rafferty wrote: > I am supporting a Peripheral Controller Driver (PCD) > for a USB device (hw and fw from a vendor) that > refuses to deliver data to its gadget driver client > when the data ends on a MaxPacketSize boundary (512 in > this case).
You're talking about data for a bulk endpoint, right? > The requests submitted to the PCD have an 8K buffer > and the incoming data length happens to be 4K in this > case. Then the controller driver is behaving correctly. It has no way to know that the message has ended; it has to assume that the data will continue until the buffer is filled or a short packet arrives. > I believe a ZLP from the host would force this driver > to deliver the data in a partially filled buffer to > the gadget driver, but I haven't verified this yet. It > appears that USB host drivers don't do this > automatically, and the apps I'm using don't either. What class of gadget and what application are you using? What type of host system? > A workaround is for my gadget driver to submit > requests to the PCD that contain buffers which are > MAXP in size. This enables the PCD to either fill a > buffer or get a short packet interrupt. Not very > appealing due to the extra interrupt handling. > > Any advice or shared experiences on solving this type > of problem would be appreciated. Judging from your description, the problem is built into the application protocol. Bulk endpoints handle streams of data; message boundaries are located only by short packets and by agreement between the host and the device. If the host hasn't told your gadget driver how much data to expect then you have no way to know how much it will send. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel