Home | USB/PCI Driver and Firmware Tools Store | Contact us |
Search:
|

Technical Document #107


Doc ID: 107
Product: WinDriver & KernelDriver
Version: 5.04 - 5.22

When performing data transfers with WD_UsbTransfer(), what is the significance of the USB_SHORT_TRANSFER and USB_FULL_TRANSFER flags (Versions 5.04 - 5.22)?

These flags are available beginning with version 5.04 of WinDriver.

If the USB_SHORT_TRANSFER flag is set, then WD_UsbTransfer() will return on one of two occasions:
  1. A short packet (i.e. less than the maximum packet size) was transferred or the device transferred a zero (0) packet, to indicate a short transfer. In this case fOk will be TRUE.

  2. The time-out period (specified in usbTrans.dwTimeout) expired before a short packet was transferred (or a zero packet was received). In this case fOk will be FALSE.

If the USB_FULL_TRANSFER flag is set, then WD_UsbTransfer() will return on one of the following two occasions:
  1. The entire buffer (usbTrans.dwBytes) was filled/written. In this case fOk will be TRUE.

  2. The time-out period expired before the buffer was entirely filled/written. In this case fOk will be FALSE (although some data may very well have been transferred).

By default, the USB_SHORT_TRANSFER flag is set for bulk and interrupt transfers and the USB_FULL_TRANSFER flag is set for isochronous transfers. Control transfers are always short transfers.

In former versions of WinDriver (until, and including, v5.03), WD_UsbTransfer() behaved (for all types of transfers) as described above for the USB_SHORT_TRANSFER flag in v5.04 and above - i.e. the function always returned on one of two occasions:
  1. A short packet (i.e. less than the maximum packet size) was transferred or the device transferred a zero (0) packet, to indicate a short transfer - in which case fOK would have been TRUE (even if the buffer was not entirely filled/written).

  2. The time-out expired without any such transfer - in which case fOK would be FALSE.


Back to Top