_WDF_USB_CONTROL_SETUP_PACKET structure

[Applies to KMDF and UMDF]

The WDF_USB_CONTROL_SETUP_PACKET structure describes a setup packet for a USB control transfer.

Syntax

typedef struct _WDF_USB_CONTROL_SETUP_PACKET {
  struct {
    struct {
      struct {
        BYTE  : 1 Dir;
        BYTE  : 2 Recipient;
        BYTE  : 3 Reserved;
        BYTE  : 2 Type;
      } Request;
      BYTE   Byte;
    } bm;
    BYTE   bRequest;
    USHORT wLength;
    struct {
      struct {
        BYTE HiByte;
        BYTE LowByte;
      } Bytes;
      USHORT Value;
    } wValue;
    struct {
      struct {
        BYTE HiByte;
        BYTE LowByte;
      } Bytes;
      USHORT Value;
    } wIndex;
  } Packet;
  struct {
    BYTE Bytes[8];
  } Generic;
} WDF_USB_CONTROL_SETUP_PACKET, *PWDF_USB_CONTROL_SETUP_PACKET;

Members

Packet

bRequest

A request type. Request type constants are defined in Usb100.h. For more information about request types, see the USB specification.

wLength

The number of bytes to transfer, if applicable. For more information about this value, see the USB specification. The framework sets this value.

Packet.bm.Request

bm.Request.Recipient

A bit field that is specified by a WDF_USB_BMREQUEST_RECIPIENT-typed value.

bm.Request.Reserved

A reserved bit field. Do not use this member.

bm.Request.Type

A bit field that is specified by a WDF_USB_BMREQUEST_TYPE-typed value.

bm.Request.Dir

A bit field that is specified by a WDF_USB_BMREQUEST_DIRECTION-typed value.

Packet.bm.Byte

A byte-sized bitmap that contains the Request.Recipient, Request.Reserved, Request.Type, and Request.Dir bit fields. Use this member as an alternative to specifying the individual bit fields.

Packet.wValue.Bytes

wValue.Bytes.LowByte

The low byte of a 2-byte, request-specific value. For more information about specifying wValue, see the USB specification.

wValue.Bytes.HiByte

The high byte of a 2-byte, request-specific value.

Packet.wValue.Value

A 2-byte value that contains the Bytes.LowByte and Bytes.HiByte values. Use this member as an alternative to specifying individual low-byte and high-byte values.

Packet.wIndex.Bytes

wIndex.Bytes.LowByte

The low byte of a 2-byte, request-specific value. For more information about specifying wValue, see the USB specification.

wIndex.Bytes.HiByte

The high byte of a 2-byte, request-specific value.

Packet.wIndex.Value

A 2-byte value that contains the Bytes.LowByte and Bytes.HiByte values. Use this member as an alternative to specifying individual low-byte and high-byte values.

Generic

Bytes

An 8-byte value that represents the entire setup packet. You can use this member as an alternative to specifying individual structure members.

Remarks

The WDF_USB_CONTROL_SETUP_PACKET structure is used as input to the WdfUsbTargetDeviceSendControlTransferSynchronously and WdfUsbTargetDeviceFormatRequestForControlTransfer methods.

To initialize a WDF_USB_CONTROL_SETUP_PACKET structure, the driver should call one of the following functions:

Requirements

   
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfusb.h (include Wdfusb.h)

See Also

WDF_USB_BMREQUEST_DIRECTION

WDF_USB_BMREQUEST_RECIPIENT

WDF_USB_BMREQUEST_TYPE

WdfUsbTargetDeviceFormatRequestForControlTransfer

WdfUsbTargetDeviceSendControlTransferSynchronously