// srb.h
typedef struct _SRBEX_DATA_NVME_COMMAND {
SRBEXDATATYPE Type;
ULONG Length;
union {
PVOID ControllerHandle;
ULONGLONG Reserved0;
};
union {
struct {
ULONG CommandDWORD0;
ULONG CommandNSID;
ULONG Reserved1[2];
ULONGLONG CommandMPTR;
union {
struct {
ULONGLONG CommandPRP1;
ULONGLONG CommandPRP2;
};
ULONGLONG CommandSGL1[2];
};
ULONG CommandCDW10;
ULONG CommandCDW11;
ULONG CommandCDW12;
ULONG CommandCDW13;
ULONG CommandCDW14;
ULONG CommandCDW15;
};
struct {
UCHAR OPC;
UCHAR PSDT;
USHORT CID;
UCHAR FCTYPE;
UCHAR Reserved[35];
UCHAR Specific[24];
} FabricsCommand;
struct {
ULONG OPC : 8;
ULONG FUSE : 2;
ULONG Reserved : 4;
ULONG PSDT : 2;
ULONG CID : 16;
UCHAR TypeSpecific[60];
} Command;
};
UCHAR CommandType;
UCHAR Reserved2;
USHORT CommandFlags;
USHORT ResponseFlags;
union {
struct {
USHORT P : 1;
USHORT SC : 8;
USHORT SCT : 3;
USHORT CRD : 2;
USHORT M : 1;
USHORT DNR : 1;
} DUMMYSTRUCTNAME;
USHORT AsUshort;
} CommandStatus;
ULONG QID;
ULONG CommandTag;
union {
struct {
ULONG CQEntryDW0;
ULONG CQEntryDW1;
};
UCHAR Specific[8];
};
USHORT SQHD;
USHORT SQID;
} SRBEX_DATA_NVME_COMMAND, *PSRBEX_DATA_NVME_COMMAND;
View the official Windows Driver Kit DDI reference// storport.h
typedef struct _SRBEX_DATA_NVME_COMMAND {
SRBEXDATATYPE Type;
ULONG Length;
union {
PVOID ControllerHandle;
ULONGLONG Reserved0;
};
union {
struct {
ULONG CommandDWORD0;
ULONG CommandNSID;
ULONG Reserved1[2];
ULONGLONG CommandMPTR;
union {
struct {
ULONGLONG CommandPRP1;
ULONGLONG CommandPRP2;
};
ULONGLONG CommandSGL1[2];
};
ULONG CommandCDW10;
ULONG CommandCDW11;
ULONG CommandCDW12;
ULONG CommandCDW13;
ULONG CommandCDW14;
ULONG CommandCDW15;
};
struct {
UCHAR OPC;
UCHAR PSDT;
USHORT CID;
UCHAR FCTYPE;
UCHAR Reserved[35];
UCHAR Specific[24];
} FabricsCommand;
struct {
ULONG OPC : 8;
ULONG FUSE : 2;
ULONG Reserved : 4;
ULONG PSDT : 2;
ULONG CID : 16;
UCHAR TypeSpecific[60];
} Command;
};
UCHAR CommandType;
UCHAR Reserved2;
USHORT CommandFlags;
USHORT ResponseFlags;
union {
struct {
USHORT P : 1;
USHORT SC : 8;
USHORT SCT : 3;
USHORT CRD : 2;
USHORT M : 1;
USHORT DNR : 1;
} DUMMYSTRUCTNAME;
USHORT AsUshort;
} CommandStatus;
ULONG QID;
ULONG CommandTag;
union {
struct {
ULONG CQEntryDW0;
ULONG CQEntryDW1;
};
UCHAR Specific[8];
};
USHORT SQHD;
USHORT SQID;
} SRBEX_DATA_NVME_COMMAND, *PSRBEX_DATA_NVME_COMMAND;
View the official Windows Driver Kit DDI referenceNo description available.
The SRBEX_DATA_NVME_COMMAND structure enables the user to frame and issue a command in NVMe format. This structure is currently reserved for system use.
TypeCommand type. Currently this must be set to SrbExDataTypeNvmeCommand.
LengthSize of this structure, in bytes.
ControllerHandleMiniport's handle for the NVMe controller.
Reserved0Reserved; do not use.
CommandDWORD0Command Dword 0 within the NVMe command (see the NVMe specifications).
CommandNSIDNamespace identifier within the NVMe command (see the NVMe specifications).
Reserved1[2]Reserved; do not use.
CommandMPTRMetadata pointer within the NVMe command (see the NVMe specifications).
CommandPRP1Physical region page (PRP) Entry 1 within the NVMe command (see the NVMe specifications). To indicate that PRP information is present, the user must set the SRBEX_DATA_NVME_COMMAND_FLAG_PRP_SET_ALREADY flag of SRBEX_DATA_NVME_COMMAND_FLAG.
CommandPRP2PRP Entry 2 within the NVMe command (see the NVMe specifications). To indicate that PRP information is present, the user must set the SRBEX_DATA_NVME_COMMAND_FLAG_PRP_SET_ALREADY flag of SRBEX_DATA_NVME_COMMAND_FLAG.
CommandSGL1[2]Command-specific scatter gather list (SGL) Entry 1 field (see the NVMe specifications).
CommandCDW10Command-specific Dword 10 (see the NVMe specifications).
CommandCDW11Command-specific Dword 11 (see the NVMe specifications).
CommandCDW12Command-specific Dword 12 (see the NVMe specifications).
CommandCDW13Command-specific Dword 13 (see the NVMe specifications).
CommandCDW14Command-specific Dword 14 (see the NVMe specifications).
CommandCDW15Command-specific Dword 15 (see the NVMe specifications).
FabricsCommandNVMEOF_FABRICS_COMMAND in nvme.h
FabricsCommand.OPCOpcode (7Fh).
FabricsCommand.PSDTPRP or SGL for data transfer. (only bits 7:6 are used, the rest are reserved).
FabricsCommand.CIDFabrics command identifier.
FabricsCommand.FCTYPEFabrics command type.
FabricsCommand.Reserved[35]Reserved; do not use.
FabricsCommand.Specific[24]Command type specific (see the NVMe specifications).
CommandTo reference command DW0 (see the NVMe specifications).
Command.OPCOpcode (OPC).
Command.FUSEFused Operation (FUSE).
Command.ReservedReserved; do not use.
Command.PSDTPRP or SGL for data transfer.
Command.CIDCommand identifier.
Command.TypeSpecific[60]Command type specific (see the NVMe specifications).
CommandTypeA SRBEX_DATA_NVME_COMMAND_TYPE value that specifies the NVMe command type.
Reserved2Reserved; do not use.
CommandFlagsA SRBEX_DATA_NVME_COMMAND_FLAG value that specifies the properties of this SRBEX data NVMe command.
ResponseFlagsDefined in SRBEX_DATA_NVME_RESPONSE_FLAG.
CommandStatusStatus field from the Completion Queue entry (see the NVMe specifications).
CommandStatus.DUMMYSTRUCTNAMEEmbedded structure.
CommandStatus.DUMMYSTRUCTNAME.PPhase tag (P).
CommandStatus.DUMMYSTRUCTNAME.SCStatus code (SC).
CommandStatus.DUMMYSTRUCTNAME.SCTStatus code type (SCT).
CommandStatus.DUMMYSTRUCTNAME.CRDCommand retry delay (CRD).
CommandStatus.DUMMYSTRUCTNAME.MMore (M).
CommandStatus.DUMMYSTRUCTNAME.DNRDo not retry (DNR).
CommandStatus.AsUshortQIDUser-specified queue ID (see the NVMe specifications). If unspecified, set this value to 0xFFFFFFFF.
CommandTagUnique, user-specified identifier for the command identifier to mark a specific command. A user can use CommandTag to trace the result of the command in an Event Tracing for Windows (ETW) trace (for example, in Event Viewer's Storage log).
CQEntryDW0Completion queue entry DW0.
CQEntryDW1Completion queue entry DW1.
Specific[8]Fabrics command specific response.
SQHDSQ head pointer in completion queue entry.
SQIDSQ identifier.
See SRBEX_DATA_NVME_COMMAND (srb.h).
TypeLengthControllerHandleReserved0CommandDWORD0CommandNSIDReserved1[2]CommandMPTRCommandPRP1CommandPRP2CommandSGL1[2]CommandCDW10CommandCDW11CommandCDW12CommandCDW13CommandCDW14CommandCDW15FabricsCommandFabricsCommand.OPCFabricsCommand.PSDTFabricsCommand.CIDFabricsCommand.FCTYPEFabricsCommand.Reserved[35]FabricsCommand.Specific[24]CommandCommand.OPCCommand.FUSECommand.ReservedCommand.PSDTCommand.CIDCommand.TypeSpecific[60]CommandTypeReserved2CommandFlagsResponseFlagsCommandStatusCommandStatus.DUMMYSTRUCTNAMECommandStatus.DUMMYSTRUCTNAME.PCommandStatus.DUMMYSTRUCTNAME.SCCommandStatus.DUMMYSTRUCTNAME.SCTCommandStatus.DUMMYSTRUCTNAME.CRDCommandStatus.DUMMYSTRUCTNAME.MCommandStatus.DUMMYSTRUCTNAME.DNRCommandStatus.AsUshortQIDCommandTagCQEntryDW0CQEntryDW1Specific[8]SQHDSQID