2 The NvmExpressPei driver is used to manage non-volatile memory subsystem
3 which follows NVM Express specification at PEI phase.
5 Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef _NVM_EXPRESS_PEI_PASSTHRU_H_
12 #define _NVM_EXPRESS_PEI_PASSTHRU_H_
15 Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only
16 supports blocking execution of the command.
18 @param[in] Private The pointer to the NVME_CONTEXT Data structure.
19 @param[in] NamespaceId Is a 32 bit Namespace ID to which the Express HCI command packet will
21 A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in
22 the namespace ID specifies that the command packet should be sent to all
24 @param[in,out] Packet A pointer to the EDKII PEI NVM Express PassThru Command Packet to send
25 to the NVMe namespace specified by NamespaceId.
27 @retval EFI_SUCCESS The EDKII PEI NVM Express Command Packet was sent by the host.
28 TransferLength bytes were transferred to, or from DataBuffer.
29 @retval EFI_NOT_READY The EDKII PEI NVM Express Command Packet could not be sent because
30 the controller is not ready. The caller may retry again later.
31 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the EDKII PEI NVM
32 Express Command Packet.
33 @retval EFI_INVALID_PARAMETER Namespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
35 The EDKII PEI NVM Express Command Packet was not sent, so no
36 additional status information is available.
37 @retval EFI_UNSUPPORTED The command described by the EDKII PEI NVM Express Command Packet
38 is not supported by the host adapter.
39 The EDKII PEI NVM Express Command Packet was not sent, so no
40 additional status information is available.
41 @retval EFI_TIMEOUT A timeout occurred while waiting for the EDKII PEI NVM Express Command
47 IN PEI_NVME_CONTROLLER_PRIVATE_DATA
*Private
,
48 IN UINT32 NamespaceId
,
49 IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
*Packet
53 Gets the device path information of the underlying NVM Express host controller.
55 @param[in] This The PPI instance pointer.
56 @param[out] DevicePathLength The length of the device path in bytes specified
58 @param[out] DevicePath The device path of the underlying NVM Express
60 This field re-uses EFI Device Path Protocol as
61 defined by Section 10.2 EFI Device Path Protocol
62 of UEFI 2.7 Specification.
64 @retval EFI_SUCCESS The operation succeeds.
65 @retval EFI_INVALID_PARAMETER DevicePathLength or DevicePath is NULL.
66 @retval EFI_OUT_OF_RESOURCES The operation fails due to lack of resources.
71 NvmePassThruGetDevicePath (
72 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI
*This
,
73 OUT UINTN
*DevicePathLength
,
74 OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
78 Used to retrieve the next namespace ID for this NVM Express controller.
80 If on input the value pointed to by NamespaceId is 0xFFFFFFFF, then the first
81 valid namespace ID defined on the NVM Express controller is returned in the
82 location pointed to by NamespaceId and a status of EFI_SUCCESS is returned.
84 If on input the value pointed to by NamespaceId is an invalid namespace ID
85 other than 0xFFFFFFFF, then EFI_INVALID_PARAMETER is returned.
87 If on input the value pointed to by NamespaceId is a valid namespace ID, then
88 the next valid namespace ID on the NVM Express controller is returned in the
89 location pointed to by NamespaceId, and EFI_SUCCESS is returned.
91 If the value pointed to by NamespaceId is the namespace ID of the last
92 namespace on the NVM Express controller, then EFI_NOT_FOUND is returned.
94 @param[in] This The PPI instance pointer.
95 @param[in,out] NamespaceId On input, a pointer to a legal NamespaceId
96 for an NVM Express namespace present on the
97 NVM Express controller. On output, a pointer
98 to the next NamespaceId of an NVM Express
99 namespace on an NVM Express controller. An
100 input value of 0xFFFFFFFF retrieves the
101 first NamespaceId for an NVM Express
102 namespace present on an NVM Express
105 @retval EFI_SUCCESS The Namespace ID of the next Namespace was
107 @retval EFI_NOT_FOUND There are no more namespaces defined on this
109 @retval EFI_INVALID_PARAMETER NamespaceId is an invalid value other than
115 NvmePassThruGetNextNameSpace (
116 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI
*This
,
117 IN OUT UINT32
*NamespaceId
121 Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only
122 supports blocking execution of the command.
124 @param[in] This The PPI instance pointer.
125 @param[in] NamespaceId Is a 32 bit Namespace ID to which the Nvm Express command packet will
127 A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in
128 the namespace ID specifies that the command packet should be sent to all
130 @param[in,out] Packet A pointer to the EDKII PEI NVM Express PassThru Command Packet to send
131 to the NVMe namespace specified by NamespaceId.
133 @retval EFI_SUCCESS The EDKII PEI NVM Express Command Packet was sent by the host.
134 TransferLength bytes were transferred to, or from DataBuffer.
135 @retval EFI_NOT_READY The EDKII PEI NVM Express Command Packet could not be sent because
136 the controller is not ready. The caller may retry again later.
137 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the EDKII PEI NVM
138 Express Command Packet.
139 @retval EFI_INVALID_PARAMETER Namespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
141 The EDKII PEI NVM Express Command Packet was not sent, so no
142 additional status information is available.
143 @retval EFI_UNSUPPORTED The command described by the EDKII PEI NVM Express Command Packet
144 is not supported by the host adapter.
145 The EDKII PEI NVM Express Command Packet was not sent, so no
146 additional status information is available.
147 @retval EFI_TIMEOUT A timeout occurred while waiting for the EDKII PEI NVM Express Command
154 IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI
*This
,
155 IN UINT32 NamespaceId
,
156 IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
*Packet