]>
Commit | Line | Data |
---|---|---|
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 | |
1a09f6f6 | 5 | Copyright (c) 2006 - 2008, Intel Corporation\r |
f6203b71 | 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 | |
19bee90c LG |
16 | #ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__\r |
17 | #define __EFI_MANAGED_NETWORK_PROTOCOL_H__\r | |
d1f95000 | 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 | |
31 | typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r | |
32 | \r | |
33 | typedef struct {\r | |
992f22b9 LG |
34 | ///\r |
35 | /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed\r | |
36 | /// from the MNP receive queue will be dropped if its receive timeout expires.\r | |
37 | ///\r | |
d1f95000 | 38 | UINT32 ReceivedQueueTimeoutValue;\r |
992f22b9 LG |
39 | ///\r |
40 | /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed\r | |
41 | /// from the MNP transmit queue will be dropped if its receive timeout expires.\r | |
42 | ///\r | |
d1f95000 | 43 | UINT32 TransmitQueueTimeoutValue;\r |
992f22b9 LG |
44 | ///\r |
45 | /// Ethernet type II 16-bit protocol type in host byte order. Valid\r | |
46 | /// values are zero and 1,500 to 65,535.\r | |
47 | ///\r | |
d1f95000 | 48 | UINT16 ProtocolTypeFilter;\r |
992f22b9 LG |
49 | ///\r |
50 | /// Set to TRUE to receive packets that are sent to the network\r | |
51 | /// device MAC address. The startup default value is FALSE.\r | |
52 | ///\r | |
d1f95000 | 53 | BOOLEAN EnableUnicastReceive;\r |
992f22b9 LG |
54 | ///\r |
55 | /// Set to TRUE to receive packets that are sent to any of the\r | |
56 | /// active multicast groups. The startup default value is FALSE.\r | |
57 | ///\r | |
d1f95000 | 58 | BOOLEAN EnableMulticastReceive;\r |
992f22b9 LG |
59 | ///\r |
60 | /// Set to TRUE to receive packets that are sent to the network\r | |
61 | /// device broadcast address. The startup default value is FALSE.\r | |
62 | ///\r | |
d1f95000 | 63 | BOOLEAN EnableBroadcastReceive;\r |
992f22b9 LG |
64 | ///\r |
65 | /// Set to TRUE to receive packets that are sent to any MAC address.\r | |
66 | /// The startup default value is FALSE.\r | |
67 | ///\r | |
d1f95000 | 68 | BOOLEAN EnablePromiscuousReceive;\r |
992f22b9 LG |
69 | ///\r |
70 | /// Set to TRUE to drop queued packets when the configuration\r | |
71 | /// is changed. The startup default value is FALSE.\r | |
72 | ///\r | |
d1f95000 | 73 | BOOLEAN FlushQueuesOnReset;\r |
992f22b9 LG |
74 | ///\r |
75 | /// Set to TRUE to timestamp all packets when they are received\r | |
76 | /// by the MNP. Note that timestamps may be unsupported in some\r | |
77 | /// MNP implementations. The startup default value is FALSE.\r | |
78 | ///\r | |
d1f95000 | 79 | BOOLEAN EnableReceiveTimestamps;\r |
992f22b9 LG |
80 | ///\r |
81 | /// Set to TRUE to disable background polling in this MNP\r | |
82 | /// instance. Note that background polling may not be supported in\r | |
83 | /// all MNP implementations. The startup default value is FALSE,\r | |
84 | /// unless background polling is not supported.\r | |
85 | ///\r | |
d1f95000 | 86 | BOOLEAN DisableBackgroundPolling;\r |
87 | } EFI_MANAGED_NETWORK_CONFIG_DATA;\r | |
88 | \r | |
89 | typedef struct {\r | |
90 | EFI_TIME Timestamp;\r | |
91 | EFI_EVENT RecycleEvent;\r | |
92 | UINT32 PacketLength;\r | |
93 | UINT32 HeaderLength;\r | |
94 | UINT32 AddressLength;\r | |
95 | UINT32 DataLength;\r | |
96 | BOOLEAN BroadcastFlag;\r | |
97 | BOOLEAN MulticastFlag;\r | |
98 | BOOLEAN PromiscuousFlag;\r | |
99 | UINT16 ProtocolType;\r | |
100 | VOID *DestinationAddress;\r | |
101 | VOID *SourceAddress;\r | |
102 | VOID *MediaHeader;\r | |
103 | VOID *PacketData;\r | |
104 | } EFI_MANAGED_NETWORK_RECEIVE_DATA;\r | |
105 | \r | |
106 | typedef struct {\r | |
107 | UINT32 FragmentLength;\r | |
108 | VOID *FragmentBuffer;\r | |
109 | } EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r | |
110 | \r | |
111 | typedef struct {\r | |
112 | EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL\r | |
113 | EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL\r | |
114 | UINT16 ProtocolType; //OPTIONAL\r | |
115 | UINT32 DataLength;\r | |
116 | UINT16 HeaderLength; //OPTIONAL\r | |
117 | UINT16 FragmentCount;\r | |
118 | EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];\r | |
119 | } EFI_MANAGED_NETWORK_TRANSMIT_DATA;\r | |
120 | \r | |
121 | \r | |
122 | typedef struct {\r | |
992f22b9 LG |
123 | ///\r |
124 | /// This Event will be signaled after the Status field is updated\r | |
125 | /// by the MNP. The type of Event must be\r | |
126 | /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of\r | |
127 | /// Event must be lower than or equal to TPL_CALLBACK.\r | |
128 | ///\r | |
d1f95000 | 129 | EFI_EVENT Event;\r |
992f22b9 LG |
130 | ///\r |
131 | /// The status that is returned to the caller at the end of the operation\r | |
132 | /// to indicate whether this operation completed successfully.\r | |
133 | ///\r | |
d1f95000 | 134 | EFI_STATUS Status;\r |
135 | union {\r | |
992f22b9 LG |
136 | ///\r |
137 | /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA.\r | |
138 | ///\r | |
d1f95000 | 139 | EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;\r |
992f22b9 LG |
140 | ///\r |
141 | /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA.\r | |
142 | ///\r | |
d1f95000 | 143 | EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;\r |
144 | } Packet;\r | |
145 | } EFI_MANAGED_NETWORK_COMPLETION_TOKEN;\r | |
146 | \r | |
147 | /**\r | |
148 | Returns the operational parameters for the current MNP child driver.\r | |
149 | \r | |
150 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
151 | @param MnpConfigData Pointer to storage for MNP operational parameters.\r | |
152 | @param SnpModeData Pointer to storage for SNP operational parameters.\r | |
153 | \r | |
154 | @retval EFI_SUCCESS The operation completed successfully.\r | |
155 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
156 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
157 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default\r | |
158 | values are returned in MnpConfigData if it is not NULL.\r | |
159 | @retval Other The mode data could not be read.\r | |
160 | \r | |
161 | **/\r | |
162 | typedef\r | |
163 | EFI_STATUS\r | |
8b13229b | 164 | (EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)(\r |
d1f95000 | 165 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
166 | OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,\r | |
f6203b71 | 167 | OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL\r |
ed66e1bc | 168 | );\r |
d1f95000 | 169 | \r |
170 | /**\r | |
171 | Sets or clears the operational parameters for the MNP child driver.\r | |
172 | \r | |
173 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
174 | @param MnpConfigData Pointer to configuration data that will be assigned to the MNP\r | |
175 | child driver instance. If NULL, the MNP child driver instance is\r | |
176 | reset to startup defaults and all pending transmit and receive\r | |
177 | requests are flushed.\r | |
178 | \r | |
179 | @retval EFI_SUCCESS The operation completed successfully.\r | |
180 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
181 | @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be\r | |
182 | allocated.\r | |
183 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]\r | |
184 | implementation.\r | |
185 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
186 | @retval Other The MNP child driver instance has been reset to startup defaults.\r | |
187 | \r | |
188 | **/\r | |
189 | typedef\r | |
190 | EFI_STATUS\r | |
8b13229b | 191 | (EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)(\r |
d1f95000 | 192 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 193 | IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL\r |
ed66e1bc | 194 | );\r |
f6203b71 | 195 | \r |
d1f95000 | 196 | /**\r |
197 | Translates an IP multicast address to a hardware (MAC) multicast address.\r | |
198 | \r | |
199 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
200 | @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.\r | |
201 | Set to FALSE if IpAddress is an IPv4 multicast address.\r | |
202 | @param IpAddress Pointer to the multicast IP address (in network byte order) to convert.\r | |
203 | @param MacAddress Pointer to the resulting multicast MAC address.\r | |
204 | \r | |
205 | @retval EFI_SUCCESS The operation completed successfully.\r | |
206 | @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:\r | |
207 | - This is NULL.\r | |
208 | - IpAddress is NULL.\r | |
209 | - *IpAddress is not a valid multicast IP address.\r | |
210 | - MacAddress is NULL.\r | |
211 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
212 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r | |
213 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r | |
214 | @retval Other The address could not be converted.\r | |
215 | \r | |
216 | **/\r | |
217 | typedef\r | |
218 | EFI_STATUS\r | |
8b13229b | 219 | (EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)(\r |
d1f95000 | 220 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
221 | IN BOOLEAN Ipv6Flag,\r | |
222 | IN EFI_IP_ADDRESS *IpAddress,\r | |
f6203b71 | 223 | OUT EFI_MAC_ADDRESS *MacAddress\r |
ed66e1bc | 224 | );\r |
d1f95000 | 225 | \r |
226 | /**\r | |
227 | Enables and disables receive filters for multicast address.\r | |
228 | \r | |
229 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
230 | @param JoinFlag Set to TRUE to join this multicast group.\r | |
231 | Set to FALSE to leave this multicast group.\r | |
232 | @param MacAddress Pointer to the multicast MAC group (address) to join or leave.\r | |
233 | \r | |
234 | @retval EFI_SUCCESS The requested operation completed successfully.\r | |
235 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
236 | - This is NULL.\r | |
237 | - JoinFlag is TRUE and MacAddress is NULL.\r | |
238 | - *MacAddress is not a valid multicast MAC address.\r | |
239 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
240 | @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.\r | |
241 | @retval EFI_NOT_FOUND The supplied multicast group is not joined.\r | |
f6203b71 | 242 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.\r |
d1f95000 | 243 | @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.\r |
244 | @retval Other The requested operation could not be completed.\r | |
245 | \r | |
246 | **/\r | |
247 | typedef\r | |
248 | EFI_STATUS\r | |
8b13229b | 249 | (EFIAPI *EFI_MANAGED_NETWORK_GROUPS)(\r |
d1f95000 | 250 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
251 | IN BOOLEAN JoinFlag,\r | |
f6203b71 | 252 | IN EFI_MAC_ADDRESS *MacAddress OPTIONAL\r |
ed66e1bc | 253 | );\r |
f6203b71 | 254 | \r |
d1f95000 | 255 | /**\r |
256 | Places asynchronous outgoing data packets into the transmit queue.\r | |
257 | \r | |
258 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
259 | @param Token Pointer to a token associated with the transmit data descriptor.\r | |
260 | \r | |
261 | @retval EFI_SUCCESS The transmit completion token was cached.\r | |
262 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
263 | @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r | |
264 | @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.\r | |
265 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r | |
266 | (usually memory).\r | |
267 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
268 | @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.\r | |
269 | \r | |
270 | **/\r | |
271 | typedef\r | |
272 | EFI_STATUS\r | |
8b13229b | 273 | (EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)(\r |
d1f95000 | 274 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 275 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 276 | );\r |
f6203b71 | 277 | \r |
d1f95000 | 278 | /**\r |
279 | Places an asynchronous receiving request into the receiving queue.\r | |
280 | \r | |
281 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
282 | @param Token Pointer to a token associated with the receive data descriptor.\r | |
283 | \r | |
284 | @retval EFI_SUCCESS The receive completion token was cached.\r | |
285 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
286 | @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r | |
287 | - This is NULL.\r | |
288 | - Token is NULL.\r | |
289 | - Token.Event is NULL\r | |
290 | @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources\r | |
291 | (usually memory).\r | |
292 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
293 | @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.\r | |
294 | @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.\r | |
295 | \r | |
296 | **/\r | |
297 | typedef\r | |
298 | EFI_STATUS\r | |
8b13229b | 299 | (EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)(\r |
d1f95000 | 300 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 301 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token\r |
ed66e1bc | 302 | );\r |
f6203b71 | 303 | \r |
d1f95000 | 304 | \r |
305 | /**\r | |
306 | Aborts an asynchronous transmit or receive request.\r | |
307 | \r | |
308 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
309 | @param Token Pointer to a token that has been issued by\r | |
310 | EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or\r | |
311 | EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If\r | |
312 | NULL, all pending tokens are aborted.\r | |
313 | \r | |
314 | @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event\r | |
315 | was signaled. When Token is NULL, all pending requests were\r | |
316 | aborted and their events were signaled.\r | |
317 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
318 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
319 | @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was\r | |
320 | not found in the transmit or receive queue. It has either completed\r | |
321 | or was not issued by Transmit() and Receive().\r | |
322 | \r | |
323 | **/\r | |
324 | typedef\r | |
325 | EFI_STATUS\r | |
8b13229b | 326 | (EFIAPI *EFI_MANAGED_NETWORK_CANCEL)(\r |
d1f95000 | 327 | IN EFI_MANAGED_NETWORK_PROTOCOL *This,\r |
f6203b71 | 328 | IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL\r |
ed66e1bc | 329 | );\r |
d1f95000 | 330 | \r |
331 | /**\r | |
332 | Polls for incoming data packets and processes outgoing data packets.\r | |
333 | \r | |
334 | @param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r | |
335 | \r | |
336 | @retval EFI_SUCCESS Incoming or outgoing data was processed.\r | |
337 | @retval EFI_NOT_STARTED This MNP child driver instance has not been configured.\r | |
338 | @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r | |
339 | @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing\r | |
340 | the polling rate.\r | |
341 | @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.\r | |
342 | Consider increasing the polling rate.\r | |
343 | \r | |
344 | **/\r | |
345 | typedef\r | |
346 | EFI_STATUS\r | |
8b13229b | 347 | (EFIAPI *EFI_MANAGED_NETWORK_POLL)(\r |
f6203b71 | 348 | IN EFI_MANAGED_NETWORK_PROTOCOL *This\r |
ed66e1bc | 349 | );\r |
d1f95000 | 350 | \r |
44717a39 | 351 | ///\r |
352 | /// The MNP is used by network applications (and drivers) to \r | |
353 | /// perform raw (unformatted) asynchronous network packet I/O.\r | |
354 | ///\r | |
d1f95000 | 355 | struct _EFI_MANAGED_NETWORK_PROTOCOL {\r |
356 | EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;\r | |
357 | EFI_MANAGED_NETWORK_CONFIGURE Configure;\r | |
358 | EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;\r | |
359 | EFI_MANAGED_NETWORK_GROUPS Groups;\r | |
360 | EFI_MANAGED_NETWORK_TRANSMIT Transmit;\r | |
361 | EFI_MANAGED_NETWORK_RECEIVE Receive;\r | |
362 | EFI_MANAGED_NETWORK_CANCEL Cancel;\r | |
363 | EFI_MANAGED_NETWORK_POLL Poll;\r | |
364 | };\r | |
365 | \r | |
366 | extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r | |
367 | extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r | |
368 | \r | |
369 | #endif\r |