|
From: Tim R. <ti...@pr...> - 2019-07-26 22:48:45
|
David Levy wrote: > > Our device does not send a short packet when the transfer is complete but the driver probably does. We just provide the size of the data to send. _usb_device_send_data handles it. > And the biggest transfer is actually 0x407c bytes I forgot about the headers. So its not a multiple of packet size. That's fine. It's just important to understand how the transactions actually flow over the wire. The USB engine on your MQX4 will send things out 64 bytes at a time. So, this transfer will be sent out as 257 packets of 64 bytes, plus one packet of 60 bytes. If your driver does a read of, for example, 0x5000 bytes. that one read will keep gathering packets until the short one, at which point the transfer ends. If you sent a read of 0x2000 bytes, you would collect the first 128 packets, then the request would be completed. The device doesn't know that; it only knows that it has stopped seeing reads. If sent another read of 0x2000 bytes, you would collect the next 128 packets, and the request would be completed. The device still has more. If you sent another read of 0x2000 bytes, you'd collect the last two packets, one of 64, one of 60, and the request would complete because of the short packet. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |