On Mon, 23 Mar 2009, Dave Mielke wrote: > [quoted lines by Alan Stern on 2009/03/23 at 17:10 -0400] > > >A bulk write can contain an arbitrary number of data packets. The > >actual number depends on the length of the data and the maxpacket size > >of the bulk-out endpoint. Each data packet other than the last one > >will have size equal to the maxpacket size. The size of the last > >data packet might be equal to maxpacket or it might be smaller -- it > >might even be 0. > > > >I don't know what the maxpacket size is for your device, but let's say > >it is 64 (which is typical for full-speed devices). > > It is 64. > > When you spoke of an even vs an odd number of packets being sent to the device, > is that a literal requirement, or is the requirement that all the packets for > an operation be sent? That was the literal requirement. On each successful data packet transfer, the toggle changes between 0 and 1. So after an odd number of data packets the toggle would be equal to 1 -- and that could be the source of a mismatch problem. > The packet size is 64 but the number of bytes written is always 43, so that'd > mean that each write uses only one packet. Should I need to care that an even > number of packets are sent, or is the device misbehaving? Clearly the device is misbehaving. It's up to you how to deal with it. Sending an even number of packets is a simple solution, and it will continue to work correctly even if the manufacturer fixes the device's bug. Alan Stern -- 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