SDBUS_REQUEST_PACKET structure (ntddsd.h)

The SDBUS_REQUEST_PACKET structure specifies the parameters for the individual requests and commands that the SdBusSubmitRequest routine sends to the bus driver.

Syntax

typedef struct _SDBUS_REQUEST_PACKET {
  SD_REQUEST_FUNCTION RequestFunction;
  PVOID               UserContext[3];
  ULONG_PTR           Information;
  union {
    UCHAR        AsUCHAR[16];
    ULONG        AsULONG[4];
    SDRESP_TYPE3 Type3;
  } ResponseData;
  UCHAR               ResponseLength;
  UCHAR               Reserved;
  USHORT              Flags;
  union {
    struct {
      SDBUS_PROPERTY Property;
      PVOID          Buffer;
      ULONG          Length;
    } GetSetProperty;
    struct {
      SDCMD_DESCRIPTOR CmdDesc;
      ULONG            Argument;
      PMDL             Mdl;
      ULONG            Length;
    } DeviceCommand;
    struct {
      SDBUS_ERASE_TYPE EraseType;
      ULONG            StartBlock;
      ULONG            EndBlock;
    } EraseCommand;
    struct {
      ULONG Frequency;
    } MmcSoftReset;
    struct {
      PIRP IrpToHpi;
    } MmcHpi;
  } Parameters;
} SDBUS_REQUEST_PACKET, *PSDBUS_REQUEST_PACKET;

Members

RequestFunction

Contains an enumeration value of type SD_REQUEST_FUNCTION that specifies the parameters for the operation and how they are interpreted.

UserContext[3]

Contains a buffer area for optional use by the caller. The bus driver does not use this member.

Information

Contains the status of the request on output.

ResponseData

Defines the ResponseData union.

ResponseData.AsUCHAR[16]

Contains a maximum of 16 bytes of response data on output. For more information about the response data, see the Secure Digital (SD) specification.

ResponseData.AsULONG[4]

Contains a maximum of 16 bytes of response data on output. For more information about the response data, see the Secure Digital (SD) specification.

ResponseData.Type3

Defines the SDRESP_TYPE3 member Type3.

ResponseLength

Indicates the length, in bytes, of the response data.

Reserved

Reserved, set to 0.

Flags

Flags field for the SDRP.

Parameters

Parameters to the individual functions.

Parameters.GetSetProperty

The property functions allow the caller to control aspects of bus driver operation.

Parameters.GetSetProperty.Property

Contains an enumeration value of type SDBUS_PROPERTY that specifies the property to read or change.

Parameters.GetSetProperty.Buffer

Contains the property data to write in operations that set a property. Contains the data read from the property in operations that retrieve the data associated with a property.

Parameters.GetSetProperty.Length

Indicates the length, in bytes, of the response data.

Parameters.DeviceCommand

DeviceCommand is the 'pipe' that allows SD device codes and arguments to be executed. These codes are either defined in the Secure Digital (SD) specification, can be based per device class, or can also be proprietary.

Parameters.DeviceCommand.CmdDesc

Contains a structure of type SDCMD_DESCRIPTOR that defines an SD card command.

Parameters.DeviceCommand.Argument

Contains 4 bytes of argument information that accompanies the command.

Parameters.DeviceCommand.Mdl

Pointer to an MDL that holds the command data.

Parameters.DeviceCommand.Length

Indicates the length, in bytes, of the response data.

Parameters.EraseCommand

EraseCommand allows MMC devices to send Erase commands to the given device in an atomic sequence, as three device commands need to be sent to Erase a given LBA range or group.

Parameters.EraseCommand.EraseType

Defines the SDBUS_ERASE_TYPE member EraseType.

Parameters.EraseCommand.StartBlock

Defines the ULONG member StartBlock.

Parameters.EraseCommand.EndBlock

Defines the ULONG member EndBlock.

Parameters.MmcSoftReset

MmcSoftReset allows eMMC devices to be soft reset for a SanDisk proprietary firmware update that resets the device to its manufactured state.

Parameters.MmcSoftReset.Frequency

Defines the ULONG member Frequency.

Parameters.MmcHpi

MmcHpi allows an HPI to be sent to the eMMC device which will cause sdbus to stop the currently executing SDRP with STATUS_SDBUS_IO_INTERRUPTED. The information field of the stopped SDRP will be filled out with the progress of the halted operation, so it may be resumed later at the correct offset.

Parameters.MmcHpi.IrpToHpi

This is the IRP to HPI. This is checked by SDBUS to ensure it is going to HPI the right IRP.

Remarks

If the request reads or sets a property on an SD device, a device driver must complete the following steps:

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

  2. Set the Property member of SDBUS_REQUEST_PACKET to the SDBUS_PROPERTY enumeration value that specifies the property to read or change.

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

If the request sends a command to an SD device, a device driver must complete the following steps:

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

  2. Initialize the CmdDesc member of SDBUS_REQUEST_PACKET to define the command.

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

To do property operations, the driver must initialize the GetSetProperty.Property, GetSetProperty.Buffer, and GetSetProperty.Length members of the SDBUS_REQUEST_PACKET structure before submitting the request.

To send a command, the driver must initialize the DeviceCommand.CmdDesc, DeviceCommand.Argument, DeviceCommand.Mdl, and DeviceCommand.Length members of the SDBUS_REQUEST_PACKET structure before submitting the request.

Requirements

Requirement Value
Header ntddsd.h (include Ntddsd.h)

See also

SD_REQUEST_FUNCTION

SDBUS_PROPERTY

SdBusSubmitRequest

SdBusSubmitRequestAsync

SDCMD_DESCRIPTOR