TianoCore EDK2 master
|
#include "NvmExpress.h"
Go to the source code of this file.
Functions | |
VOID | NvmeDumpStatus (IN NVME_CQ *Cq) |
VOID * | NvmeCreatePrpList (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_PHYSICAL_ADDRESS PhysicalAddr, IN UINTN Pages, OUT VOID **PrpListHost, IN OUT UINTN *PrpListNo, OUT VOID **Mapping) |
EFI_STATUS | AbortAsyncPassThruTasks (IN NVME_CONTROLLER_PRIVATE_DATA *Private) |
EFI_STATUS EFIAPI | NvmExpressPassThru (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) |
EFI_STATUS EFIAPI | NvmExpressGetNextNamespace (IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN OUT UINT32 *NamespaceId) |
EFI_STATUS EFIAPI | NvmExpressGetNamespace (IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT32 *NamespaceId) |
EFI_STATUS EFIAPI | NvmExpressBuildDevicePath (IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN UINT32 NamespaceId, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath) |
NvmExpressDxe driver is used to manage non-volatile memory subsystem which follows NVM Express specification.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file NvmExpressPassthru.c.
EFI_STATUS AbortAsyncPassThruTasks | ( | IN NVME_CONTROLLER_PRIVATE_DATA * | Private | ) |
Aborts the asynchronous PassThru requests.
[in] | Private | The pointer to the NVME_CONTROLLER_PRIVATE_DATA data structure. |
EFI_SUCCESS | The asynchronous PassThru requests have been aborted. |
Definition at line 328 of file NvmExpressPassthru.c.
VOID * NvmeCreatePrpList | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_PHYSICAL_ADDRESS | PhysicalAddr, | ||
IN UINTN | Pages, | ||
OUT VOID ** | PrpListHost, | ||
IN OUT UINTN * | PrpListNo, | ||
OUT VOID ** | Mapping | ||
) |
Create PRP lists for data transfer which is larger than 2 memory pages. Note here we calcuate the number of required PRP lists and allocate them at one time.
[in] | PciIo | A pointer to the EFI_PCI_IO_PROTOCOL instance. |
[in] | PhysicalAddr | The physical base address of data buffer. |
[in] | Pages | The number of pages to be transfered. |
[out] | PrpListHost | The host base address of PRP lists. |
[in,out] | PrpListNo | The number of PRP List. |
[out] | Mapping | The mapping value returned from PciIo.Map(). |
The | pointer to the first PRP List of the PRP lists. |
Definition at line 213 of file NvmExpressPassthru.c.
Dump the execution status from a given completion queue entry.
[in] | Cq | A pointer to the NVME_CQ item. |
Definition at line 20 of file NvmExpressPassthru.c.
EFI_STATUS EFIAPI NvmExpressBuildDevicePath | ( | IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL * | This, |
IN UINT32 | NamespaceId, | ||
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DevicePath | ||
) |
Used to allocate and build a device path node for an NVM Express namespace on an NVM Express controller.
The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.BuildDevicePath() function allocates and builds a single device path node for the NVM Express namespace specified by NamespaceId.
If the NamespaceId is not valid, then EFI_NOT_FOUND is returned.
If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.
If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of DevicePath are initialized to describe the NVM Express namespace specified by NamespaceId, and EFI_SUCCESS is returned.
[in] | This | A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance. |
[in] | NamespaceId | The NVM Express namespace ID for which a device path node is to be allocated and built. Caller must set the NamespaceId to zero if the device path node will contain a valid UUID. |
[in,out] | DevicePath | A pointer to a single device path node that describes the NVM Express namespace specified by NamespaceId. This function is responsible for allocating the buffer DevicePath with the boot service AllocatePool(). It is the caller's responsibility to free DevicePath when the caller is finished with DevicePath. |
EFI_SUCCESS | The device path node that describes the NVM Express namespace specified by NamespaceId was allocated and returned in DevicePath. |
EFI_NOT_FOUND | The NamespaceId is not valid. |
EFI_INVALID_PARAMETER | DevicePath is NULL. |
EFI_OUT_OF_RESOURCES | There are not enough resources to allocate the DevicePath node. |
Definition at line 1139 of file NvmExpressPassthru.c.
EFI_STATUS EFIAPI NvmExpressGetNamespace | ( | IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL * | This, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
OUT UINT32 * | NamespaceId | ||
) |
Used to translate a device path node to a namespace ID.
The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNamespace() function determines the namespace ID associated with the namespace described by DevicePath.
If DevicePath is a device path node type that the NVM Express Pass Thru driver supports, then the NVM Express Pass Thru driver will attempt to translate the contents DevicePath into a namespace ID.
If this translation is successful, then that namespace ID is returned in NamespaceId, and EFI_SUCCESS is returned
[in] | This | A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance. |
[in] | DevicePath | A pointer to the device path node that describes an NVM Express namespace on the NVM Express controller. |
[out] | NamespaceId | The NVM Express namespace ID contained in the device path node. |
EFI_SUCCESS | DevicePath was successfully translated to NamespaceId. |
EFI_INVALID_PARAMETER | If DevicePath or NamespaceId are NULL, then EFI_INVALID_PARAMETER is returned. |
EFI_UNSUPPORTED | If DevicePath is not a device path node type that the NVM Express Pass Thru driver supports, then EFI_UNSUPPORTED is returned. |
EFI_NOT_FOUND | If DevicePath is a device path node type that the NVM Express Pass Thru driver supports, but there is not a valid translation from DevicePath to a namespace ID, then EFI_NOT_FOUND is returned. |
Definition at line 1064 of file NvmExpressPassthru.c.
EFI_STATUS EFIAPI NvmExpressGetNextNamespace | ( | IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL * | This, |
IN OUT UINT32 * | NamespaceId | ||
) |
Used to retrieve the next namespace ID for this NVM Express controller.
The EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNextNamespace() function retrieves the next valid namespace ID on 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.
[in] | This | A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance. |
[in,out] | NamespaceId | On 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. |
EFI_SUCCESS | The Namespace ID of the next Namespace was returned. |
EFI_NOT_FOUND | There are no more namespaces defined on this controller. |
EFI_INVALID_PARAMETER | NamespaceId is an invalid value other than 0xFFFFFFFF. |
Definition at line 963 of file NvmExpressPassthru.c.
EFI_STATUS EFIAPI NvmExpressPassThru | ( | 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 | ||
) |
Sends an NVM Express Command Packet to an NVM Express controller or namespace. This function supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required, and the non-blocking I/O functionality is optional.
[in] | This | A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance. |
[in] | NamespaceId | A 32 bit namespace ID as defined in the NVMe specification to which the NVM Express Command Packet will be sent. A value of 0 denotes the NVM Express controller, a value of all 0xFF's (all bytes are 0xFF) in the namespace ID specifies that the command packet should be sent to all valid namespaces. |
[in,out] | Packet | A pointer to the NVM Express Command Packet. |
[in] | Event | If non-blocking I/O is not supported then Event is ignored, and blocking I/O is performed. If Event is NULL, then blocking I/O is performed. If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed, and Event will be signaled when the NVM Express Command Packet completes. |
EFI_SUCCESS | The NVM Express Command Packet was sent by the host. TransferLength bytes were transferred to, or from DataBuffer. |
EFI_BAD_BUFFER_SIZE | The NVM Express Command Packet was not executed. The number of bytes that could be transferred is returned in TransferLength. |
EFI_NOT_READY | The NVM Express Command Packet could not be sent because the controller is not ready. The caller may retry again later. |
EFI_DEVICE_ERROR | A device error occurred while attempting to send the NVM Express Command Packet. |
EFI_INVALID_PARAMETER | NamespaceId or the contents of EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET are invalid. The NVM Express Command Packet was not sent, so no additional status information is available. |
EFI_UNSUPPORTED | The command described by the NVM Express Command Packet is not supported by the NVM Express controller. The NVM Express Command Packet was not sent so no additional status information is available. |
EFI_TIMEOUT | A timeout occurred while waiting for the NVM Express Command Packet to execute. |
Definition at line 451 of file NvmExpressPassthru.c.