Your browser does not allow scripts
Please click here to view a static table of contents without scripts
Driver Operation
Return to Introduction  Previous page  Next page
In the D2XX device driver, the maximum USB transfer size is set at 64Kbytes. This is necessary in order to support USB2.0 controllers: on USB2.0, we have found that transfer sizes greater than 64K fail catastrophically.

Current USB transfer size can be changed using the function
. The change comes into effect immediately, and any data that was held in the driver at the time of the change is lost.

Note that, currently,
FT_SetUSBParameters supports transfer size changes for the IN endpoint only, and the remainder of this note is restricted to consideration of read requests.

When a device is opened, the driver allocates two buffers: a USB transfer buffer of maximum USB transfer size bytes and a read buffer whose size is based on, but not the same as, the maximum USB transfer size. The current USB transfer size is set by default to 4Kbytes, but an application may setup the current USB transfer size anytime after a device has been opened. The driver performs USB requests of any size up to the current USB transfer size, then copies the data to the read buffer. The actual USB request size is determined by the space that is currently available in the read buffer. If the read buffer becomes full (i.e. there is not enough space in the read buffer to hold data returned from a USB request), the driver will stop issuing USB requests until space becomes available.

Data is removed from the read buffer when the application performs a read request. So the rate at which the application issues read requests has a direct bearing on the driver's ability to keep issuing USB requests. USB requests will continue to be issued as long as the application performs enough read requests to ensure that the read buffer does not become full.