]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r | |
3 | EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.\r | |
4 | \r | |
9df063a0 | 5 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
af2dc6a7 | 6 | This program and the accompanying materials are licensed and made available under \r |
7 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
8 | The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php. \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
d1f95000 | 13 | \r |
5899caf0 | 14 | @par Revision Reference: \r |
15 | This Protocol is introduced in UEFI Specification 2.0\r | |
16 | \r | |
d1f95000 | 17 | **/\r |
18 | \r | |
19bee90c LG |
19 | #ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__\r |
20 | #define __EFI_MANAGED_NETWORK_PROTOCOL_H__\r | |
d1f95000 | 21 | \r |
22 | #include <Protocol/SimpleNetwork.h>\r | |
23 | \r | |
24 | #define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \\r | |
25 | { \\r | |
26 | 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \\r | |
27 | }\r | |
28 | \r | |
29 | #define EFI_MANAGED_NETWORK_PROTOCOL_GUID \\r | |
30 | { \\r | |
f6203b71 | 31 | 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \\r |
d1f95000 | 32 | }\r |
33 | \r | |
34 | typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r | |
35 | \r | |
36 | typedef struct {\r | |
992f22b9 LG |
37 | ///\r |
38 | /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed\r | |
39 | /// from the MNP receive queue will be dropped if its receive timeout expires.\r | |
40 | ///\r | |
d1f95000 | 41 | UINT32 ReceivedQueueTimeoutValue;\r |
992f22b9 LG |
42 | ///\r |
43 | /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed\r | |
44 | /// from the MNP transmit queue will be dropped if its receive timeout expires.\r | |
45 | ///\r | |
d1f95000 | 46 | UINT32 TransmitQueueTimeoutValue;\r |
992f22b9 LG |
47 | ///\r |
48 | /// Ethernet type II 16-bit protocol type in host byte order. Valid\r | |
49 | /// values are zero and 1,500 to 65,535.\r | |
50 | ///\r | |
d1f95000 | 51 | UINT16 ProtocolTypeFilter;\r |
992f22b9 LG |
52 | ///\r |
53 | /// Set to TRUE to receive packets that are sent to the network\r | |
54 | /// device MAC address. The startup default value is FALSE.\r | |
55 | ///\r | |
d1f95000 | 56 | BOOLEAN EnableUnicastReceive;\r |
992f22b9 LG |
57 | ///\r |
58 | /// Set to TRUE to receive packets that are sent to any of the\r | |
59 | /// active multicast groups. The startup default value is FALSE.\r | |
60 | ///\r | |
d1f95000 | 61 | BOOLEAN EnableMulticastReceive;\r |
992f22b9 LG |
62 | ///\r |
63 | /// Set to TRUE to receive packets that are sent to the network\r | |
64 | /// device broadcast address. The startup default value is FALSE.\r | |
65 | ///\r | |
d1f95000 | 66 | BOOLEAN EnableBroadcastReceive;\r |
992f22b9 LG |
67 | ///\r |
68 | /// Set to TRUE to receive packets that are sent to any MAC address.\r | |
69 | /// The startup default value is FALSE.\r | |
70 | ///\r | |
d1f95000 | 71 | BOOLEAN EnablePromiscuousReceive;\r |
992f22b9 LG |
72 | ///\r |
73 | /// Set to TRUE to drop queued packets when the configuration\r | |
74 | /// is changed. The startup default value is FALSE.\r | |
75 | ///\r | |
d1f95000 | 76 | BOOLEAN FlushQueuesOnReset;\r |
992f22b9 LG |
77 | ///\r |
78 | /// Set to TRUE to timestamp all packets when they are received\r | |
79 | /// by the MNP. Note that timestamps may be unsupported in some\r | |
80 | /// MNP implementations. The startup default value is FALSE.\r | |
81 | ///\r | |
d1f95000 | 82 | BOOLEAN EnableReceiveTimestamps;\r |
992f22b9 LG |
83 | ///\r |
84 | /// Set to TRUE to disable background polling in this MNP\r | |
85 | /// instance. Note that background polling may not be supported in\r | |
86 | /// all MNP implementations. The startup default value is FALSE,\r | |
87 | /// unless background polling is not supported.\r | |
88 | ///\r | |
d1f95000 | 89 | BOOLEAN DisableBackgroundPolling;\r |
90 | } EFI_MANAGED_NETWORK_CONFIG_DATA;\r | |
91 | \r | |
92 | typedef struct {\r | |
93 | EFI_TIME Timestamp;\r | |
94 | EFI_EVENT RecycleEvent;\r | |
95 | UINT32 PacketLength;\r | |
96 | UINT32 HeaderLength;\r | |
97 | UINT32 AddressLength;\r | |
98 | UINT32 DataLength;\r | |
99 | BOOLEAN BroadcastFlag;\r | |
100 | BOOLEAN MulticastFlag;\r | |
101 | BOOLEAN PromiscuousFlag;\r | |
102 | UINT16 ProtocolType;\r | |
103 | VOID *DestinationAddress;\r | |
104 | VOID *SourceAddress;\r | |
105 | VOID *MediaHeader;\r | |
106 | VOID *PacketData;\r | |
107 | } EFI_MANAGED_NETWORK_RECEIVE_DATA;\r | |
108 | \r | |
109 | typedef struct {\r | |
110 | UINT32 FragmentLength;\r | |
111 | VOID *FragmentBuffer;\r | |
112 | } EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r | |
113 | \r | |
114 | typedef struct {\r | |
115 | EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL\r | |
116 | EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL\r | |
117 | UINT16 ProtocolType; //OPTIONAL\r | |
118 | UINT32 DataLength;\r | |
119 | UINT16 HeaderLength; //OPTIONAL\r | |
120 | UINT16 FragmentCount;\r | |
121 | EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];\r | |
122 | } EFI_MANAGED_NETWORK_TRANSMIT_DATA;\r | |
123 | \r | |
124 | \r | |
125 | typedef struct {\r | |
992f22b9 LG |
126 | ///\r |
127 | /// This Event will be signaled after the Status field is updated\r | |
128 | /// by the MNP. The type of Event must be\r | |
129 | /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of\r | |
130 | /// Event must be lower than or equal to TPL_CALLBACK.\r | |
131 | ///\r | |
d1f95000 | 132 | EFI_EVENT Event;\r |
992f22b9 LG |
133 | ///\r |
134 | /// The status that is returned to the caller at the end of the operation\r | |
135 | /// to indicate whether this operation completed successfully.\r | |
136 | ///\r | |
d1f95000 | 137 | EFI_STATUS Status;\r |
138 | union {\r | |
992f22b9 LG |
139 | ///\r |
140 | /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.\r | |
141 | ///\r | |
d1f95000 | 142 | EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;\r |
992f22b9 LG |
143 | ///\r |
144 | /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.\r | |
145 | ///\r | |
d1f95000 | 146 | EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;\r |
147 | } Packet;\r | |
148 | } EFI_MANAGED_NETWORK_COMPLETION_TOKEN;\r | |
149 | \r | |
150 | /**\r | |
151 | Returns the operational parameters for the current MNP child driver.\r | |
152 | \r | |
af2dc6a7 | 153 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
154 | @param MnpConfigData The pointer to storage for MNP operational parameters.\r | |
155 | @param SnpModeData The pointer to storage for SNP operational parameters.\r | |
d1f95000 | 156 | \r |
157 | @retval EFI_SUCCESS The operation completed successfully.\r | |
158 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
159 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
160 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default\r | |
161 | values are returned in MnpConfigData if it is not NULL.\r | |
162 | @retval Other The mode data could not be read.\r | |
163 | \r | |
164 | **/\r | |
165 | typedef\r | |
166 | EFI_STATUS\r | |
8b13229b | 167 | (EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(\r |
d1f95000 | 168 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
169 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
f6203b71 | 170 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r |
ed66e1bc | 171 | );\r |
d1f95000 | 172 | \r |
173 | /**\r | |
174 | Sets or clears the operational parameters for the MNP child driver.\r | |
175 | \r | |
af2dc6a7 | 176 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
177 | @param MnpConfigData The pointer to configuration data that will be assigned to the MNP\r | |
d1f95000 | 178 | child driver instance. If NULL, the MNP child driver instance is\r |
179 | reset to startup defaults and all pending transmit and receive\r | |
180 | requests are flushed.\r | |
181 | \r | |
182 | @retval EFI_SUCCESS The operation completed successfully.\r | |
183 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
184 | @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be\r | |
185 | allocated.\r | |
186 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]\r | |
187 | implementation.\r | |
188 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
189 | @retval Other The MNP child driver instance has been reset to startup defaults.\r | |
190 | \r | |
191 | **/\r | |
192 | typedef\r | |
193 | EFI_STATUS\r | |
8b13229b | 194 | (EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(\r |
d1f95000 | 195 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 196 | IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL\r |
ed66e1bc | 197 | );\r |
f6203b71 | 198 | \r |
d1f95000 | 199 | /**\r |
200 | Translates an IP multicast address to a hardware (MAC) multicast address.\r | |
201 | \r | |
af2dc6a7 | 202 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
d1f95000 | 203 | @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.\r |
204 | Set to FALSE if IpAddress is an IPv4 multicast address.\r | |
af2dc6a7 | 205 | @param IpAddress The pointer to the multicast IP address (in network byte order) to convert.\r |
206 | @param MacAddress The pointer to the resulting multicast MAC address.\r | |
d1f95000 | 207 | \r |
208 | @retval EFI_SUCCESS The operation completed successfully.\r | |
209 | @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:\r | |
210 | - This is NULL.\r | |
211 | - IpAddress is NULL.\r | |
212 | - *IpAddress is not a valid multicast IP address.\r | |
213 | - MacAddress is NULL.\r | |
214 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
215 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
216 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
217 | @retval Other The address could not be converted.\r | |
218 | \r | |
219 | **/\r | |
220 | typedef\r | |
221 | EFI_STATUS\r | |
8b13229b | 222 | (EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(\r |
d1f95000 | 223 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
224 | IN BOOLEAN Ipv6Flag,\r | |
225 | IN EFI_IP_ADDRESS *IpAddress,\r | |
f6203b71 | 226 | OUT EFI_MAC_ADDRESS *MacAddress\r |
ed66e1bc | 227 | );\r |
d1f95000 | 228 | \r |
229 | /**\r | |
230 | Enables and disables receive filters for multicast address.\r | |
231 | \r | |
af2dc6a7 | 232 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
d1f95000 | 233 | @param JoinFlag Set to TRUE to join this multicast group.\r |
234 | Set to FALSE to leave this multicast group.\r | |
af2dc6a7 | 235 | @param MacAddress The pointer to the multicast MAC group (address) to join or leave.\r |
d1f95000 | 236 | \r |
237 | @retval EFI_SUCCESS The requested operation completed successfully.\r | |
238 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
239 | - This is NULL.\r | |
240 | - JoinFlag is TRUE and MacAddress is NULL.\r | |
241 | - *MacAddress is not a valid multicast MAC address.\r | |
242 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
243 | @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.\r | |
244 | @retval EFI_NOT_FOUND The supplied multicast group is not joined.\r | |
f6203b71 | 245 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r |
d1f95000 | 246 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r |
247 | @retval Other The requested operation could not be completed.\r | |
248 | \r | |
249 | **/\r | |
250 | typedef\r | |
251 | EFI_STATUS\r | |
8b13229b | 252 | (EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(\r |
d1f95000 | 253 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
254 | IN BOOLEAN JoinFlag,\r | |
f6203b71 | 255 | IN EFI_MAC_ADDRESS *MacAddress OPTIONAL\r |
ed66e1bc | 256 | );\r |
f6203b71 | 257 | \r |
d1f95000 | 258 | /**\r |
259 | Places asynchronous outgoing data packets into the transmit queue.\r | |
260 | \r | |
af2dc6a7 | 261 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
262 | @param Token The pointer to a token associated with the transmit data descriptor.\r | |
d1f95000 | 263 | \r |
264 | @retval EFI_SUCCESS The transmit completion token was cached.\r | |
265 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
266 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
267 | @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.\r | |
268 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r | |
269 | (usually memory).\r | |
270 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
271 | @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.\r | |
272 | \r | |
273 | **/\r | |
274 | typedef\r | |
275 | EFI_STATUS\r | |
8b13229b | 276 | (EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(\r |
d1f95000 | 277 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 278 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 279 | );\r |
f6203b71 | 280 | \r |
d1f95000 | 281 | /**\r |
282 | Places an asynchronous receiving request into the receiving queue.\r | |
283 | \r | |
af2dc6a7 | 284 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
285 | @param Token The pointer to a token associated with the receive data descriptor.\r | |
d1f95000 | 286 | \r |
287 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
288 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
289 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
290 | - This is NULL.\r | |
291 | - Token is NULL.\r | |
af2dc6a7 | 292 | - Token.Event is NULL.\r |
d1f95000 | 293 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r |
294 | (usually memory).\r | |
295 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
296 | @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.\r | |
297 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r | |
298 | \r | |
299 | **/\r | |
300 | typedef\r | |
301 | EFI_STATUS\r | |
8b13229b | 302 | (EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(\r |
d1f95000 | 303 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 304 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 305 | );\r |
f6203b71 | 306 | \r |
d1f95000 | 307 | \r |
308 | /**\r | |
309 | Aborts an asynchronous transmit or receive request.\r | |
310 | \r | |
af2dc6a7 | 311 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
312 | @param Token The pointer to a token that has been issued by\r | |
d1f95000 | 313 | EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or\r |
314 | EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If\r | |
315 | NULL, all pending tokens are aborted.\r | |
316 | \r | |
317 | @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event\r | |
318 | was signaled. When Token is NULL, all pending requests were\r | |
319 | aborted and their events were signaled.\r | |
320 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
321 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
322 | @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was\r | |
323 | not found in the transmit or receive queue. It has either completed\r | |
324 | or was not issued by Transmit() and Receive().\r | |
325 | \r | |
326 | **/\r | |
327 | typedef\r | |
328 | EFI_STATUS\r | |
8b13229b | 329 | (EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(\r |
d1f95000 | 330 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 331 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL\r |
ed66e1bc | 332 | );\r |
d1f95000 | 333 | \r |
334 | /**\r | |
335 | Polls for incoming data packets and processes outgoing data packets.\r | |
336 | \r | |
af2dc6a7 | 337 | @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r |
d1f95000 | 338 | \r |
339 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
340 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
341 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
342 | @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing\r | |
343 | the polling rate.\r | |
344 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
345 | Consider increasing the polling rate.\r | |
346 | \r | |
347 | **/\r | |
348 | typedef\r | |
349 | EFI_STATUS\r | |
8b13229b | 350 | (EFIAPI *EFI_MANAGED_NETWORK_POLL)(\r |
f6203b71 | 351 | IN EFI_MANAGED_NETWORK_PROTOCOL *This\r |
ed66e1bc | 352 | );\r |
d1f95000 | 353 | \r |
44717a39 | 354 | ///\r |
355 | /// The MNP is used by network applications (and drivers) to \r | |
356 | /// perform raw (unformatted) asynchronous network packet I/O.\r | |
357 | ///\r | |
d1f95000 | 358 | struct _EFI_MANAGED_NETWORK_PROTOCOL {\r |
359 | EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;\r | |
360 | EFI_MANAGED_NETWORK_CONFIGURE Configure;\r | |
361 | EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;\r | |
362 | EFI_MANAGED_NETWORK_GROUPS Groups;\r | |
363 | EFI_MANAGED_NETWORK_TRANSMIT Transmit;\r | |
364 | EFI_MANAGED_NETWORK_RECEIVE Receive;\r | |
365 | EFI_MANAGED_NETWORK_CANCEL Cancel;\r | |
366 | EFI_MANAGED_NETWORK_POLL Poll;\r | |
367 | };\r | |
368 | \r | |
369 | extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r | |
370 | extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r | |
371 | \r | |
372 | #endif\r |