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 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.0
13 #ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__
14 #define __EFI_MANAGED_NETWORK_PROTOCOL_H__
16 #include <Protocol/SimpleNetwork.h>
18 #define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
20 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \
23 #define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
25 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \
28 typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL
;
32 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
33 /// from the MNP receive queue will be dropped if its receive timeout expires.
35 UINT32 ReceivedQueueTimeoutValue
;
37 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
38 /// from the MNP transmit queue will be dropped if its receive timeout expires.
40 UINT32 TransmitQueueTimeoutValue
;
42 /// Ethernet type II 16-bit protocol type in host byte order. Valid
43 /// values are zero and 1,500 to 65,535.
45 UINT16 ProtocolTypeFilter
;
47 /// Set to TRUE to receive packets that are sent to the network
48 /// device MAC address. The startup default value is FALSE.
50 BOOLEAN EnableUnicastReceive
;
52 /// Set to TRUE to receive packets that are sent to any of the
53 /// active multicast groups. The startup default value is FALSE.
55 BOOLEAN EnableMulticastReceive
;
57 /// Set to TRUE to receive packets that are sent to the network
58 /// device broadcast address. The startup default value is FALSE.
60 BOOLEAN EnableBroadcastReceive
;
62 /// Set to TRUE to receive packets that are sent to any MAC address.
63 /// The startup default value is FALSE.
65 BOOLEAN EnablePromiscuousReceive
;
67 /// Set to TRUE to drop queued packets when the configuration
68 /// is changed. The startup default value is FALSE.
70 BOOLEAN FlushQueuesOnReset
;
72 /// Set to TRUE to timestamp all packets when they are received
73 /// by the MNP. Note that timestamps may be unsupported in some
74 /// MNP implementations. The startup default value is FALSE.
76 BOOLEAN EnableReceiveTimestamps
;
78 /// Set to TRUE to disable background polling in this MNP
79 /// instance. Note that background polling may not be supported in
80 /// all MNP implementations. The startup default value is FALSE,
81 /// unless background polling is not supported.
83 BOOLEAN DisableBackgroundPolling
;
84 } EFI_MANAGED_NETWORK_CONFIG_DATA
;
88 EFI_EVENT RecycleEvent
;
93 BOOLEAN BroadcastFlag
;
94 BOOLEAN MulticastFlag
;
95 BOOLEAN PromiscuousFlag
;
97 VOID
*DestinationAddress
;
101 } EFI_MANAGED_NETWORK_RECEIVE_DATA
;
104 UINT32 FragmentLength
;
105 VOID
*FragmentBuffer
;
106 } EFI_MANAGED_NETWORK_FRAGMENT_DATA
;
109 EFI_MAC_ADDRESS
*DestinationAddress
; // OPTIONAL
110 EFI_MAC_ADDRESS
*SourceAddress
; // OPTIONAL
111 UINT16 ProtocolType
; // OPTIONAL
113 UINT16 HeaderLength
; // OPTIONAL
114 UINT16 FragmentCount
;
115 EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable
[1];
116 } EFI_MANAGED_NETWORK_TRANSMIT_DATA
;
120 /// This Event will be signaled after the Status field is updated
121 /// by the MNP. The type of Event must be
122 /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
123 /// Event must be lower than or equal to TPL_CALLBACK.
127 /// The status that is returned to the caller at the end of the operation
128 /// to indicate whether this operation completed successfully.
133 /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
135 EFI_MANAGED_NETWORK_RECEIVE_DATA
*RxData
;
137 /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.
139 EFI_MANAGED_NETWORK_TRANSMIT_DATA
*TxData
;
141 } EFI_MANAGED_NETWORK_COMPLETION_TOKEN
;
144 Returns the operational parameters for the current MNP child driver.
146 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
147 @param MnpConfigData The pointer to storage for MNP operational parameters.
148 @param SnpModeData The pointer to storage for SNP operational parameters.
150 @retval EFI_SUCCESS The operation completed successfully.
151 @retval EFI_INVALID_PARAMETER This is NULL.
152 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
153 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default
154 values are returned in MnpConfigData if it is not NULL.
155 @retval Other The mode data could not be read.
160 (EFIAPI
*EFI_MANAGED_NETWORK_GET_MODE_DATA
)(
161 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
162 OUT EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
,
163 OUT EFI_SIMPLE_NETWORK_MODE
*SnpModeData OPTIONAL
167 Sets or clears the operational parameters for the MNP child driver.
169 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
170 @param MnpConfigData The pointer to configuration data that will be assigned to the MNP
171 child driver instance. If NULL, the MNP child driver instance is
172 reset to startup defaults and all pending transmit and receive
173 requests are flushed.
175 @retval EFI_SUCCESS The operation completed successfully.
176 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
177 @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be
179 @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]
181 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
182 @retval Other The MNP child driver instance has been reset to startup defaults.
187 (EFIAPI
*EFI_MANAGED_NETWORK_CONFIGURE
)(
188 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
189 IN EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
193 Translates an IP multicast address to a hardware (MAC) multicast address.
195 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
196 @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
197 Set to FALSE if IpAddress is an IPv4 multicast address.
198 @param IpAddress The pointer to the multicast IP address (in network byte order) to convert.
199 @param MacAddress The pointer to the resulting multicast MAC address.
201 @retval EFI_SUCCESS The operation completed successfully.
202 @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
205 - *IpAddress is not a valid multicast IP address.
206 - MacAddress is NULL.
207 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
208 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
209 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
210 @retval Other The address could not be converted.
215 (EFIAPI
*EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC
)(
216 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
218 IN EFI_IP_ADDRESS
*IpAddress
,
219 OUT EFI_MAC_ADDRESS
*MacAddress
223 Enables and disables receive filters for multicast address.
225 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
226 @param JoinFlag Set to TRUE to join this multicast group.
227 Set to FALSE to leave this multicast group.
228 @param MacAddress The pointer to the multicast MAC group (address) to join or leave.
230 @retval EFI_SUCCESS The requested operation completed successfully.
231 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
233 - JoinFlag is TRUE and MacAddress is NULL.
234 - *MacAddress is not a valid multicast MAC address.
235 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
236 @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
237 @retval EFI_NOT_FOUND The supplied multicast group is not joined.
238 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
239 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
240 @retval Other The requested operation could not be completed.
245 (EFIAPI
*EFI_MANAGED_NETWORK_GROUPS
)(
246 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
248 IN EFI_MAC_ADDRESS
*MacAddress OPTIONAL
252 Places asynchronous outgoing data packets into the transmit queue.
254 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
255 @param Token The pointer to a token associated with the transmit data descriptor.
257 @retval EFI_SUCCESS The transmit completion token was cached.
258 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
259 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
260 @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.
261 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
263 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
264 @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.
269 (EFIAPI
*EFI_MANAGED_NETWORK_TRANSMIT
)(
270 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
271 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
275 Places an asynchronous receiving request into the receiving queue.
277 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
278 @param Token The pointer to a token associated with the receive data descriptor.
280 @retval EFI_SUCCESS The receive completion token was cached.
281 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
282 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
285 - Token.Event is NULL.
286 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
288 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
289 @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.
290 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
295 (EFIAPI
*EFI_MANAGED_NETWORK_RECEIVE
)(
296 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
297 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
301 Aborts an asynchronous transmit or receive request.
303 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
304 @param Token The pointer to a token that has been issued by
305 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
306 EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
307 NULL, all pending tokens are aborted.
309 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
310 was signaled. When Token is NULL, all pending requests were
311 aborted and their events were signaled.
312 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
313 @retval EFI_INVALID_PARAMETER This is NULL.
314 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
315 not found in the transmit or receive queue. It has either completed
316 or was not issued by Transmit() and Receive().
321 (EFIAPI
*EFI_MANAGED_NETWORK_CANCEL
)(
322 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
323 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token OPTIONAL
327 Polls for incoming data packets and processes outgoing data packets.
329 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
331 @retval EFI_SUCCESS Incoming or outgoing data was processed.
332 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
333 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
334 @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing
336 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
337 Consider increasing the polling rate.
342 (EFIAPI
*EFI_MANAGED_NETWORK_POLL
)(
343 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
347 /// The MNP is used by network applications (and drivers) to
348 /// perform raw (unformatted) asynchronous network packet I/O.
350 struct _EFI_MANAGED_NETWORK_PROTOCOL
{
351 EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData
;
352 EFI_MANAGED_NETWORK_CONFIGURE Configure
;
353 EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac
;
354 EFI_MANAGED_NETWORK_GROUPS Groups
;
355 EFI_MANAGED_NETWORK_TRANSMIT Transmit
;
356 EFI_MANAGED_NETWORK_RECEIVE Receive
;
357 EFI_MANAGED_NETWORK_CANCEL Cancel
;
358 EFI_MANAGED_NETWORK_POLL Poll
;
361 extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid
;
362 extern EFI_GUID gEfiManagedNetworkProtocolGuid
;