]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/ManagedNetwork.h
Grammatical and disclaimer changes (does not follow internal C coding stds.)
[mirror_edk2.git] / MdePkg / Include / Protocol / ManagedNetwork.h
... / ...
CommitLineData
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
5Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved<BR>\r
6This program and the accompanying materials are licensed and made available under \r
7the terms and conditions of the BSD License that accompanies this distribution. \r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php. \r
10 \r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 @par Revision Reference: \r
15 This Protocol is introduced in UEFI Specification 2.0\r
16\r
17**/\r
18\r
19#ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__\r
20#define __EFI_MANAGED_NETWORK_PROTOCOL_H__\r
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
31 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \\r
32 }\r
33\r
34typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r
35\r
36typedef struct {\r
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
41 UINT32 ReceivedQueueTimeoutValue;\r
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
46 UINT32 TransmitQueueTimeoutValue;\r
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
51 UINT16 ProtocolTypeFilter;\r
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
56 BOOLEAN EnableUnicastReceive;\r
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
61 BOOLEAN EnableMulticastReceive;\r
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
66 BOOLEAN EnableBroadcastReceive;\r
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
71 BOOLEAN EnablePromiscuousReceive;\r
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
76 BOOLEAN FlushQueuesOnReset;\r
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
82 BOOLEAN EnableReceiveTimestamps;\r
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
89 BOOLEAN DisableBackgroundPolling;\r
90} EFI_MANAGED_NETWORK_CONFIG_DATA;\r
91\r
92typedef 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
109typedef struct {\r
110 UINT32 FragmentLength;\r
111 VOID *FragmentBuffer;\r
112} EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r
113\r
114typedef 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
125typedef struct {\r
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
132 EFI_EVENT Event;\r
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
137 EFI_STATUS Status;\r
138 union {\r
139 ///\r
140 /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.\r
141 ///\r
142 EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;\r
143 ///\r
144 /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.\r
145 ///\r
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
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
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
165typedef\r
166EFI_STATUS\r
167(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(\r
168 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
169 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r
170 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r
171 );\r
172\r
173/**\r
174 Sets or clears the operational parameters for the MNP child driver.\r
175\r
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
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
192typedef\r
193EFI_STATUS\r
194(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(\r
195 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
196 IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL\r
197 );\r
198\r
199/**\r
200 Translates an IP multicast address to a hardware (MAC) multicast address.\r
201\r
202 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
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
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
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
220typedef\r
221EFI_STATUS\r
222(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(\r
223 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
224 IN BOOLEAN Ipv6Flag,\r
225 IN EFI_IP_ADDRESS *IpAddress,\r
226 OUT EFI_MAC_ADDRESS *MacAddress\r
227 );\r
228\r
229/**\r
230 Enables and disables receive filters for multicast address.\r
231\r
232 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
233 @param JoinFlag Set to TRUE to join this multicast group.\r
234 Set to FALSE to leave this multicast group.\r
235 @param MacAddress The pointer to the multicast MAC group (address) to join or leave.\r
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
245 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r
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
250typedef\r
251EFI_STATUS\r
252(EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(\r
253 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
254 IN BOOLEAN JoinFlag,\r
255 IN EFI_MAC_ADDRESS *MacAddress OPTIONAL\r
256 );\r
257\r
258/**\r
259 Places asynchronous outgoing data packets into the transmit queue.\r
260\r
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
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
274typedef\r
275EFI_STATUS\r
276(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(\r
277 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
278 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r
279 );\r
280\r
281/**\r
282 Places an asynchronous receiving request into the receiving queue.\r
283\r
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
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
292 - Token.Event is NULL.\r
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
300typedef\r
301EFI_STATUS\r
302(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(\r
303 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
304 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r
305 );\r
306\r
307\r
308/**\r
309 Aborts an asynchronous transmit or receive request.\r
310\r
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
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
327typedef\r
328EFI_STATUS\r
329(EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(\r
330 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
331 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL\r
332 );\r
333\r
334/**\r
335 Polls for incoming data packets and processes outgoing data packets.\r
336\r
337 @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
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
348typedef\r
349EFI_STATUS\r
350(EFIAPI *EFI_MANAGED_NETWORK_POLL)(\r
351 IN EFI_MANAGED_NETWORK_PROTOCOL *This\r
352 );\r
353\r
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
358struct _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
369extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r
370extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r
371\r
372#endif\r