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