Hi,

How do you implement buffers for streaming USB data in a kernel driver?

For me, ring buffers would be an obvious choice, however, what if I
allocate
a 128byte buffer just for the sake of this example, and submit URBs with
64 byte transfer buffers. For the first bulk IN transfer, the 64 byte
arrives
OK, however, for the second, let's suppose that the URB returns with
only
32 bytes instead of 64 (AFAIK the usb core is legitimate to do this..)
Then at the next 64 byte transfer, the ring buffer would wrap around in
the middle
of the packet..
Or do you re-submit an URB w/ only 32 bytes if that is the ammount left
at the
end of the ring buffer? Or maybe you start over at the beginning of the
ring buffer
where there is enough space?
(suppose the user already read and removed the first 64 byte packet from
the buffer by that time)

I've also read that the kernel has a generic ring buffer implementation,
is there
an USB driver example using it?

Regards,
Istvan




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to