SD_RW_EXTENDED_ARGUMENT - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// sddef.h

typedef struct _SD_RW_EXTENDED_ARGUMENT {
  union {
    struct {
      ULONG Count : 9;
      ULONG Address : 17;
      ULONG OpCode : 1;
      ULONG BlockMode : 1;
      ULONG Function : 3;
      ULONG WriteToDevice : 1;
    } bits;
    ULONG AsULONG;
  } u;
} SD_RW_EXTENDED_ARGUMENT, *PSD_RW_EXTENDED_ARGUMENT;
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ns-sddef-sd_rw_extended_argument)

Description

The SD_RW_DIRECT_ARGUMENT structure is used in conjunction with the SdBusSubmitRequest routine or the SdBusSubmitRequestAsync routine to send a Secure Digital (SD) request to the bus driver that reads or writes to multiple registers.

Members

u

Name of the union

u.bits

A structure that contains the following members.

u.bits.Count

This member is ignored when submitting a device command to the bus driver. The transfer length is determined by SDBUS_REQUEST_PACKET.Parameters.DeviceCommand.Length, which is always in bytes irrespective of whether BlockMode is set to 0 or 1.

u.bits.Address

Indicates the address of the function space accessed by the operation.

u.bits.OpCode

Indicates, when 0, that the operation reads or writes data at a single I/O register address multiple times. A value of 1 indicates that the operation increments the address after each read or write.

u.bits.BlockMode

Indicates, when set to 1, that this transfer is using block mode. The function block length property (SDP_FUNCTION_BLOCK_LENGTH) specifies the size, in bytes, of a block.

u.bits.Function

Contains the number of the function on the I/O card whose data space is accessed by the operation. A value of 0 indicates that the operation should address the common I/O area rather than the I/O space of a particular card function.

To retrieve a function number for an SD device, a device driver must do the following:

  1. Set the RequestFunction member of SDBUS_REQUEST_PACKET to an SD_REQUEST_FUNCTION enumeration value of SDRF_GET_PROPERTY.

  2. Set the Property member of SDBUS_REQUEST_PACKET to SDP_FUNCTION_NUMBER.

  3. Send the request to the bus driver by passing the initialized SDBUS_REQUEST_PACKET structure to either SdBusSubmitRequest or SdBusSubmitRequestAsync.

u.bits.WriteToDevice

Indicates a write operation when set to 1, and a read operation when set to 0.

u.AsULONG

Contains all 32 bits of the data stored in the preceding members, represented as a ULONG.

See also

SdBusSubmitRequest

SdBusSubmitRequestAsync