// ntddsd.h
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;
View the official Windows Driver Kit DDI referenceNo description available.
The SDBUS_REQUEST_PACKET structure specifies the parameters for the individual requests and commands that the SdBusSubmitRequest routine sends to the bus driver.
RequestFunctionContains 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.
InformationContains the status of the request on output.
ResponseDataDefines 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.Type3Defines the SDRESP_TYPE3 member Type3.
ResponseLengthIndicates the length, in bytes, of the response data.
ReservedReserved, set to 0.
FlagsFlags field for the SDRP.
ParametersParameters to the individual functions.
Parameters.GetSetPropertyThe property functions allow the caller to control aspects of bus driver operation.
Parameters.GetSetProperty.PropertyContains an enumeration value of type SDBUS_PROPERTY that specifies the property to read or change.
Parameters.GetSetProperty.BufferContains 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.LengthIndicates the length, in bytes, of the response data.
Parameters.DeviceCommandDeviceCommand 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.CmdDescContains a structure of type SDCMD_DESCRIPTOR that defines an SD card command.
Parameters.DeviceCommand.ArgumentContains 4 bytes of argument information that accompanies the command.
Parameters.DeviceCommand.MdlPointer to an MDL that holds the command data.
Parameters.DeviceCommand.LengthIndicates the length, in bytes, of the response data.
Parameters.EraseCommandEraseCommand 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.EraseTypeDefines the SDBUS_ERASE_TYPE member EraseType.
Parameters.EraseCommand.StartBlockDefines the ULONG member StartBlock.
Parameters.EraseCommand.EndBlockDefines the ULONG member EndBlock.
Parameters.MmcSoftResetMmcSoftReset allows eMMC devices to be soft reset for a SanDisk proprietary firmware update that resets the device to its manufactured state.
Parameters.MmcSoftReset.FrequencyDefines the ULONG member Frequency.
Parameters.MmcHpiMmcHpi 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.IrpToHpiThis is the IRP to HPI. This is checked by SDBUS to ensure it is going to HPI the right IRP.
If the request reads or sets a property on an SD device, a device driver must complete the following steps:
Set the RequestFunction member of SDBUS_REQUEST_PACKET to an SD_REQUEST_FUNCTION enumeration value of either SDRF_GET_PROPERTY or SDRF_SET_PROPERTY.
Set the Property member of SDBUS_REQUEST_PACKET to the SDBUS_PROPERTY enumeration value that specifies the property to read or change.
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:
Set the RequestFunction member of SDBUS_REQUEST_PACKET to an SD_REQUEST_FUNCTION enumeration value of SDRF_DEVICE_COMMAND.
Initialize the CmdDesc member of SDBUS_REQUEST_PACKET to define the command.
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.