iPXE
ManagedNetwork.h
Go to the documentation of this file.
1/** @file
2 EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
3 EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.
4
5Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.0
10
11**/
12
13#pragma once
14
15FILE_LICENCE ( BSD2_PATENT );
16FILE_SECBOOT ( PERMITTED );
17
19
20#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
21 { \
22 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \
23 }
24
25#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
26 { \
27 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \
28 }
29
31
32typedef struct {
33 ///
34 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
35 /// from the MNP receive queue will be dropped if its receive timeout expires.
36 ///
38 ///
39 /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed
40 /// from the MNP transmit queue will be dropped if its receive timeout expires.
41 ///
43 ///
44 /// Ethernet type II 16-bit protocol type in host byte order. Valid
45 /// values are zero and 1,500 to 65,535.
46 ///
48 ///
49 /// Set to TRUE to receive packets that are sent to the network
50 /// device MAC address. The startup default value is FALSE.
51 ///
53 ///
54 /// Set to TRUE to receive packets that are sent to any of the
55 /// active multicast groups. The startup default value is FALSE.
56 ///
58 ///
59 /// Set to TRUE to receive packets that are sent to the network
60 /// device broadcast address. The startup default value is FALSE.
61 ///
63 ///
64 /// Set to TRUE to receive packets that are sent to any MAC address.
65 /// The startup default value is FALSE.
66 ///
68 ///
69 /// Set to TRUE to drop queued packets when the configuration
70 /// is changed. The startup default value is FALSE.
71 ///
73 ///
74 /// Set to TRUE to timestamp all packets when they are received
75 /// by the MNP. Note that timestamps may be unsupported in some
76 /// MNP implementations. The startup default value is FALSE.
77 ///
79 ///
80 /// Set to TRUE to disable background polling in this MNP
81 /// instance. Note that background polling may not be supported in
82 /// all MNP implementations. The startup default value is FALSE,
83 /// unless background polling is not supported.
84 ///
87
104
109
119
120typedef struct {
121 ///
122 /// This Event will be signaled after the Status field is updated
123 /// by the MNP. The type of Event must be
124 /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of
125 /// Event must be lower than or equal to TPL_CALLBACK.
126 ///
128 ///
129 /// The status that is returned to the caller at the end of the operation
130 /// to indicate whether this operation completed successfully.
131 ///
133 union {
134 ///
135 /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
136 ///
138 ///
139 /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.
140 ///
142 } Packet;
144
145/**
146 Returns the operational parameters for the current MNP child driver.
147
148 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
149 @param MnpConfigData The pointer to storage for MNP operational parameters.
150 @param SnpModeData The pointer to storage for SNP operational parameters.
151
152 @retval EFI_SUCCESS The operation completed successfully.
153 @retval EFI_INVALID_PARAMETER This is NULL.
154 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
155 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default
156 values are returned in MnpConfigData if it is not NULL.
157 @retval Other The mode data could not be read.
158
159**/
160typedef
166 );
167
168/**
169 Sets or clears the operational parameters for the MNP child driver.
170
171 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
172 @param MnpConfigData The pointer to configuration data that will be assigned to the MNP
173 child driver instance. If NULL, the MNP child driver instance is
174 reset to startup defaults and all pending transmit and receive
175 requests are flushed.
176
177 @retval EFI_SUCCESS The operation completed successfully.
178 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
179 @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be
180 allocated.
181 @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]
182 implementation.
183 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
184 @retval Other The MNP child driver instance has been reset to startup defaults.
185
186**/
187typedef
192 );
193
194/**
195 Translates an IP multicast address to a hardware (MAC) multicast address.
196
197 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
198 @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
199 Set to FALSE if IpAddress is an IPv4 multicast address.
200 @param IpAddress The pointer to the multicast IP address (in network byte order) to convert.
201 @param MacAddress The pointer to the resulting multicast MAC address.
202
203 @retval EFI_SUCCESS The operation completed successfully.
204 @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
205 - This is NULL.
206 - IpAddress is NULL.
207 - *IpAddress is not a valid multicast IP address.
208 - MacAddress is NULL.
209 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
210 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
211 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
212 @retval Other The address could not be converted.
213
214**/
215typedef
219 IN BOOLEAN Ipv6Flag,
220 IN EFI_IP_ADDRESS *IpAddress,
221 OUT EFI_MAC_ADDRESS *MacAddress
222 );
223
224/**
225 Enables and disables receive filters for multicast address.
226
227 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
228 @param JoinFlag Set to TRUE to join this multicast group.
229 Set to FALSE to leave this multicast group.
230 @param MacAddress The pointer to the multicast MAC group (address) to join or leave.
231
232 @retval EFI_SUCCESS The requested operation completed successfully.
233 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
234 - This is NULL.
235 - JoinFlag is TRUE and MacAddress is NULL.
236 - *MacAddress is not a valid multicast MAC address.
237 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
238 @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
239 @retval EFI_NOT_FOUND The supplied multicast group is not joined.
240 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
241 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
242 @retval Other The requested operation could not be completed.
243
244**/
245typedef
249 IN BOOLEAN JoinFlag,
250 IN EFI_MAC_ADDRESS *MacAddress OPTIONAL
251 );
252
253/**
254 Places asynchronous outgoing data packets into the transmit queue.
255
256 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
257 @param Token The pointer to a token associated with the transmit data descriptor.
258
259 @retval EFI_SUCCESS The transmit completion token was cached.
260 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
261 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
262 @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.
263 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
264 (usually memory).
265 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
266 @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.
267
268**/
269typedef
274 );
275
276/**
277 Places an asynchronous receiving request into the receiving queue.
278
279 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
280 @param Token The pointer to a token associated with the receive data descriptor.
281
282 @retval EFI_SUCCESS The receive completion token was cached.
283 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
284 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
285 - This is NULL.
286 - Token is NULL.
287 - Token.Event is NULL.
288 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
289 (usually memory).
290 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
291 @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.
292 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
293
294**/
295typedef
300 );
301
302/**
303 Aborts an asynchronous transmit or receive request.
304
305 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
306 @param Token The pointer to a token that has been issued by
307 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
308 EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
309 NULL, all pending tokens are aborted.
310
311 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
312 was signaled. When Token is NULL, all pending requests were
313 aborted and their events were signaled.
314 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
315 @retval EFI_INVALID_PARAMETER This is NULL.
316 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
317 not found in the transmit or receive queue. It has either completed
318 or was not issued by Transmit() and Receive().
319
320**/
321typedef
326 );
327
328/**
329 Polls for incoming data packets and processes outgoing data packets.
330
331 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
332
333 @retval EFI_SUCCESS Incoming or outgoing data was processed.
334 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
335 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
336 @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing
337 the polling rate.
338 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
339 Consider increasing the polling rate.
340
341**/
342typedef
346 );
347
348///
349/// The MNP is used by network applications (and drivers) to
350/// perform raw (unformatted) asynchronous network packet I/O.
351///
362
unsigned short UINT16
2-byte unsigned value.
unsigned char BOOLEAN
Logical Boolean.
#define EFIAPI
unsigned int UINT32
4-byte unsigned value.
#define VOID
Undeclared type.
Definition Base.h:271
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition Base.h:292
EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_GROUPS)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_MAC_ADDRESS *MacAddress OPTIONAL)
Enables and disables receive filters for multicast address.
struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_TRANSMIT)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
Places asynchronous outgoing data packets into the transmit queue.
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_CANCEL)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL)
Aborts an asynchronous transmit or receive request.
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_RECEIVE)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
Places an asynchronous receiving request into the receiving queue.
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN Ipv6Flag, IN EFI_IP_ADDRESS *IpAddress, OUT EFI_MAC_ADDRESS *MacAddress)
Translates an IP multicast address to a hardware (MAC) multicast address.
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_CONFIGURE)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL)
Sets or clears the operational parameters for the MNP child driver.
EFI_GUID gEfiManagedNetworkProtocolGuid
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_GET_MODE_DATA)(IN EFI_MANAGED_NETWORK_PROTOCOL *This, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
Returns the operational parameters for the current MNP child driver.
EFI_STATUS(EFIAPI * EFI_MANAGED_NETWORK_POLL)(IN EFI_MANAGED_NETWORK_PROTOCOL *This)
Polls for incoming data packets and processes outgoing data packets.
The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface,...
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define EFI_EVENT
Definition efi.h:54
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
32-byte buffer containing a network Media Access Control address.
EFI_MANAGED_NETWORK_RECEIVE_DATA * RxData
When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.
EFI_MANAGED_NETWORK_TRANSMIT_DATA * TxData
When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DAT...
EFI_STATUS Status
The status that is returned to the caller at the end of the operation to indicate whether this operat...
EFI_EVENT Event
This Event will be signaled after the Status field is updated by the MNP.
BOOLEAN EnableBroadcastReceive
Set to TRUE to receive packets that are sent to the network device broadcast address.
BOOLEAN EnableMulticastReceive
Set to TRUE to receive packets that are sent to any of the active multicast groups.
BOOLEAN FlushQueuesOnReset
Set to TRUE to drop queued packets when the configuration is changed.
UINT32 ReceivedQueueTimeoutValue
Timeout value for a UEFI one-shot timer event.
UINT16 ProtocolTypeFilter
Ethernet type II 16-bit protocol type in host byte order.
UINT32 TransmitQueueTimeoutValue
Timeout value for a UEFI one-shot timer event.
BOOLEAN DisableBackgroundPolling
Set to TRUE to disable background polling in this MNP instance.
BOOLEAN EnableUnicastReceive
Set to TRUE to receive packets that are sent to the network device MAC address.
BOOLEAN EnablePromiscuousReceive
Set to TRUE to receive packets that are sent to any MAC address.
BOOLEAN EnableReceiveTimestamps
Set to TRUE to timestamp all packets when they are received by the MNP.
EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1]
EFI Time Abstraction: Year: 1900 - 9999 Month: 1 - 12 Day: 1 - 31 Hour: 0 - 23 Minute: 0 - 59 Second:...
The MNP is used by network applications (and drivers) to perform raw (unformatted) asynchronous netwo...
EFI_MANAGED_NETWORK_POLL Poll
EFI_MANAGED_NETWORK_GROUPS Groups
EFI_MANAGED_NETWORK_CANCEL Cancel
EFI_MANAGED_NETWORK_RECEIVE Receive
EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac
EFI_MANAGED_NETWORK_CONFIGURE Configure
EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData
EFI_MANAGED_NETWORK_TRANSMIT Transmit
16-byte buffer aligned on a 4-byte boundary.