2 EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
3 EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.
5 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 @par Revision Reference:
15 This Protocol is introduced in UEFI Specification 2.0
19 #ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__
20 #define __EFI_MANAGED_NETWORK_PROTOCOL_H__
22 FILE_LICENCE ( BSD3 );
24 #include <ipxe/efi/Protocol/SimpleNetwork.h>
26 #define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
28 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \
31 #define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
33 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \
36 typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;
40 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
41 /// from the MNP receive queue will be dropped if its receive timeout expires.
43 UINT32 ReceivedQueueTimeoutValue;
45 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
46 /// from the MNP transmit queue will be dropped if its receive timeout expires.
48 UINT32 TransmitQueueTimeoutValue;
50 /// Ethernet type II 16-bit protocol type in host byte order. Valid
51 /// values are zero and 1,500 to 65,535.
53 UINT16 ProtocolTypeFilter;
55 /// Set to TRUE to receive packets that are sent to the network
56 /// device MAC address. The startup default value is FALSE.
58 BOOLEAN EnableUnicastReceive;
60 /// Set to TRUE to receive packets that are sent to any of the
61 /// active multicast groups. The startup default value is FALSE.
63 BOOLEAN EnableMulticastReceive;
65 /// Set to TRUE to receive packets that are sent to the network
66 /// device broadcast address. The startup default value is FALSE.
68 BOOLEAN EnableBroadcastReceive;
70 /// Set to TRUE to receive packets that are sent to any MAC address.
71 /// The startup default value is FALSE.
73 BOOLEAN EnablePromiscuousReceive;
75 /// Set to TRUE to drop queued packets when the configuration
76 /// is changed. The startup default value is FALSE.
78 BOOLEAN FlushQueuesOnReset;
80 /// Set to TRUE to timestamp all packets when they are received
81 /// by the MNP. Note that timestamps may be unsupported in some
82 /// MNP implementations. The startup default value is FALSE.
84 BOOLEAN EnableReceiveTimestamps;
86 /// Set to TRUE to disable background polling in this MNP
87 /// instance. Note that background polling may not be supported in
88 /// all MNP implementations. The startup default value is FALSE,
89 /// unless background polling is not supported.
91 BOOLEAN DisableBackgroundPolling;
92 } EFI_MANAGED_NETWORK_CONFIG_DATA;
96 EFI_EVENT RecycleEvent;
101 BOOLEAN BroadcastFlag;
102 BOOLEAN MulticastFlag;
103 BOOLEAN PromiscuousFlag;
105 VOID *DestinationAddress;
109 } EFI_MANAGED_NETWORK_RECEIVE_DATA;
112 UINT32 FragmentLength;
113 VOID *FragmentBuffer;
114 } EFI_MANAGED_NETWORK_FRAGMENT_DATA;
117 EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL
118 EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL
119 UINT16 ProtocolType; //OPTIONAL
121 UINT16 HeaderLength; //OPTIONAL
122 UINT16 FragmentCount;
123 EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];
124 } EFI_MANAGED_NETWORK_TRANSMIT_DATA;
129 /// This Event will be signaled after the Status field is updated
130 /// by the MNP. The type of Event must be
131 /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
132 /// Event must be lower than or equal to TPL_CALLBACK.
136 /// The status that is returned to the caller at the end of the operation
137 /// to indicate whether this operation completed successfully.
142 /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
144 EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;
146 /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.
148 EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;
150 } EFI_MANAGED_NETWORK_COMPLETION_TOKEN;
153 Returns the operational parameters for the current MNP child driver.
155 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
156 @param MnpConfigData The pointer to storage for MNP operational parameters.
157 @param SnpModeData The pointer to storage for SNP operational parameters.
159 @retval EFI_SUCCESS The operation completed successfully.
160 @retval EFI_INVALID_PARAMETER This is NULL.
161 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
162 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default
163 values are returned in MnpConfigData if it is not NULL.
164 @retval Other The mode data could not be read.
169 (EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(
170 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
171 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
172 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
176 Sets or clears the operational parameters for the MNP child driver.
178 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
179 @param MnpConfigData The pointer to configuration data that will be assigned to the MNP
180 child driver instance. If NULL, the MNP child driver instance is
181 reset to startup defaults and all pending transmit and receive
182 requests are flushed.
184 @retval EFI_SUCCESS The operation completed successfully.
185 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
186 @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be
188 @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]
190 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
191 @retval Other The MNP child driver instance has been reset to startup defaults.
196 (EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(
197 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
198 IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL
202 Translates an IP multicast address to a hardware (MAC) multicast address.
204 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
205 @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
206 Set to FALSE if IpAddress is an IPv4 multicast address.
207 @param IpAddress The pointer to the multicast IP address (in network byte order) to convert.
208 @param MacAddress The pointer to the resulting multicast MAC address.
210 @retval EFI_SUCCESS The operation completed successfully.
211 @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
214 - *IpAddress is not a valid multicast IP address.
215 - MacAddress is NULL.
216 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
217 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
218 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
219 @retval Other The address could not be converted.
224 (EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(
225 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
227 IN EFI_IP_ADDRESS *IpAddress,
228 OUT EFI_MAC_ADDRESS *MacAddress
232 Enables and disables receive filters for multicast address.
234 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
235 @param JoinFlag Set to TRUE to join this multicast group.
236 Set to FALSE to leave this multicast group.
237 @param MacAddress The pointer to the multicast MAC group (address) to join or leave.
239 @retval EFI_SUCCESS The requested operation completed successfully.
240 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
242 - JoinFlag is TRUE and MacAddress is NULL.
243 - *MacAddress is not a valid multicast MAC address.
244 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
245 @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
246 @retval EFI_NOT_FOUND The supplied multicast group is not joined.
247 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
248 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
249 @retval Other The requested operation could not be completed.
254 (EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(
255 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
257 IN EFI_MAC_ADDRESS *MacAddress OPTIONAL
261 Places asynchronous outgoing data packets into the transmit queue.
263 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
264 @param Token The pointer to a token associated with the transmit data descriptor.
266 @retval EFI_SUCCESS The transmit completion token was cached.
267 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
268 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
269 @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.
270 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
272 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
273 @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.
278 (EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(
279 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
280 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
284 Places an asynchronous receiving request into the receiving queue.
286 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
287 @param Token The pointer to a token associated with the receive data descriptor.
289 @retval EFI_SUCCESS The receive completion token was cached.
290 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
291 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
294 - Token.Event is NULL.
295 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
297 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
298 @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.
299 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
304 (EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(
305 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
306 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
311 Aborts an asynchronous transmit or receive request.
313 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
314 @param Token The pointer to a token that has been issued by
315 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
316 EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
317 NULL, all pending tokens are aborted.
319 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
320 was signaled. When Token is NULL, all pending requests were
321 aborted and their events were signaled.
322 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
323 @retval EFI_INVALID_PARAMETER This is NULL.
324 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
325 not found in the transmit or receive queue. It has either completed
326 or was not issued by Transmit() and Receive().
331 (EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(
332 IN EFI_MANAGED_NETWORK_PROTOCOL *This,
333 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL
337 Polls for incoming data packets and processes outgoing data packets.
339 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
341 @retval EFI_SUCCESS Incoming or outgoing data was processed.
342 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
343 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
344 @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing
346 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
347 Consider increasing the polling rate.
352 (EFIAPI *EFI_MANAGED_NETWORK_POLL)(
353 IN EFI_MANAGED_NETWORK_PROTOCOL *This
357 /// The MNP is used by network applications (and drivers) to
358 /// perform raw (unformatted) asynchronous network packet I/O.
360 struct _EFI_MANAGED_NETWORK_PROTOCOL {
361 EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;
362 EFI_MANAGED_NETWORK_CONFIGURE Configure;
363 EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;
364 EFI_MANAGED_NETWORK_GROUPS Groups;
365 EFI_MANAGED_NETWORK_TRANSMIT Transmit;
366 EFI_MANAGED_NETWORK_RECEIVE Receive;
367 EFI_MANAGED_NETWORK_CANCEL Cancel;
368 EFI_MANAGED_NETWORK_POLL Poll;
371 extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;
372 extern EFI_GUID gEfiManagedNetworkProtocolGuid;