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

Go to the source code of this file.

Data Structures

struct  EFI_NVM_EXPRESS_PASS_THRU_MODE
 
struct  NVME_CDW0
 
struct  EFI_NVM_EXPRESS_COMMAND
 
struct  EFI_NVM_EXPRESS_COMPLETION
 
struct  EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET
 
struct  _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL
 

Macros

#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID
 
#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001
 
#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL   0x0002
 
#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKIO   0x0004
 
#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM   0x0008
 
#define NORMAL_CMD   0x00
 
#define FUSED_FIRST_CMD   0x01
 
#define FUSED_SECOND_CMD   0x02
 
#define CDW2_VALID   0x01
 
#define CDW3_VALID   0x02
 
#define CDW10_VALID   0x04
 
#define CDW11_VALID   0x08
 
#define CDW12_VALID   0x10
 
#define CDW13_VALID   0x20
 
#define CDW14_VALID   0x40
 
#define CDW15_VALID   0x80
 
#define NVME_ADMIN_QUEUE   0x00
 
#define NVME_IO_QUEUE   0x01
 

Typedefs

typedef struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL
 
typedef 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)
 
typedef EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE) (IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This, IN OUT UINT32 *NamespaceId)
 
typedef 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)
 
typedef 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)
 

Variables

EFI_GUID gEfiNvmExpressPassThruProtocolGuid
 

Detailed Description

This protocol provides services that allow NVM Express commands to be sent to an NVM Express controller or to a specific namespace in a NVM Express controller. This protocol interface is optimized for storage.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Revision Reference:
This Protocol was introduced in UEFI Specification 2.5.

Definition in file NvmExpressPassthru.h.

Macro Definition Documentation

◆ CDW10_VALID

#define CDW10_VALID   0x04

Definition at line 69 of file NvmExpressPassthru.h.

◆ CDW11_VALID

#define CDW11_VALID   0x08

Definition at line 70 of file NvmExpressPassthru.h.

◆ CDW12_VALID

#define CDW12_VALID   0x10

Definition at line 71 of file NvmExpressPassthru.h.

◆ CDW13_VALID

#define CDW13_VALID   0x20

Definition at line 72 of file NvmExpressPassthru.h.

◆ CDW14_VALID

#define CDW14_VALID   0x40

Definition at line 73 of file NvmExpressPassthru.h.

◆ CDW15_VALID

#define CDW15_VALID   0x80

Definition at line 74 of file NvmExpressPassthru.h.

◆ CDW2_VALID

#define CDW2_VALID   0x01

Definition at line 67 of file NvmExpressPassthru.h.

◆ CDW3_VALID

#define CDW3_VALID   0x02

Definition at line 68 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM

#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVM   0x0008

Definition at line 49 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL

#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL   0x0002

Definition at line 39 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKIO

#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKIO   0x0004

Definition at line 44 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL

#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001

Definition at line 34 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID

#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID
Value:
{ \
0x52c78312, 0x8edc, 0x4233, { 0x98, 0xf2, 0x1a, 0x1a, 0xa5, 0xe3, 0x88, 0xa5 } \
}

Definition at line 17 of file NvmExpressPassthru.h.

◆ FUSED_FIRST_CMD

#define FUSED_FIRST_CMD   0x01

Definition at line 55 of file NvmExpressPassthru.h.

◆ FUSED_SECOND_CMD

#define FUSED_SECOND_CMD   0x02

Definition at line 56 of file NvmExpressPassthru.h.

◆ NORMAL_CMD

#define NORMAL_CMD   0x00

Definition at line 54 of file NvmExpressPassthru.h.

◆ NVME_ADMIN_QUEUE

#define NVME_ADMIN_QUEUE   0x00

Definition at line 79 of file NvmExpressPassthru.h.

◆ NVME_IO_QUEUE

#define NVME_IO_QUEUE   0x01

Definition at line 80 of file NvmExpressPassthru.h.

Typedef Documentation

◆ EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH

typedef 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)

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.

Parameters
[in]ThisA pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
[in]NamespaceIdThe 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.
[out]DevicePathA 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.
Return values
EFI_SUCCESSThe device path node that describes the NVM Express namespace specified by NamespaceId was allocated and returned in DevicePath.
EFI_NOT_FOUNDThe NamespaceId is not valid.
EFI_INVALID_PARAMETERDevicePath is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources to allocate the DevicePath node.

Definition at line 231 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE

typedef 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)

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

Parameters
[in]ThisA pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
[in]DevicePathA pointer to the device path node that describes an NVM Express namespace on the NVM Express controller.
[out]NamespaceIdThe NVM Express namespace ID contained in the device path node.
Return values
EFI_SUCCESSDevicePath was successfully translated to NamespaceId.
EFI_INVALID_PARAMETERIf DevicePath or NamespaceId are NULL, then EFI_INVALID_PARAMETER is returned.
EFI_UNSUPPORTEDIf DevicePath is not a device path node type that the NVM Express Pass Thru driver supports, then EFI_UNSUPPORTED is returned.
EFI_NOT_FOUNDIf 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 263 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE

typedef EFI_STATUS(EFIAPI * EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE) (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.

Parameters
[in]ThisA pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
[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 193 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU

typedef 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)

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.

Parameters
[in]ThisA pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance.
[in]NamespaceIdA 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]PacketA pointer to the NVM Express Command Packet.
[in]EventIf 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.
Return values
EFI_SUCCESSThe NVM Express Command Packet was sent by the host. TransferLength bytes were transferred to, or from DataBuffer.
EFI_BAD_BUFFER_SIZEThe NVM Express Command Packet was not executed. The number of bytes that could be transferred is returned in TransferLength.
EFI_NOT_READYThe 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 NVM Express Command Packet.
EFI_INVALID_PARAMETERNamespaceId 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_UNSUPPORTEDThe 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_TIMEOUTA timeout occurred while waiting for the NVM Express Command Packet to execute.

Definition at line 151 of file NvmExpressPassthru.h.

◆ EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL