]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/AdapterInformation.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / AdapterInformation.h
CommitLineData
66bd412a
SQ
1/** @file\r
2 EFI Adapter Information Protocol definition.\r
3 The EFI Adapter Information Protocol is used to dynamically and quickly discover\r
4 or set device information for an adapter.\r
5\r
9095d37b 6 Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
66bd412a
SQ
8\r
9 @par Revision Reference:\r
10 This Protocol is introduced in UEFI Specification 2.4\r
11\r
12**/\r
13\r
14#ifndef __EFI_ADAPTER_INFORMATION_PROTOCOL_H__\r
15#define __EFI_ADAPTER_INFORMATION_PROTOCOL_H__\r
16\r
17\r
18#define EFI_ADAPTER_INFORMATION_PROTOCOL_GUID \\r
19 { \\r
20 0xE5DD1403, 0xD622, 0xC24E, {0x84, 0x88, 0xC7, 0x1B, 0x17, 0xF5, 0xE8, 0x02 } \\r
21 }\r
22\r
23#define EFI_ADAPTER_INFO_MEDIA_STATE_GUID \\r
24 { \\r
25 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 } \\r
26 }\r
27\r
28#define EFI_ADAPTER_INFO_NETWORK_BOOT_GUID \\r
29 { \\r
30 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C } \\r
31 }\r
32\r
33#define EFI_ADAPTER_INFO_SAN_MAC_ADDRESS_GUID \\r
34 { \\r
35 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 } \\r
36 }\r
37\r
2bbe9553
YT
38#define EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT_GUID \\r
39 { \\r
40 0x4bd56be3, 0x4975, 0x4d8a, {0xa0, 0xad, 0xc4, 0x91, 0x20, 0x4b, 0x5d, 0x4d} \\r
41 }\r
42\r
d51b0122
WF
43#define EFI_ADAPTER_INFO_MEDIA_TYPE_GUID \\r
44 { \\r
45 0x8484472f, 0x71ec, 0x411a, { 0xb3, 0x9c, 0x62, 0xcd, 0x94, 0xd9, 0x91, 0x6e } \\r
46 }\r
47\r
48\r
66bd412a
SQ
49typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL EFI_ADAPTER_INFORMATION_PROTOCOL;\r
50\r
51///\r
52/// EFI_ADAPTER_INFO_MEDIA_STATE\r
53///\r
54typedef struct {\r
55 ///\r
9095d37b
LG
56 /// Returns the current media state status. MediaState can have any of the following values:\r
57 /// EFI_SUCCESS: There is media attached to the network adapter. EFI_NOT_READY: This detects a bounced state.\r
58 /// There was media attached to the network adapter, but it was removed and reattached. EFI_NO_MEDIA: There is\r
66bd412a
SQ
59 /// not any media attached to the network.\r
60 ///\r
61 EFI_STATUS MediaState;\r
2bbe9553 62} EFI_ADAPTER_INFO_MEDIA_STATE;\r
66bd412a 63\r
d51b0122
WF
64///\r
65/// EFI_ADAPTER_INFO_MEDIA_TYPE\r
66///\r
67typedef struct {\r
68 ///\r
69 /// Indicates the current media type. MediaType can have any of the following values:\r
70 /// 1: Ethernet Network Adapter\r
71 /// 2: Ethernet Wireless Network Adapter\r
72 /// 3~255: Reserved\r
73 ///\r
74 UINT8 MediaType;\r
75} EFI_ADAPTER_INFO_MEDIA_TYPE;\r
76\r
66bd412a
SQ
77///\r
78/// EFI_ADAPTER_INFO_NETWORK_BOOT\r
79///\r
80typedef struct {\r
81 ///\r
82 /// TRUE if the adapter supports booting from iSCSI IPv4 targets.\r
83 ///\r
7771be9f 84 BOOLEAN iScsiIpv4BootCapablity;\r
66bd412a
SQ
85 ///\r
86 /// TRUE if the adapter supports booting from iSCSI IPv6 targets.\r
87 ///\r
88 BOOLEAN iScsiIpv6BootCapablity;\r
89 ///\r
90 /// TRUE if the adapter supports booting from FCoE targets.\r
91 ///\r
92 BOOLEAN FCoeBootCapablity;\r
93 ///\r
94 /// TRUE if the adapter supports an offload engine (such as TCP\r
95 /// Offload Engine (TOE)) for its iSCSI or FCoE boot operations.\r
96 ///\r
97 BOOLEAN OffloadCapability;\r
98 ///\r
99 /// TRUE if the adapter supports multipath I/O (MPIO) for its iSCSI\r
100 /// boot operations.\r
101 ///\r
102 BOOLEAN iScsiMpioCapability;\r
103 ///\r
104 /// TRUE if the adapter is currently configured to boot from iSCSI\r
105 /// IPv4 targets.\r
106 ///\r
107 BOOLEAN iScsiIpv4Boot;\r
108 ///\r
109 /// TRUE if the adapter is currently configured to boot from iSCSI\r
110 /// IPv6 targets.\r
111 ///\r
112 BOOLEAN iScsiIpv6Boot;\r
113 ///\r
114 /// TRUE if the adapter is currently configured to boot from FCoE targets.\r
115 ///\r
116 BOOLEAN FCoeBoot;\r
2bbe9553 117} EFI_ADAPTER_INFO_NETWORK_BOOT;\r
66bd412a
SQ
118\r
119///\r
120/// EFI_ADAPTER_INFO_SAN_MAC_ADDRESS\r
121///\r
122typedef struct {\r
123 ///\r
124 /// Returns the SAN MAC address for the adapter.For adapters that support today's 802.3 ethernet\r
125 /// networking and Fibre-Channel Over Ethernet (FCOE), this conveys the FCOE SAN MAC address from the adapter.\r
126 ///\r
127 EFI_MAC_ADDRESS SanMacAddress;\r
2bbe9553
YT
128} EFI_ADAPTER_INFO_SAN_MAC_ADDRESS;\r
129\r
130///\r
131/// EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT\r
132///\r
133typedef struct {\r
134 ///\r
135 /// Returns capability of UNDI to support IPv6 traffic.\r
136 ///\r
9095d37b 137 BOOLEAN Ipv6Support;\r
2bbe9553 138} EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT;\r
66bd412a
SQ
139\r
140/**\r
141 Returns the current state information for the adapter.\r
142\r
143 This function returns information of type InformationType from the adapter.\r
144 If an adapter does not support the requested informational type, then\r
9095d37b 145 EFI_UNSUPPORTED is returned.\r
66bd412a
SQ
146\r
147 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
148 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.\r
149 @param[out] InforamtionBlock The service returns a pointer to the buffer with the InformationBlock\r
150 structure which contains details about the data specific to InformationType.\r
151 @param[out] InforamtionBlockSize The driver returns the size of the InformationBlock in bytes.\r
152\r
153 @retval EFI_SUCCESS The InformationType information was retrieved.\r
154 @retval EFI_UNSUPPORTED The InformationType is not known.\r
155 @retval EFI_DEVICE_ERROR The device reported an error.\r
156 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
9095d37b
LG
157 @retval EFI_INVALID_PARAMETER This is NULL.\r
158 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.\r
66bd412a
SQ
159 @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL.\r
160\r
161**/\r
162typedef\r
163EFI_STATUS\r
164(EFIAPI *EFI_ADAPTER_INFO_GET_INFO)(\r
165 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
166 IN EFI_GUID *InformationType,\r
167 OUT VOID **InformationBlock,\r
168 OUT UINTN *InformationBlockSize\r
169 );\r
170\r
171/**\r
172 Sets state information for an adapter.\r
173\r
174 This function sends information of type InformationType for an adapter.\r
175 If an adapter does not support the requested information type, then EFI_UNSUPPORTED\r
176 is returned.\r
177\r
178 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
179 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.\r
180 @param[in] InforamtionBlock A pointer to the InformationBlock structure which contains details\r
181 about the data specific to InformationType.\r
182 @param[in] InforamtionBlockSize The size of the InformationBlock in bytes.\r
183\r
184 @retval EFI_SUCCESS The information was received and interpreted successfully.\r
185 @retval EFI_UNSUPPORTED The InformationType is not known.\r
186 @retval EFI_DEVICE_ERROR The device reported an error.\r
187 @retval EFI_INVALID_PARAMETER This is NULL.\r
188 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.\r
189 @retval EFI_WRITE_PROTECTED The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().\r
190\r
191**/\r
192typedef\r
193EFI_STATUS\r
194(EFIAPI *EFI_ADAPTER_INFO_SET_INFO)(\r
195 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
196 IN EFI_GUID *InformationType,\r
197 IN VOID *InformationBlock,\r
198 IN UINTN InformationBlockSize\r
199 );\r
200\r
201/**\r
202 Get a list of supported information types for this instance of the protocol.\r
203\r
204 This function returns a list of InformationType GUIDs that are supported on an\r
205 adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned\r
206 in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in\r
207 InfoTypesBufferCount.\r
208\r
209 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.\r
46d491d2 210 @param[out] InfoTypesBuffer A pointer to the array of InformationType GUIDs that are supported\r
66bd412a 211 by This.\r
46d491d2 212 @param[out] InfoTypesBufferCount A pointer to the number of GUIDs present in InfoTypesBuffer.\r
66bd412a
SQ
213\r
214 @retval EFI_SUCCESS The list of information type GUIDs that are supported on this adapter was\r
215 returned in InfoTypesBuffer. The number of information type GUIDs was\r
216 returned in InfoTypesBufferCount.\r
217 @retval EFI_INVALID_PARAMETER This is NULL.\r
218 @retval EFI_INVALID_PARAMETER InfoTypesBuffer is NULL.\r
219 @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.\r
220 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.\r
221\r
222**/\r
223typedef\r
224EFI_STATUS\r
225(EFIAPI *EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES)(\r
226 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,\r
227 OUT EFI_GUID **InfoTypesBuffer,\r
228 OUT UINTN *InfoTypesBufferCount\r
229 );\r
230\r
231///\r
232/// EFI_ADAPTER_INFORMATION_PROTOCOL\r
233/// The protocol for adapter provides the following services.\r
234/// - Gets device state information from adapter.\r
235/// - Sets device information for adapter.\r
236/// - Gets a list of supported information types for this instance of the protocol.\r
237///\r
e27ecde7 238struct _EFI_ADAPTER_INFORMATION_PROTOCOL {\r
66bd412a
SQ
239 EFI_ADAPTER_INFO_GET_INFO GetInformation;\r
240 EFI_ADAPTER_INFO_SET_INFO SetInformation;\r
241 EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES GetSupportedTypes;\r
242};\r
243\r
244extern EFI_GUID gEfiAdapterInformationProtocolGuid;\r
245\r
246extern EFI_GUID gEfiAdapterInfoMediaStateGuid;\r
247\r
248extern EFI_GUID gEfiAdapterInfoNetworkBootGuid;\r
249\r
250extern EFI_GUID gEfiAdapterInfoSanMacAddressGuid;\r
251\r
2bbe9553
YT
252extern EFI_GUID gEfiAdapterInfoUndiIpv6SupportGuid;\r
253\r
66bd412a 254#endif\r