]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/AdapterInformation.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[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 - 2017, 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 #define EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT_GUID \
45 { \
46 0x4bd56be3, 0x4975, 0x4d8a, {0xa0, 0xad, 0xc4, 0x91, 0x20, 0x4b, 0x5d, 0x4d} \
47 }
48
49 #define EFI_ADAPTER_INFO_MEDIA_TYPE_GUID \
50 { \
51 0x8484472f, 0x71ec, 0x411a, { 0xb3, 0x9c, 0x62, 0xcd, 0x94, 0xd9, 0x91, 0x6e } \
52 }
53
54
55 typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL EFI_ADAPTER_INFORMATION_PROTOCOL;
56
57 ///
58 /// EFI_ADAPTER_INFO_MEDIA_STATE
59 ///
60 typedef struct {
61 ///
62 /// Returns the current media state status. MediaState can have any of the following values:
63 /// EFI_SUCCESS: There is media attached to the network adapter. EFI_NOT_READY: This detects a bounced state.
64 /// There was media attached to the network adapter, but it was removed and reattached. EFI_NO_MEDIA: There is
65 /// not any media attached to the network.
66 ///
67 EFI_STATUS MediaState;
68 } EFI_ADAPTER_INFO_MEDIA_STATE;
69
70 ///
71 /// EFI_ADAPTER_INFO_MEDIA_TYPE
72 ///
73 typedef struct {
74 ///
75 /// Indicates the current media type. MediaType can have any of the following values:
76 /// 1: Ethernet Network Adapter
77 /// 2: Ethernet Wireless Network Adapter
78 /// 3~255: Reserved
79 ///
80 UINT8 MediaType;
81 } EFI_ADAPTER_INFO_MEDIA_TYPE;
82
83 ///
84 /// EFI_ADAPTER_INFO_NETWORK_BOOT
85 ///
86 typedef struct {
87 ///
88 /// TRUE if the adapter supports booting from iSCSI IPv4 targets.
89 ///
90 BOOLEAN iScsiIpv4BootCapablity;
91 ///
92 /// TRUE if the adapter supports booting from iSCSI IPv6 targets.
93 ///
94 BOOLEAN iScsiIpv6BootCapablity;
95 ///
96 /// TRUE if the adapter supports booting from FCoE targets.
97 ///
98 BOOLEAN FCoeBootCapablity;
99 ///
100 /// TRUE if the adapter supports an offload engine (such as TCP
101 /// Offload Engine (TOE)) for its iSCSI or FCoE boot operations.
102 ///
103 BOOLEAN OffloadCapability;
104 ///
105 /// TRUE if the adapter supports multipath I/O (MPIO) for its iSCSI
106 /// boot operations.
107 ///
108 BOOLEAN iScsiMpioCapability;
109 ///
110 /// TRUE if the adapter is currently configured to boot from iSCSI
111 /// IPv4 targets.
112 ///
113 BOOLEAN iScsiIpv4Boot;
114 ///
115 /// TRUE if the adapter is currently configured to boot from iSCSI
116 /// IPv6 targets.
117 ///
118 BOOLEAN iScsiIpv6Boot;
119 ///
120 /// TRUE if the adapter is currently configured to boot from FCoE targets.
121 ///
122 BOOLEAN FCoeBoot;
123 } EFI_ADAPTER_INFO_NETWORK_BOOT;
124
125 ///
126 /// EFI_ADAPTER_INFO_SAN_MAC_ADDRESS
127 ///
128 typedef struct {
129 ///
130 /// Returns the SAN MAC address for the adapter.For adapters that support today's 802.3 ethernet
131 /// networking and Fibre-Channel Over Ethernet (FCOE), this conveys the FCOE SAN MAC address from the adapter.
132 ///
133 EFI_MAC_ADDRESS SanMacAddress;
134 } EFI_ADAPTER_INFO_SAN_MAC_ADDRESS;
135
136 ///
137 /// EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT
138 ///
139 typedef struct {
140 ///
141 /// Returns capability of UNDI to support IPv6 traffic.
142 ///
143 BOOLEAN Ipv6Support;
144 } EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT;
145
146 /**
147 Returns the current state information for the adapter.
148
149 This function returns information of type InformationType from the adapter.
150 If an adapter does not support the requested informational type, then
151 EFI_UNSUPPORTED is returned.
152
153 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
154 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
155 @param[out] InforamtionBlock The service returns a pointer to the buffer with the InformationBlock
156 structure which contains details about the data specific to InformationType.
157 @param[out] InforamtionBlockSize The driver returns the size of the InformationBlock in bytes.
158
159 @retval EFI_SUCCESS The InformationType information was retrieved.
160 @retval EFI_UNSUPPORTED The InformationType is not known.
161 @retval EFI_DEVICE_ERROR The device reported an error.
162 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
163 @retval EFI_INVALID_PARAMETER This is NULL.
164 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
165 @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL.
166
167 **/
168 typedef
169 EFI_STATUS
170 (EFIAPI *EFI_ADAPTER_INFO_GET_INFO)(
171 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
172 IN EFI_GUID *InformationType,
173 OUT VOID **InformationBlock,
174 OUT UINTN *InformationBlockSize
175 );
176
177 /**
178 Sets state information for an adapter.
179
180 This function sends information of type InformationType for an adapter.
181 If an adapter does not support the requested information type, then EFI_UNSUPPORTED
182 is returned.
183
184 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
185 @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
186 @param[in] InforamtionBlock A pointer to the InformationBlock structure which contains details
187 about the data specific to InformationType.
188 @param[in] InforamtionBlockSize The size of the InformationBlock in bytes.
189
190 @retval EFI_SUCCESS The information was received and interpreted successfully.
191 @retval EFI_UNSUPPORTED The InformationType is not known.
192 @retval EFI_DEVICE_ERROR The device reported an error.
193 @retval EFI_INVALID_PARAMETER This is NULL.
194 @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
195 @retval EFI_WRITE_PROTECTED The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().
196
197 **/
198 typedef
199 EFI_STATUS
200 (EFIAPI *EFI_ADAPTER_INFO_SET_INFO)(
201 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
202 IN EFI_GUID *InformationType,
203 IN VOID *InformationBlock,
204 IN UINTN InformationBlockSize
205 );
206
207 /**
208 Get a list of supported information types for this instance of the protocol.
209
210 This function returns a list of InformationType GUIDs that are supported on an
211 adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned
212 in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in
213 InfoTypesBufferCount.
214
215 @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
216 @param[out] InfoTypesBuffer A pointer to the array of InformationType GUIDs that are supported
217 by This.
218 @param[out] InfoTypesBufferCount A pointer to the number of GUIDs present in InfoTypesBuffer.
219
220 @retval EFI_SUCCESS The list of information type GUIDs that are supported on this adapter was
221 returned in InfoTypesBuffer. The number of information type GUIDs was
222 returned in InfoTypesBufferCount.
223 @retval EFI_INVALID_PARAMETER This is NULL.
224 @retval EFI_INVALID_PARAMETER InfoTypesBuffer is NULL.
225 @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.
226 @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
227
228 **/
229 typedef
230 EFI_STATUS
231 (EFIAPI *EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES)(
232 IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
233 OUT EFI_GUID **InfoTypesBuffer,
234 OUT UINTN *InfoTypesBufferCount
235 );
236
237 ///
238 /// EFI_ADAPTER_INFORMATION_PROTOCOL
239 /// The protocol for adapter provides the following services.
240 /// - Gets device state information from adapter.
241 /// - Sets device information for adapter.
242 /// - Gets a list of supported information types for this instance of the protocol.
243 ///
244 struct _EFI_ADAPTER_INFORMATION_PROTOCOL {
245 EFI_ADAPTER_INFO_GET_INFO GetInformation;
246 EFI_ADAPTER_INFO_SET_INFO SetInformation;
247 EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES GetSupportedTypes;
248 };
249
250 extern EFI_GUID gEfiAdapterInformationProtocolGuid;
251
252 extern EFI_GUID gEfiAdapterInfoMediaStateGuid;
253
254 extern EFI_GUID gEfiAdapterInfoNetworkBootGuid;
255
256 extern EFI_GUID gEfiAdapterInfoSanMacAddressGuid;
257
258 extern EFI_GUID gEfiAdapterInfoUndiIpv6SupportGuid;
259
260 #endif