]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/ManagedNetwork.h
Updated EFI_MANAGED_NETWORK_PROTOCOL_GUID value according to UEFI 2.1b.
[mirror_edk2.git] / MdePkg / Include / Protocol / ManagedNetwork.h
CommitLineData
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
f6203b71 5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
d1f95000 10\r
f6203b71 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
d1f95000 14**/\r
15\r
16#ifndef _EFI_MANAGED_NETWORK_PROTOCOL_H\r
17#define _EFI_MANAGED_NETWORK_PROTOCOL_H\r
18\r
19#include <Protocol/SimpleNetwork.h>\r
20\r
21#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \\r
22 { \\r
23 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \\r
24 }\r
25\r
26#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \\r
27 { \\r
f6203b71 28 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \\r
d1f95000 29 }\r
30\r
31typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r
32\r
33typedef struct {\r
34 UINT32 ReceivedQueueTimeoutValue;\r
35 UINT32 TransmitQueueTimeoutValue;\r
36 UINT16 ProtocolTypeFilter;\r
37 BOOLEAN EnableUnicastReceive;\r
38 BOOLEAN EnableMulticastReceive;\r
39 BOOLEAN EnableBroadcastReceive;\r
40 BOOLEAN EnablePromiscuousReceive;\r
41 BOOLEAN FlushQueuesOnReset;\r
42 BOOLEAN EnableReceiveTimestamps;\r
43 BOOLEAN DisableBackgroundPolling;\r
44} EFI_MANAGED_NETWORK_CONFIG_DATA;\r
45\r
46typedef struct {\r
47 EFI_TIME Timestamp;\r
48 EFI_EVENT RecycleEvent;\r
49 UINT32 PacketLength;\r
50 UINT32 HeaderLength;\r
51 UINT32 AddressLength;\r
52 UINT32 DataLength;\r
53 BOOLEAN BroadcastFlag;\r
54 BOOLEAN MulticastFlag;\r
55 BOOLEAN PromiscuousFlag;\r
56 UINT16 ProtocolType;\r
57 VOID *DestinationAddress;\r
58 VOID *SourceAddress;\r
59 VOID *MediaHeader;\r
60 VOID *PacketData;\r
61} EFI_MANAGED_NETWORK_RECEIVE_DATA;\r
62\r
63typedef struct {\r
64 UINT32 FragmentLength;\r
65 VOID *FragmentBuffer;\r
66} EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r
67\r
68typedef struct {\r
69 EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL\r
70 EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL\r
71 UINT16 ProtocolType; //OPTIONAL\r
72 UINT32 DataLength;\r
73 UINT16 HeaderLength; //OPTIONAL\r
74 UINT16 FragmentCount;\r
75 EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];\r
76} EFI_MANAGED_NETWORK_TRANSMIT_DATA;\r
77\r
78\r
79typedef struct {\r
80 EFI_EVENT Event;\r
81 EFI_STATUS Status;\r
82 union {\r
83 EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;\r
84 EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;\r
85 } Packet;\r
86} EFI_MANAGED_NETWORK_COMPLETION_TOKEN;\r
87\r
88/**\r
89 Returns the operational parameters for the current MNP child driver.\r
90\r
91 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
92 @param MnpConfigData Pointer to storage for MNP operational parameters.\r
93 @param SnpModeData Pointer to storage for SNP operational parameters.\r
94\r
95 @retval EFI_SUCCESS The operation completed successfully.\r
96 @retval EFI_INVALID_PARAMETER This is NULL.\r
97 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r
98 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default\r
99 values are returned in MnpConfigData if it is not NULL.\r
100 @retval Other The mode data could not be read.\r
101\r
102**/\r
103typedef\r
104EFI_STATUS\r
105(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA) (\r
106 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
107 OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r
f6203b71 108 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r
d1f95000 109 )\r
f6203b71 110;\r
d1f95000 111\r
112/**\r
113 Sets or clears the operational parameters for the MNP child driver.\r
114\r
115 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
116 @param MnpConfigData Pointer to configuration data that will be assigned to the MNP\r
117 child driver instance. If NULL, the MNP child driver instance is\r
118 reset to startup defaults and all pending transmit and receive\r
119 requests are flushed.\r
120\r
121 @retval EFI_SUCCESS The operation completed successfully.\r
122 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
123 @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be\r
124 allocated.\r
125 @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]\r
126 implementation.\r
127 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r
128 @retval Other The MNP child driver instance has been reset to startup defaults.\r
129\r
130**/\r
131typedef\r
132EFI_STATUS\r
133(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE) (\r
134 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
f6203b71 135 IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL\r
d1f95000 136 )\r
f6203b71 137;\r
138\r
d1f95000 139/**\r
140 Translates an IP multicast address to a hardware (MAC) multicast address.\r
141\r
142 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
143 @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.\r
144 Set to FALSE if IpAddress is an IPv4 multicast address.\r
145 @param IpAddress Pointer to the multicast IP address (in network byte order) to convert.\r
146 @param MacAddress Pointer to the resulting multicast MAC address.\r
147\r
148 @retval EFI_SUCCESS The operation completed successfully.\r
149 @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:\r
150 - This is NULL.\r
151 - IpAddress is NULL.\r
152 - *IpAddress is not a valid multicast IP address.\r
153 - MacAddress is NULL.\r
154 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
155 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r
156 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r
157 @retval Other The address could not be converted.\r
158\r
159**/\r
160typedef\r
161EFI_STATUS\r
162(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC) (\r
163 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
164 IN BOOLEAN Ipv6Flag,\r
165 IN EFI_IP_ADDRESS *IpAddress,\r
f6203b71 166 OUT EFI_MAC_ADDRESS *MacAddress\r
d1f95000 167 )\r
f6203b71 168;\r
d1f95000 169\r
170/**\r
171 Enables and disables receive filters for multicast address.\r
172\r
173 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
174 @param JoinFlag Set to TRUE to join this multicast group.\r
175 Set to FALSE to leave this multicast group.\r
176 @param MacAddress Pointer to the multicast MAC group (address) to join or leave.\r
177\r
178 @retval EFI_SUCCESS The requested operation completed successfully.\r
179 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
180 - This is NULL.\r
181 - JoinFlag is TRUE and MacAddress is NULL.\r
182 - *MacAddress is not a valid multicast MAC address.\r
183 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
184 @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.\r
185 @retval EFI_NOT_FOUND The supplied multicast group is not joined.\r
f6203b71 186 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r
d1f95000 187 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r
188 @retval Other The requested operation could not be completed.\r
189\r
190**/\r
191typedef\r
192EFI_STATUS\r
193(EFIAPI *EFI_MANAGED_NETWORK_GROUPS) (\r
194 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
195 IN BOOLEAN JoinFlag,\r
f6203b71 196 IN EFI_MAC_ADDRESS *MacAddress OPTIONAL\r
d1f95000 197 )\r
f6203b71 198;\r
199\r
d1f95000 200/**\r
201 Places asynchronous outgoing data packets into the transmit queue.\r
202\r
203 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
204 @param Token Pointer to a token associated with the transmit data descriptor.\r
205\r
206 @retval EFI_SUCCESS The transmit completion token was cached.\r
207 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
208 @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
209 @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.\r
210 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r
211 (usually memory).\r
212 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
213 @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.\r
214\r
215**/\r
216typedef\r
217EFI_STATUS\r
218(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT) (\r
219 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
f6203b71 220 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r
d1f95000 221 )\r
f6203b71 222;\r
223\r
d1f95000 224/**\r
225 Places an asynchronous receiving request into the receiving queue.\r
226\r
227 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
228 @param Token Pointer to a token associated with the receive data descriptor.\r
229\r
230 @retval EFI_SUCCESS The receive completion token was cached.\r
231 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
232 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
233 - This is NULL.\r
234 - Token is NULL.\r
235 - Token.Event is NULL\r
236 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r
237 (usually memory).\r
238 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
239 @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.\r
240 @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r
241\r
242**/\r
243typedef\r
244EFI_STATUS\r
245(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE) (\r
246 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
f6203b71 247 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r
d1f95000 248 )\r
f6203b71 249;\r
250\r
d1f95000 251\r
252/**\r
253 Aborts an asynchronous transmit or receive request.\r
254\r
255 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
256 @param Token Pointer to a token that has been issued by\r
257 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or\r
258 EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If\r
259 NULL, all pending tokens are aborted.\r
260\r
261 @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event\r
262 was signaled. When Token is NULL, all pending requests were\r
263 aborted and their events were signaled.\r
264 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
265 @retval EFI_INVALID_PARAMETER This is NULL.\r
266 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was\r
267 not found in the transmit or receive queue. It has either completed\r
268 or was not issued by Transmit() and Receive().\r
269\r
270**/\r
271typedef\r
272EFI_STATUS\r
273(EFIAPI *EFI_MANAGED_NETWORK_CANCEL) (\r
274 IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r
f6203b71 275 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL\r
d1f95000 276 )\r
f6203b71 277;\r
d1f95000 278\r
279/**\r
280 Polls for incoming data packets and processes outgoing data packets.\r
281\r
282 @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
283\r
284 @retval EFI_SUCCESS Incoming or outgoing data was processed.\r
285 @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r
286 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
287 @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing\r
288 the polling rate.\r
289 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r
290 Consider increasing the polling rate.\r
291\r
292**/\r
293typedef\r
294EFI_STATUS\r
295(EFIAPI *EFI_MANAGED_NETWORK_POLL) (\r
f6203b71 296 IN EFI_MANAGED_NETWORK_PROTOCOL *This\r
d1f95000 297 )\r
f6203b71 298;\r
d1f95000 299\r
300struct _EFI_MANAGED_NETWORK_PROTOCOL {\r
301 EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;\r
302 EFI_MANAGED_NETWORK_CONFIGURE Configure;\r
303 EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;\r
304 EFI_MANAGED_NETWORK_GROUPS Groups;\r
305 EFI_MANAGED_NETWORK_TRANSMIT Transmit;\r
306 EFI_MANAGED_NETWORK_RECEIVE Receive;\r
307 EFI_MANAGED_NETWORK_CANCEL Cancel;\r
308 EFI_MANAGED_NETWORK_POLL Poll;\r
309};\r
310\r
311extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r
312extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r
313\r
314#endif\r