On Thu, 8 Feb 2007, Edwin Olson wrote: > I forgot to ask an additional question: > > Is it sensible to have multiple outstanding read URBs, in the way that > there are multiple outstanding write URBs?
Yes. > On my embedded platform, it is fairly expensive to do write-merging in > order to send maximum length packets. (In other words, on my device, my > "write" syscalls have a 1:1 correspondence with USB packets; when these > packets are less than 64 bytes, I only get one packet per 1ms USB frame.) Why only one per frame? Why not more? Is that a limitation of the host controller driver on your platform? > If the host had multiple read URBs pending, would it continue to send IN > tokens after it had already received a short packet in that frame? Yes. > Could > I be safely assured that the bulk_read callbacks would occur in the > order already read, or would the driver need to do some explicit > fragment reassembly? I don't know what you mean by "fragment reassembly" -- USB has no notion of "fragments". I also don't know what you mean by "already read". But the completion callbacks would indeed occur in the order the URBs were submitted. The rule is simple: One accepted URB submission = one callback. (For 2.6 anyway; 2.4 had more a more complex rule.) > (Could read callbacks be called out of order or > concurrently on an SMP machine?) No. Nor could write callbacks. However read callbacks could be interspersed more or less arbitrarily among write callbacks -- although again, not concurrently. For more information, read the kerneldoc in the source file drivers/usb/core/urb.c. Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel