WDF_USB_CONTROL_SETUP_PACKET union (wdfusb.h)

[Applies to KMDF and UMDF]

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

Syntax

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

Members

Packet

Packet.bm

Packet.bm.Request

Packet.bm.Request.Recipient

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

Packet.bm.Request.Reserved

A reserved bit field. Do not use this member.

Packet.bm.Request.Type

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

Packet.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.bRequest

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

Packet.wValue

Packet.wValue.Bytes

Packet.wValue.Bytes.LowByte

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

Packet.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

Packet.wIndex.Bytes

Packet.wIndex.Bytes.LowByte

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

Packet.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.

Packet.wLength

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

Generic

Generic.Bytes[8]

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

Requirement Value
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