summaryrefslogtreecommitdiff
path: root/Core/EM/Nvme/NvmePassthru.h
blob: 2f610009d585f5bc5246e2c67c47b163be2729b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2015, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**         5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093     **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************
//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/NVMe/NvmePassthru.h 1     5/14/15 2:36a Karthikar $
//
// $Revision: 1 $
//
// $Date: 5/14/15 2:36a $ 
//**********************************************************************
//**********************************************************************
//<AMI_FHDR_START>
//
// Name:        NvmePassthru.h
//
// Description: Header file for NvmePassthru.h file 
//
//<AMI_FHDR_END>
//**********************************************************************


#ifndef __NVM_PASS_THRU_H__
#define __NVM_PASS_THRU_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <Efi.h>
#include "Protocol/AmiNvmeController.h"
#include "Protocol/NvmExpressPassThru.h"
#include "EdkIICommon.h"

#define LIST_ENTRY EFI_LIST_ENTRY


#define NVME_ADMIN_SUBMISSION_QUEUE 0x00
#define NVME_IO_SUBMISSION_QUEUE    0x01

#define NVME_CONTROLLER_PROTOCOL_FROM_THIS(NvmePassthruProtocol) \
        ((_CR( NvmePassthruProtocol ,NVM_EXPRESS_PASS_THRU_INSTANCE, EfiNvmExpressPassThru))->NvmeControllerProtocol)

typedef
struct _NVM_EXPRESS_PASS_THRU_INSTANCE {
    EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL   EfiNvmExpressPassThru;       // Instance of EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL
    AMI_NVME_CONTROLLER_PROTOCOL         *NvmeControllerProtocol;
    EFI_HANDLE                           ControllerHandle;
} NVM_EXPRESS_PASS_THRU_INSTANCE;

EFI_STATUS 
NvmePassThru ( 
    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
);

EFI_STATUS
GetNextNamespace(
    IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL    *This,
    IN OUT UINT32                            *NamespaceId
);

EFI_STATUS 
BuildDevicePath (
    IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL    *This,
    IN UINT32                                NamespaceId,
    IN OUT EFI_DEVICE_PATH_PROTOCOL          **DevicePath
);

EFI_STATUS 
GetNamespace (
    IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL    *This,
    IN EFI_DEVICE_PATH_PROTOCOL              *DevicePath,
    OUT UINT32                               *NamespaceId
);

#ifdef __cplusplus
}
#endif

#endif // __NVM_PASS_THRU_H__

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2015, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************