]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.h
MdeModulePkg/SdMmcPciHcDxe: Do not map memory for non DMA transfer
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / NvmExpressPei / NvmExpressPeiPassThru.h
CommitLineData
b8b69433
HW
1/** @file\r
2 The NvmExpressPei driver is used to manage non-volatile memory subsystem\r
3 which follows NVM Express specification at PEI phase.\r
4\r
ba3aa1c4 5 Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>\r
b8b69433 6\r
9d510e61 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
b8b69433
HW
8\r
9**/\r
10\r
11#ifndef _NVM_EXPRESS_PEI_PASSTHRU_H_\r
12#define _NVM_EXPRESS_PEI_PASSTHRU_H_\r
13\r
b8b69433
HW
14\r
15\r
16/**\r
17 Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only\r
18 supports blocking execution of the command.\r
19\r
20 @param[in] Private The pointer to the NVME_CONTEXT Data structure.\r
21 @param[in] NamespaceId Is a 32 bit Namespace ID to which the Express HCI command packet will\r
22 be sent.\r
23 A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in\r
24 the namespace ID specifies that the command packet should be sent to all\r
25 valid namespaces.\r
26 @param[in,out] Packet A pointer to the EDKII PEI NVM Express PassThru Command Packet to send\r
27 to the NVMe namespace specified by NamespaceId.\r
28\r
29 @retval EFI_SUCCESS The EDKII PEI NVM Express Command Packet was sent by the host.\r
30 TransferLength bytes were transferred to, or from DataBuffer.\r
31 @retval EFI_NOT_READY The EDKII PEI NVM Express Command Packet could not be sent because\r
32 the controller is not ready. The caller may retry again later.\r
33 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the EDKII PEI NVM\r
34 Express Command Packet.\r
35 @retval EFI_INVALID_PARAMETER Namespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET\r
36 are invalid.\r
37 The EDKII PEI NVM Express Command Packet was not sent, so no\r
38 additional status information is available.\r
39 @retval EFI_UNSUPPORTED The command described by the EDKII PEI NVM Express Command Packet\r
40 is not supported by the host adapter.\r
41 The EDKII PEI NVM Express Command Packet was not sent, so no\r
42 additional status information is available.\r
43 @retval EFI_TIMEOUT A timeout occurred while waiting for the EDKII PEI NVM Express Command\r
44 Packet to execute.\r
45\r
46**/\r
47EFI_STATUS\r
ba3aa1c4 48NvmePassThruExecute (\r
b8b69433
HW
49 IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private,\r
50 IN UINT32 NamespaceId,\r
ba3aa1c4
MC
51 IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet\r
52 );\r
53\r
54/**\r
55 Gets the device path information of the underlying NVM Express host controller.\r
56\r
57 @param[in] This The PPI instance pointer.\r
58 @param[out] DevicePathLength The length of the device path in bytes specified\r
59 by DevicePath.\r
60 @param[out] DevicePath The device path of the underlying NVM Express\r
61 host controller.\r
62 This field re-uses EFI Device Path Protocol as\r
63 defined by Section 10.2 EFI Device Path Protocol\r
64 of UEFI 2.7 Specification.\r
65\r
66 @retval EFI_SUCCESS The operation succeeds.\r
67 @retval EFI_INVALID_PARAMETER DevicePathLength or DevicePath is NULL.\r
68 @retval EFI_OUT_OF_RESOURCES The operation fails due to lack of resources.\r
69\r
70**/\r
71EFI_STATUS\r
72EFIAPI\r
73NvmePassThruGetDevicePath (\r
74 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This,\r
75 OUT UINTN *DevicePathLength,\r
76 OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r
77 );\r
78\r
79/**\r
80 Used to retrieve the next namespace ID for this NVM Express controller.\r
81\r
82 If on input the value pointed to by NamespaceId is 0xFFFFFFFF, then the first\r
83 valid namespace ID defined on the NVM Express controller is returned in the\r
84 location pointed to by NamespaceId and a status of EFI_SUCCESS is returned.\r
85\r
86 If on input the value pointed to by NamespaceId is an invalid namespace ID\r
87 other than 0xFFFFFFFF, then EFI_INVALID_PARAMETER is returned.\r
88\r
89 If on input the value pointed to by NamespaceId is a valid namespace ID, then\r
90 the next valid namespace ID on the NVM Express controller is returned in the\r
91 location pointed to by NamespaceId, and EFI_SUCCESS is returned.\r
92\r
93 If the value pointed to by NamespaceId is the namespace ID of the last\r
94 namespace on the NVM Express controller, then EFI_NOT_FOUND is returned.\r
95\r
96 @param[in] This The PPI instance pointer.\r
97 @param[in,out] NamespaceId On input, a pointer to a legal NamespaceId\r
98 for an NVM Express namespace present on the\r
99 NVM Express controller. On output, a pointer\r
100 to the next NamespaceId of an NVM Express\r
101 namespace on an NVM Express controller. An\r
102 input value of 0xFFFFFFFF retrieves the\r
103 first NamespaceId for an NVM Express\r
104 namespace present on an NVM Express\r
105 controller.\r
106\r
107 @retval EFI_SUCCESS The Namespace ID of the next Namespace was\r
108 returned.\r
109 @retval EFI_NOT_FOUND There are no more namespaces defined on this\r
110 controller.\r
111 @retval EFI_INVALID_PARAMETER NamespaceId is an invalid value other than\r
112 0xFFFFFFFF.\r
113\r
114**/\r
115EFI_STATUS\r
116EFIAPI\r
117NvmePassThruGetNextNameSpace (\r
118 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This,\r
119 IN OUT UINT32 *NamespaceId\r
120 );\r
121\r
122/**\r
123 Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only\r
124 supports blocking execution of the command.\r
125\r
126 @param[in] This The PPI instance pointer.\r
127 @param[in] NamespaceId Is a 32 bit Namespace ID to which the Nvm Express command packet will\r
128 be sent.\r
129 A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in\r
130 the namespace ID specifies that the command packet should be sent to all\r
131 valid namespaces.\r
132 @param[in,out] Packet A pointer to the EDKII PEI NVM Express PassThru Command Packet to send\r
133 to the NVMe namespace specified by NamespaceId.\r
134\r
135 @retval EFI_SUCCESS The EDKII PEI NVM Express Command Packet was sent by the host.\r
136 TransferLength bytes were transferred to, or from DataBuffer.\r
137 @retval EFI_NOT_READY The EDKII PEI NVM Express Command Packet could not be sent because\r
138 the controller is not ready. The caller may retry again later.\r
139 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the EDKII PEI NVM\r
140 Express Command Packet.\r
141 @retval EFI_INVALID_PARAMETER Namespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET\r
142 are invalid.\r
143 The EDKII PEI NVM Express Command Packet was not sent, so no\r
144 additional status information is available.\r
145 @retval EFI_UNSUPPORTED The command described by the EDKII PEI NVM Express Command Packet\r
146 is not supported by the host adapter.\r
147 The EDKII PEI NVM Express Command Packet was not sent, so no\r
148 additional status information is available.\r
149 @retval EFI_TIMEOUT A timeout occurred while waiting for the EDKII PEI NVM Express Command\r
150 Packet to execute.\r
151\r
152**/\r
153EFI_STATUS\r
154EFIAPI\r
155NvmePassThru (\r
156 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This,\r
157 IN UINT32 NamespaceId,\r
158 IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet\r
b8b69433
HW
159 );\r
160\r
161#endif\r