1 /** @file
2   Header file for EFI_DISK_INFO_PROTOCOL interface.
3 
4 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #ifndef _NVME_DISKINFO_H_
16 #define _NVME_DISKINFO_H_
17 
18 /**
19   Initialize the installation of DiskInfo protocol.
20 
21   This function prepares for the installation of DiskInfo protocol on the child handle.
22   By default, it installs DiskInfo protocol with NVME interface GUID.
23 
24   @param[in]  Device  The pointer of NVME_DEVICE_PRIVATE_DATA.
25 
26 **/
27 VOID
28 InitializeDiskInfo (
29   IN  NVME_DEVICE_PRIVATE_DATA    *Device
30   );
31 
32 
33 /**
34   Provides inquiry information for the controller type.
35 
36   This function is used to get inquiry data.  Data format
37   of Identify data is defined by the Interface GUID.
38 
39   @param[in]      This              Pointer to the EFI_DISK_INFO_PROTOCOL instance.
40   @param[in, out] InquiryData       Pointer to a buffer for the inquiry data.
41   @param[in, out] InquiryDataSize   Pointer to the value for the inquiry data size.
42 
43   @retval EFI_SUCCESS            The command was accepted without any errors.
44   @retval EFI_NOT_FOUND          Device does not support this data class
45   @retval EFI_DEVICE_ERROR       Error reading InquiryData from device
46   @retval EFI_BUFFER_TOO_SMALL   InquiryDataSize not big enough
47 
48 **/
49 EFI_STATUS
50 EFIAPI
51 NvmExpressDiskInfoInquiry (
52   IN     EFI_DISK_INFO_PROTOCOL   *This,
53   IN OUT VOID                     *InquiryData,
54   IN OUT UINT32                   *InquiryDataSize
55   );
56 
57 /**
58   Provides identify information for the controller type.
59 
60   This function is used to get identify data.  Data format
61   of Identify data is defined by the Interface GUID.
62 
63   @param[in]      This              Pointer to the EFI_DISK_INFO_PROTOCOL
64                                     instance.
65   @param[in, out] IdentifyData      Pointer to a buffer for the identify data.
66   @param[in, out] IdentifyDataSize  Pointer to the value for the identify data
67                                     size.
68 
69   @retval EFI_SUCCESS            The command was accepted without any errors.
70   @retval EFI_NOT_FOUND          Device does not support this data class
71   @retval EFI_DEVICE_ERROR       Error reading IdentifyData from device
72   @retval EFI_BUFFER_TOO_SMALL   IdentifyDataSize not big enough
73 
74 **/
75 EFI_STATUS
76 EFIAPI
77 NvmExpressDiskInfoIdentify (
78   IN     EFI_DISK_INFO_PROTOCOL   *This,
79   IN OUT VOID                     *IdentifyData,
80   IN OUT UINT32                   *IdentifyDataSize
81   );
82 
83 /**
84   Provides sense data information for the controller type.
85 
86   This function is used to get sense data.
87   Data format of Sense data is defined by the Interface GUID.
88 
89   @param[in]      This              Pointer to the EFI_DISK_INFO_PROTOCOL instance.
90   @param[in, out] SenseData         Pointer to the SenseData.
91   @param[in, out] SenseDataSize     Size of SenseData in bytes.
92   @param[out]     SenseDataNumber   Pointer to the value for the sense data size.
93 
94   @retval EFI_SUCCESS            The command was accepted without any errors.
95   @retval EFI_NOT_FOUND          Device does not support this data class.
96   @retval EFI_DEVICE_ERROR       Error reading SenseData from device.
97   @retval EFI_BUFFER_TOO_SMALL   SenseDataSize not big enough.
98 
99 **/
100 EFI_STATUS
101 EFIAPI
102 NvmExpressDiskInfoSenseData (
103   IN     EFI_DISK_INFO_PROTOCOL   *This,
104   IN OUT VOID                     *SenseData,
105   IN OUT UINT32                   *SenseDataSize,
106   OUT    UINT8                    *SenseDataNumber
107   );
108 
109 
110 /**
111   This function is used to get controller information.
112 
113   @param[in]  This         Pointer to the EFI_DISK_INFO_PROTOCOL instance.
114   @param[out] IdeChannel   Pointer to the Ide Channel number.  Primary or secondary.
115   @param[out] IdeDevice    Pointer to the Ide Device number.  Master or slave.
116 
117   @retval EFI_SUCCESS       IdeChannel and IdeDevice are valid.
118   @retval EFI_UNSUPPORTED   This is not an IDE device.
119 
120 **/
121 EFI_STATUS
122 EFIAPI
123 NvmExpressDiskInfoWhichIde (
124   IN  EFI_DISK_INFO_PROTOCOL   *This,
125   OUT UINT32                   *IdeChannel,
126   OUT UINT32                   *IdeDevice
127   );
128 
129 #endif
130