TianoCore EDK2 master
Loading...
Searching...
No Matches
NvmExpressPassthru.h
Go to the documentation of this file.
1
14#ifndef _UEFI_NVM_EXPRESS_PASS_THRU_H_
15#define _UEFI_NVM_EXPRESS_PASS_THRU_H_
16
17#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID \
18 { \
19 0x52c78312, 0x8edc, 0x4233, { 0x98, 0xf2, 0x1a, 0x1a, 0xa5, 0xe3, 0x88, 0xa5 } \
20 }
21
23
24typedef struct {
25 UINT32 Attributes;
26 UINT32 IoAlign;
27 UINT32 NvmeVersion;
29
30//
31// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface is
32// for directly addressable namespaces.
33//
34#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
35//
36// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface is
37// for a single volume logical namespace comprised of multiple namespaces.
38//
39#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
40//
41// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface
42// supports non-blocking I/O.
43//
44#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
45//
46// If this bit is set, then the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface
47// supports NVM command set.
48//
49#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM 0x0008
50
51//
52// FusedOperation
53//
54#define NORMAL_CMD 0x00
55#define FUSED_FIRST_CMD 0x01
56#define FUSED_SECOND_CMD 0x02
57
58typedef struct {
59 UINT32 Opcode : 8;
60 UINT32 FusedOperation : 2;
61 UINT32 Reserved : 22;
62} NVME_CDW0;
63
64//
65// Flags
66//
67#define CDW2_VALID 0x01
68#define CDW3_VALID 0x02
69#define CDW10_VALID 0x04
70#define CDW11_VALID 0x08
71#define CDW12_VALID 0x10
72#define CDW13_VALID 0x20
73#define CDW14_VALID 0x40
74#define CDW15_VALID 0x80
75
76//
77// Queue Type
78//
79#define NVME_ADMIN_QUEUE 0x00
80#define NVME_IO_QUEUE 0x01
81
82typedef struct {
83 NVME_CDW0 Cdw0;
84 UINT8 Flags;
85 UINT32 Nsid;
86 UINT32 Cdw2;
87 UINT32 Cdw3;
88 UINT32 Cdw10;
89 UINT32 Cdw11;
90 UINT32 Cdw12;
91 UINT32 Cdw13;
92 UINT32 Cdw14;
93 UINT32 Cdw15;
95
96typedef struct {
97 UINT32 DW0;
98 UINT32 DW1;
99 UINT32 DW2;
100 UINT32 DW3;
102
103typedef struct {
104 UINT64 CommandTimeout;
105 VOID *TransferBuffer;
106 UINT32 TransferLength;
107 VOID *MetadataBuffer;
108 UINT32 MetadataLength;
109 UINT8 QueueType;
111 EFI_NVM_EXPRESS_COMPLETION *NvmeCompletion;
113
114//
115// Protocol function prototypes
116//
117
150typedef
154 IN UINT32 NamespaceId,
156 IN EFI_EVENT Event OPTIONAL
157 );
158
192typedef
196 IN OUT UINT32 *NamespaceId
197 );
198
230typedef
234 IN UINT32 NamespaceId,
235 OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
236 );
237
262typedef
266 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
267 OUT UINT32 *NamespaceId
268 );
269
270//
271// Protocol Interface Structure
272//
279};
280
281extern EFI_GUID gEfiNvmExpressPassThruProtocolGuid;
282
283#endif
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE)(IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN OUT UINT32 *NamespaceId)
EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH)(IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN UINT32 NamespaceId, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE)(IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT32 *NamespaceId)
EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU)(IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN UINT32 NamespaceId, IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
Definition: Base.h:213