TianoCore EDK2 master
Loading...
Searching...
No Matches
NvmExpressPeiPassThru.h File Reference

Go to the source code of this file.

Functions

EFI_STATUS NvmePassThruExecute (IN PEI_NVME_CONTROLLER_PRIVATE_DATA *Private, IN UINT32 NamespaceId, IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet)
 
EFI_STATUS EFIAPI NvmePassThruGetDevicePath (IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This, OUT UINTN *DevicePathLength, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
 
EFI_STATUS EFIAPI NvmePassThruGetNextNameSpace (IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This, IN OUT UINT32 *NamespaceId)
 
EFI_STATUS EFIAPI NvmePassThru (IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI *This, IN UINT32 NamespaceId, IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet)
 

Detailed Description

The NvmExpressPei driver is used to manage non-volatile memory subsystem which follows NVM Express specification at PEI phase.

Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file NvmExpressPeiPassThru.h.

Function Documentation

◆ NvmePassThru()

EFI_STATUS EFIAPI NvmePassThru ( IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI This,
IN UINT32  NamespaceId,
IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET Packet 
)

Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only supports blocking execution of the command.

Parameters
[in]ThisThe PPI instance pointer.
[in]NamespaceIdIs a 32 bit Namespace ID to which the Nvm Express command packet will be sent. A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in the namespace ID specifies that the command packet should be sent to all valid namespaces.
[in,out]PacketA pointer to the EDKII PEI NVM Express PassThru Command Packet to send to the NVMe namespace specified by NamespaceId.
Return values
EFI_SUCCESSThe EDKII PEI NVM Express Command Packet was sent by the host. TransferLength bytes were transferred to, or from DataBuffer.
EFI_NOT_READYThe EDKII PEI NVM Express Command Packet could not be sent because the controller is not ready. The caller may retry again later.
EFI_DEVICE_ERRORA device error occurred while attempting to send the EDKII PEI NVM Express Command Packet.
EFI_INVALID_PARAMETERNamespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET are invalid. The EDKII PEI NVM Express Command Packet was not sent, so no additional status information is available.
EFI_UNSUPPORTEDThe command described by the EDKII PEI NVM Express Command Packet is not supported by the host adapter. The EDKII PEI NVM Express Command Packet was not sent, so no additional status information is available.
EFI_TIMEOUTA timeout occurred while waiting for the EDKII PEI NVM Express Command Packet to execute.

Definition at line 811 of file NvmExpressPeiPassThru.c.

◆ NvmePassThruExecute()

EFI_STATUS NvmePassThruExecute ( IN PEI_NVME_CONTROLLER_PRIVATE_DATA Private,
IN UINT32  NamespaceId,
IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET Packet 
)

Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function only supports blocking execution of the command.

Parameters
[in]PrivateThe pointer to the NVME_CONTEXT Data structure.
[in]NamespaceIdIs a 32 bit Namespace ID to which the Express HCI command packet will be sent. A Value of 0 denotes the NVM Express controller, a Value of all 0FFh in the namespace ID specifies that the command packet should be sent to all valid namespaces.
[in,out]PacketA pointer to the EDKII PEI NVM Express PassThru Command Packet to send to the NVMe namespace specified by NamespaceId.
Return values
EFI_SUCCESSThe EDKII PEI NVM Express Command Packet was sent by the host. TransferLength bytes were transferred to, or from DataBuffer.
EFI_NOT_READYThe EDKII PEI NVM Express Command Packet could not be sent because the controller is not ready. The caller may retry again later.
EFI_DEVICE_ERRORA device error occurred while attempting to send the EDKII PEI NVM Express Command Packet.
EFI_INVALID_PARAMETERNamespace, or the contents of EDKII_PEI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET are invalid. The EDKII PEI NVM Express Command Packet was not sent, so no additional status information is available.
EFI_UNSUPPORTEDThe command described by the EDKII PEI NVM Express Command Packet is not supported by the host adapter. The EDKII PEI NVM Express Command Packet was not sent, so no additional status information is available.
EFI_TIMEOUTA timeout occurred while waiting for the EDKII PEI NVM Express Command Packet to execute.

Definition at line 339 of file NvmExpressPeiPassThru.c.

◆ NvmePassThruGetDevicePath()

EFI_STATUS EFIAPI NvmePassThruGetDevicePath ( IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI This,
OUT UINTN DevicePathLength,
OUT EFI_DEVICE_PATH_PROTOCOL **  DevicePath 
)

Gets the device path information of the underlying NVM Express host controller.

Parameters
[in]ThisThe PPI instance pointer.
[out]DevicePathLengthThe length of the device path in bytes specified by DevicePath.
[out]DevicePathThe device path of the underlying NVM Express host controller. This field re-uses EFI Device Path Protocol as defined by Section 10.2 EFI Device Path Protocol of UEFI 2.7 Specification.
Return values
EFI_SUCCESSThe operation succeeds.
EFI_INVALID_PARAMETERDevicePathLength or DevicePath is NULL.
EFI_OUT_OF_RESOURCESThe operation fails due to lack of resources.

Definition at line 659 of file NvmExpressPeiPassThru.c.

◆ NvmePassThruGetNextNameSpace()

EFI_STATUS EFIAPI NvmePassThruGetNextNameSpace ( IN EDKII_PEI_NVM_EXPRESS_PASS_THRU_PPI This,
IN OUT UINT32 *  NamespaceId 
)

Used to retrieve the next namespace ID for this NVM Express controller.

If on input the value pointed to by NamespaceId is 0xFFFFFFFF, then the first valid namespace ID defined on the NVM Express controller is returned in the location pointed to by NamespaceId and a status of EFI_SUCCESS is returned.

If on input the value pointed to by NamespaceId is an invalid namespace ID other than 0xFFFFFFFF, then EFI_INVALID_PARAMETER is returned.

If on input the value pointed to by NamespaceId is a valid namespace ID, then the next valid namespace ID on the NVM Express controller is returned in the location pointed to by NamespaceId, and EFI_SUCCESS is returned.

If the value pointed to by NamespaceId is the namespace ID of the last namespace on the NVM Express controller, then EFI_NOT_FOUND is returned.

Parameters
[in]ThisThe PPI instance pointer.
[in,out]NamespaceIdOn input, a pointer to a legal NamespaceId for an NVM Express namespace present on the NVM Express controller. On output, a pointer to the next NamespaceId of an NVM Express namespace on an NVM Express controller. An input value of 0xFFFFFFFF retrieves the first NamespaceId for an NVM Express namespace present on an NVM Express controller.
Return values
EFI_SUCCESSThe Namespace ID of the next Namespace was returned.
EFI_NOT_FOUNDThere are no more namespaces defined on this controller.
EFI_INVALID_PARAMETERNamespaceId is an invalid value other than 0xFFFFFFFF.

Definition at line 721 of file NvmExpressPeiPassThru.c.