Fix the bug for the structure definition of _EFI_ADAPTER_INFORMATION_PROTOCOL in...
[mirror_edk2.git] / MdePkg / Include / Protocol / AdapterInformation.h
1 /** @file
2 EFI Adapter Information Protocol definition.
3 The EFI Adapter Information Protocol is used to dynamically and quickly discover
4 or set device information for an adapter.
5
6 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 @par Revision Reference:
16 This Protocol is introduced in UEFI Specification 2.4
17
18 **/
19
20 #ifndef __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
21 #define __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
22
23
24 #define EFI_ADAPTER_INFORMATION_PROTOCOL_GUID \
25 { \
26 0xE5DD1403, 0xD622, 0xC24E, {0x84, 0x88, 0xC7, 0x1B, 0x17, 0xF5, 0xE8, 0x02 } \
27 }
28
29 #define EFI_ADAPTER_INFO_MEDIA_STATE_GUID \
30 { \
31 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 } \
32 }
33
34 #define EFI_ADAPTER_INFO_NETWORK_BOOT_GUID \
35 { \
36 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C } \
37 }
38
39 #define EFI_ADAPTER_INFO_SAN_MAC_ADDRESS_GUID \
40 { \
41 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 } \
42 }
43
44 typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL EFI_ADAPTER_INFORMATION_PROTOCOL;
45
46 ///
47 /// EFI_ADAPTER_INFO_MEDIA_STATE
48 ///
49 typedef struct {
50 ///
51 /// Returns the current media state status. MediaState can have any of the following values:
52 /// EFI_SUCCESS: There is media attached to the network adapter. EFI_NOT_READY: This detects a bounced state.
53 /// There was media attached to the network adapter, but it was removed and reattached. EFI_NO_MEDIA: There is
54 /// not any media attached to the network.
55 ///
56 EFI_STATUS MediaState;
57 }EFI_ADAPTER_INFO_MEDIA_STATE;
58
59 ///
60 /// EFI_ADAPTER_INFO_NETWORK_BOOT
61 ///
62 typedef struct {
63 ///
64 /// TRUE if the adapter supports booting from iSCSI IPv4 targets.
65 ///
66 BOOLEAN iScsiIpv4BootCapablity;
67 ///
68 /// TRUE if the adapter supports booting from iSCSI IPv6 targets.
69 ///
70 BOOLEAN iScsiIpv6BootCapablity;
71 ///
72 /// TRUE if the adapter supports booting from FCoE targets.
73 ///
74 BOOLEAN FCoeBootCapablity;
75 ///
76 /// TRUE if the adapter supports an offload engine (such as TCP
77 /// Offload Engine (TOE)) for its iSCSI or FCoE boot operations.
78 ///
79 BOOLEAN OffloadCapability;
80 ///
81 /// TRUE if the adapter supports multipath I/O (MPIO) for its iSCSI
82 /// boot operations.
83 ///
84 BOOLEAN iScsiMpioCapability;
85 ///
86 /// TRUE if the adapter is currently configured to boot from iSCSI
87 /// IPv4 targets.
88 ///
89 BOOLEAN iScsiIpv4Boot;
90 ///
91 /// TRUE if the adapter is currently configured to boot from iSCSI
92 /// IPv6 targets.
93 ///
94 BOOLEAN iScsiIpv6Boot;
95 ///
96 /// TRUE if the adapter is currently configured to boot from FCoE targets.
97 ///
98 BOOLEAN FCoeBoot;
99 }EFI_ADAPTER_INFO_NETWORK_BOOT;
100
101 ///
102 /// EFI_ADAPTER_INFO_SAN_MAC_ADDRESS
103 ///
104 typedef struct {
105 ///
106 /// Returns the SAN MAC address for the adapter.For adapters that support today's 802.3 ethernet
107 /// networking and Fibre-Channel Over Ethernet (FCOE), this conveys the FCOE SAN MAC address from the adapter.
108 ///
109 EFI_MAC_ADDRESS SanMacAddress;
110 }EFI_ADAPTER_INFO_SAN_MAC_ADDRESS;
111
112 /**
113 Returns the current state information for the adapter.
114
115 This function returns information of type InformationType from the adapter.
116 If an adapter does not support the requested informational type, then
117 EFI_UNSUPPORTED is returned.
118
119 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
120 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
121 @param[out] InforamtionBlock The service returns a pointer to the buffer with the InformationBlock
122 structure which contains details about the data specific to InformationType.
123 @param[out] InforamtionBlockSize The driver returns the size of the InformationBlock in bytes.
124
125 @retval EFI_SUCCESS The InformationType information was retrieved.
126 @retval EFI_UNSUPPORTED The InformationType is not known.
127 @retval EFI_DEVICE_ERROR The device reported an error.
128 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
129 @retval EFI_INVALID_PARAMETER This is NULL.
130 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
131 @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL.
132
133 **/
134 typedef
135 EFI_STATUS
136 (EFIAPI *EFI_ADAPTER_INFO_GET_INFO)(
137 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
138 IN EFI_GUID *InformationType,
139 OUT VOID **InformationBlock,
140 OUT UINTN *InformationBlockSize
141 );
142
143 /**
144 Sets state information for an adapter.
145
146 This function sends information of type InformationType for an adapter.
147 If an adapter does not support the requested information type, then EFI_UNSUPPORTED
148 is returned.
149
150 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
151 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
152 @param[in] InforamtionBlock A pointer to the InformationBlock structure which contains details
153 about the data specific to InformationType.
154 @param[in] InforamtionBlockSize The size of the InformationBlock in bytes.
155
156 @retval EFI_SUCCESS The information was received and interpreted successfully.
157 @retval EFI_UNSUPPORTED The InformationType is not known.
158 @retval EFI_DEVICE_ERROR The device reported an error.
159 @retval EFI_INVALID_PARAMETER This is NULL.
160 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
161 @retval EFI_WRITE_PROTECTED The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().
162
163 **/
164 typedef
165 EFI_STATUS
166 (EFIAPI *EFI_ADAPTER_INFO_SET_INFO)(
167 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
168 IN EFI_GUID *InformationType,
169 IN VOID *InformationBlock,
170 IN UINTN InformationBlockSize
171 );
172
173 /**
174 Get a list of supported information types for this instance of the protocol.
175
176 This function returns a list of InformationType GUIDs that are supported on an
177 adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned
178 in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in
179 InfoTypesBufferCount.
180
181 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
182 @param[out] InfoTypesBuffer A pointer to the list of InformationType GUID pointers that are supported
183 by This.
184 @param[out] InfoTypesBufferCount A pointer to the number of GUID pointers present in InfoTypesBuffer.
185
186 @retval EFI_SUCCESS The list of information type GUIDs that are supported on this adapter was
187 returned in InfoTypesBuffer. The number of information type GUIDs was
188 returned in InfoTypesBufferCount.
189 @retval EFI_INVALID_PARAMETER This is NULL.
190 @retval EFI_INVALID_PARAMETER InfoTypesBuffer is NULL.
191 @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.
192 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
193
194 **/
195 typedef
196 EFI_STATUS
197 (EFIAPI *EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES)(
198 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
199 OUT EFI_GUID **InfoTypesBuffer,
200 OUT UINTN *InfoTypesBufferCount
201 );
202
203 ///
204 /// EFI_ADAPTER_INFORMATION_PROTOCOL
205 /// The protocol for adapter provides the following services.
206 /// - Gets device state information from adapter.
207 /// - Sets device information for adapter.
208 /// - Gets a list of supported information types for this instance of the protocol.
209 ///
210 struct _EFI_ADAPTER_INFORMATION_PROTOCOL {
211 EFI_ADAPTER_INFO_GET_INFO GetInformation;
212 EFI_ADAPTER_INFO_SET_INFO SetInformation;
213 EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES GetSupportedTypes;
214 };
215
216 extern EFI_GUID gEfiAdapterInformationProtocolGuid;
217
218 extern EFI_GUID gEfiAdapterInfoMediaStateGuid;
219
220 extern EFI_GUID gEfiAdapterInfoNetworkBootGuid;
221
222 extern EFI_GUID gEfiAdapterInfoSanMacAddressGuid;
223
224 #endif