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