Expand Minimize

UsbBuildInterruptOrBulkTransferRequest routine

The UsbBuildInterruptOrBulkTransferRequest macro formats an URB to send or receive data on a bulk pipe, or to receive data from an interrupt pipe.

Syntax


void UsbBuildInterruptOrBulkTransferRequest(
  _Inout_   PURB Urb,
  _In_      USHORT Length,
  _In_      USBD_PIPE_HANDLE PipeHandle,
  _In_opt_  PVOID TransferBuffer,
  _In_opt_  PMDL TransferBufferMDL,
  _In_      ULONG TransferBufferLength,
  _In_      ULONG TransferFlags,
  _In_      PURB Link
);

Parameters

Urb [in, out]

Pointer to an URB to be formatted as an interrupt or bulk transfer request.

Length [in]

Specifies the size, in bytes, of the URB.

PipeHandle [in]

Specifies the handle for this pipe returned by the HCD when a configuration was selected.

TransferBuffer [in, optional]

Pointer to a resident buffer for the transfer or is NULL if an MDL is supplied in TransferBufferMDL. The contents of this buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, this buffer will contain data read from the device on return from the HCD. Otherwise, this buffer contains driver-supplied data to be transferred to the device.

TransferBufferMDL [in, optional]

Pointer to an MDL that describes a resident buffer or is NULL if a buffer is supplied in TransferBuffer. The contents of the buffer depend on the value of TransferFlags. If USBD_TRANSFER_DIRECTION_IN is specified, the described buffer will contain data read from the device on return from the HCD. Otherwise, the buffer contains driver-supplied data to be transferred to the device. The MDL must be allocated from nonpaged pool.

TransferBufferLength [in]

Specifies the length, in bytes, of the buffer specified in TransferBuffer or described in TransferBufferMDL.

TransferFlags [in]

Specifies zero, one, or a combination of the following flags:

USBD_TRANSFER_DIRECTION_IN

Is set to request data from a device. To transfer data to a device, this flag must be clear.

USBD_SHORT_TRANSFER_OK

Can be used if USBD_TRANSFER_DIRECTION_IN is set. If set, directs the HCD not to return an error if a packet is received from the device that is shorter than the maximum packet size for the endpoint. Otherwise, a short request returns an error condition.

Link [in]

Reserved. Must be set to NULL.

Return value

This routine does not return a value.

Requirements

Header

Usbdlib.h (include Usbdlib.h)

See also

URB
USB_DEVICE_DESCRIPTOR
Routines for USB Client Drivers

 

 

Send comments about this topic to Microsoft

Build date: 12/5/2013

Show:
© 2014 Microsoft. All rights reserved.