Expand Minimize

WDF_USB_CONTROL_SETUP_PACKET union

[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
bm
Request
Recipient

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

Reserved

A reserved bit field. Do not use this member.

Type

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

Dir

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

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.

bRequest

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

wValue
Bytes
LowByte

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

HiByte

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

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.

wIndex
Bytes
LowByte

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

HiByte

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

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.

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

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.