]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SimpleNetwork.h
Import Pal.h and Sal.h.
[mirror_edk2.git] / MdePkg / Include / Protocol / SimpleNetwork.h
CommitLineData
d1f95000 1/** @file\r
2 Simple Network protocol as defined in the EFI 1.0 specification.\r
3\r
4 Basic network device abstraction.\r
5\r
6 Rx - Received\r
7 Tx - Transmit\r
8 MCast - MultiCast\r
9 ...\r
10\r
11 Copyright (c) 2006, Intel Corporation \r
12 All rights reserved. This program and the accompanying materials \r
13 are licensed and made available under the terms and conditions of the BSD License \r
14 which accompanies this distribution. The full text of the license may be found at \r
15 http://opensource.org/licenses/bsd-license.php \r
16\r
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
19\r
20 Module Name: SimpleNetwork.h\r
21\r
22**/\r
23\r
24#ifndef __SIMPLE_NETWORK_H__\r
25#define __SIMPLE_NETWORK_H__\r
26\r
27#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \\r
28 { \\r
29 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \\r
30 }\r
31\r
32typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL;\r
33\r
a6508c05 34\r
35//\r
36// Protocol defined in EFI1.1.\r
37// \r
38typedef EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK;\r
39\r
d1f95000 40//\r
41// Simple Network Protocol data structures\r
42//\r
43typedef struct {\r
44 //\r
45 // Total number of frames received. Includes frames with errors and\r
46 // dropped frames.\r
47 //\r
48 UINT64 RxTotalFrames;\r
49\r
50 //\r
51 // Number of valid frames received and copied into receive buffers.\r
52 //\r
53 UINT64 RxGoodFrames;\r
54\r
55 //\r
56 // Number of frames below the minimum length for the media.\r
57 // This would be <64 for ethernet.\r
58 //\r
59 UINT64 RxUndersizeFrames;\r
60\r
61 //\r
62 // Number of frames longer than the maxminum length for the\r
63 // media. This would be >1500 for ethernet.\r
64 //\r
65 UINT64 RxOversizeFrames;\r
66\r
67 //\r
68 // Valid frames that were dropped because receive buffers were full.\r
69 //\r
70 UINT64 RxDroppedFrames;\r
71\r
72 //\r
73 // Number of valid unicast frames received and not dropped.\r
74 //\r
75 UINT64 RxUnicastFrames;\r
76\r
77 //\r
78 // Number of valid broadcast frames received and not dropped.\r
79 //\r
80 UINT64 RxBroadcastFrames;\r
81\r
82 //\r
83 // Number of valid mutlicast frames received and not dropped.\r
84 //\r
85 UINT64 RxMulticastFrames;\r
86\r
87 //\r
88 // Number of frames w/ CRC or alignment errors.\r
89 //\r
90 UINT64 RxCrcErrorFrames;\r
91\r
92 //\r
93 // Total number of bytes received. Includes frames with errors\r
94 // and dropped frames.\r
95 //\r
96 UINT64 RxTotalBytes;\r
97\r
98 //\r
99 // Transmit statistics.\r
100 //\r
101 UINT64 TxTotalFrames;\r
102 UINT64 TxGoodFrames;\r
103 UINT64 TxUndersizeFrames;\r
104 UINT64 TxOversizeFrames;\r
105 UINT64 TxDroppedFrames;\r
106 UINT64 TxUnicastFrames;\r
107 UINT64 TxBroadcastFrames;\r
108 UINT64 TxMulticastFrames;\r
109 UINT64 TxCrcErrorFrames;\r
110 UINT64 TxTotalBytes;\r
111\r
112 //\r
113 // Number of collisions detection on this subnet.\r
114 //\r
115 UINT64 Collisions;\r
116\r
117 //\r
118 // Number of frames destined for unsupported protocol.\r
119 //\r
120 UINT64 UnsupportedProtocol;\r
121\r
122} EFI_NETWORK_STATISTICS;\r
123\r
124typedef enum {\r
125 EfiSimpleNetworkStopped,\r
126 EfiSimpleNetworkStarted,\r
127 EfiSimpleNetworkInitialized,\r
128 EfiSimpleNetworkMaxState\r
129} EFI_SIMPLE_NETWORK_STATE;\r
130\r
131#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01\r
132#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02\r
133#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04\r
134#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08\r
135#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10\r
136\r
137#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01\r
138#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02\r
139#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04\r
140#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08\r
141\r
142#define MAX_MCAST_FILTER_CNT 16\r
143typedef struct {\r
144 UINT32 State;\r
145 UINT32 HwAddressSize;\r
146 UINT32 MediaHeaderSize;\r
147 UINT32 MaxPacketSize;\r
148 UINT32 NvRamSize;\r
149 UINT32 NvRamAccessSize;\r
150 UINT32 ReceiveFilterMask;\r
151 UINT32 ReceiveFilterSetting;\r
152 UINT32 MaxMCastFilterCount;\r
153 UINT32 MCastFilterCount;\r
154 EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];\r
155 EFI_MAC_ADDRESS CurrentAddress;\r
156 EFI_MAC_ADDRESS BroadcastAddress;\r
157 EFI_MAC_ADDRESS PermanentAddress;\r
158 UINT8 IfType;\r
159 BOOLEAN MacAddressChangeable;\r
160 BOOLEAN MultipleTxSupported;\r
161 BOOLEAN MediaPresentSupported;\r
162 BOOLEAN MediaPresent;\r
163} EFI_SIMPLE_NETWORK_MODE;\r
164\r
165//\r
166// Protocol Member Functions\r
167//\r
168/**\r
169 Changes the state of a network interface from "stopped" to "started".\r
170\r
171 @param This Protocol instance pointer.\r
172\r
173 @retval EFI_SUCCESS The network interface was started.\r
174 @retval EFI_ALREADY_STARTED The network interface is already in the started state.\r
175 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
176 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
177 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
178\r
179**/\r
180typedef\r
181EFI_STATUS\r
182(EFIAPI *EFI_SIMPLE_NETWORK_START) (\r
183 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
184 )\r
185;\r
186\r
187/**\r
188 Changes the state of a network interface from "started" to "stopped".\r
189\r
190 @param This Protocol instance pointer.\r
191\r
192 @retval EFI_SUCCESS The network interface was stopped.\r
193 @retval EFI_ALREADY_STARTED The network interface is already in the stopped state.\r
194 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
195 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
196 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
197\r
198**/\r
199typedef\r
200EFI_STATUS\r
201(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (\r
202 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
203 )\r
204;\r
205\r
206/**\r
207 Resets a network adapter and allocates the transmit and receive buffers \r
208 required by the network interface; optionally, also requests allocation \r
209 of additional transmit and receive buffers.\r
210\r
211 @param This Protocol instance pointer.\r
212 @param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
213 that the driver should allocate for the network interface.\r
214 Some network interfaces will not be able to use the extra\r
215 buffer, and the caller will not know if it is actually\r
216 being used.\r
217 @param ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
218 that the driver should allocate for the network interface.\r
219 Some network interfaces will not be able to use the extra\r
220 buffer, and the caller will not know if it is actually\r
221 being used.\r
222\r
223 @retval EFI_SUCCESS The network interface was initialized.\r
224 @retval EFI_NOT_STARTED The network interface has not been started\r
225 @retval EFI_OUT_OF_RESOURCES There was not enough memory for the transmit and\r
226 receive buffers. .\r
227 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
228 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
229 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
230\r
231**/\r
232typedef\r
233EFI_STATUS\r
234(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (\r
235 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
236 IN UINTN ExtraRxBufferSize OPTIONAL,\r
237 IN UINTN ExtraTxBufferSize OPTIONAL\r
238 )\r
239;\r
240\r
241/**\r
242 Resets a network adapter and re-initializes it with the parameters that were \r
243 provided in the previous call to Initialize(). \r
244\r
245 @param This Protocol instance pointer.\r
246 @param ExtendedVerification Indicates that the driver may perform a more\r
247 exhaustive verification operation of the device\r
248 during reset.\r
249\r
250 @retval EFI_SUCCESS The network interface was reset.\r
251 @retval EFI_NOT_STARTED The network interface has not been started\r
252 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
253 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
254 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
255\r
256**/\r
257typedef\r
258EFI_STATUS\r
259(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (\r
260 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
261 IN BOOLEAN ExtendedVerification\r
262 )\r
263;\r
264\r
265/**\r
266 Resets a network adapter and leaves it in a state that is safe for \r
267 another driver to initialize.\r
268\r
269 @param This Protocol instance pointer.\r
270\r
271 @retval EFI_SUCCESS The network interface was shutdown.\r
272 @retval EFI_NOT_STARTED The network interface has not been started\r
273 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
274 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
275 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
276\r
277**/\r
278typedef\r
279EFI_STATUS\r
280(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (\r
281 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
282 )\r
283;\r
284\r
285/**\r
286 Manages the multicast receive filters of a network interface.\r
287\r
288 @param This Protocol instance pointer.\r
289 @param Enable A bit mask of receive filters to enable on the network interface.\r
290 @param Disable A bit mask of receive filters to disable on the network interface.\r
291 @param ResetMCastFilter Set to TRUE to reset the contents of the multicast receive\r
292 filters on the network interface to their default values.\r
293 @param McastFilterCnt Number of multicast HW MAC addresses in the new\r
294 MCastFilter list. This value must be less than or equal to\r
295 the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
296 field is optional if ResetMCastFilter is TRUE.\r
297 @param MCastFilter A pointer to a list of new multicast receive filter HW MAC\r
298 addresses. This list will replace any existing multicast\r
299 HW MAC address list. This field is optional if\r
300 ResetMCastFilter is TRUE.\r
301\r
302 @retval EFI_SUCCESS The multicast receive filter list was updated.\r
303 @retval EFI_NOT_STARTED The network interface has not been started\r
304 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
305 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
306 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
307\r
308**/\r
309typedef\r
310EFI_STATUS\r
311(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (\r
312 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
313 IN UINT32 Enable,\r
314 IN UINT32 Disable,\r
315 IN BOOLEAN ResetMCastFilter,\r
316 IN UINTN MCastFilterCnt OPTIONAL,\r
317 IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL\r
318 )\r
319;\r
320\r
321/**\r
322 Modifies or resets the current station address, if supported.\r
323\r
324 @param This Protocol instance pointer.\r
325 @param Reset Flag used to reset the station address to the network interfaces\r
326 permanent address.\r
327 @param New New station address to be used for the network interface.\r
328\r
329 @retval EFI_SUCCESS The network interfaces station address was updated.\r
330 @retval EFI_NOT_STARTED The network interface has not been started\r
331 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
332 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
333 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
334\r
335**/\r
336typedef\r
337EFI_STATUS\r
338(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (\r
339 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
340 IN BOOLEAN Reset,\r
341 IN EFI_MAC_ADDRESS *New OPTIONAL\r
342 )\r
343;\r
344\r
345/**\r
346 Resets or collects the statistics on a network interface.\r
347\r
348 @param This Protocol instance pointer.\r
349 @param Reset Set to TRUE to reset the statistics for the network interface.\r
350 @param StatisticsSize On input the size, in bytes, of StatisticsTable. On\r
351 output the size, in bytes, of the resulting table of\r
352 statistics.\r
353 @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
354 contains the statistics.\r
355\r
356 @retval EFI_SUCCESS The statistics were collected from the network interface.\r
357 @retval EFI_NOT_STARTED The network interface has not been started.\r
358 @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer\r
359 size needed to hold the statistics is returned in\r
360 StatisticsSize.\r
361 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
362 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
363 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
364\r
365**/\r
366typedef\r
367EFI_STATUS\r
368(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (\r
369 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
370 IN BOOLEAN Reset,\r
371 IN OUT UINTN *StatisticsSize OPTIONAL,\r
372 OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL\r
373 )\r
374;\r
375\r
376/**\r
377 Converts a multicast IP address to a multicast HW MAC address.\r
378\r
379 @param This Protocol instance pointer.\r
380 @param IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
381 to FALSE if the multicast IP address is IPv4 [RFC 791].\r
382 @param IP The multicast IP address that is to be converted to a multicast\r
383 HW MAC address.\r
384 @param MAC The multicast HW MAC address that is to be generated from IP.\r
385\r
386 @retval EFI_SUCCESS The multicast IP address was mapped to the multicast\r
387 HW MAC address.\r
388 @retval EFI_NOT_STARTED The network interface has not been started.\r
389 @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer\r
390 size needed to hold the statistics is returned in\r
391 StatisticsSize.\r
392 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
393 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
394 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
395\r
396**/\r
397typedef\r
398EFI_STATUS\r
399(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (\r
400 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
401 IN BOOLEAN IPv6,\r
402 IN EFI_IP_ADDRESS *IP,\r
403 OUT EFI_MAC_ADDRESS *MAC\r
404 )\r
405;\r
406\r
407/**\r
408 Performs read and write operations on the NVRAM device attached to a \r
409 network interface.\r
410\r
411 @param This Protocol instance pointer.\r
412 @param ReadWrite TRUE for read operations, FALSE for write operations.\r
413 @param Offset Byte offset in the NVRAM device at which to start the read or\r
414 write operation. This must be a multiple of NvRamAccessSize and\r
415 less than NvRamSize.\r
416 @param BufferSize The number of bytes to read or write from the NVRAM device.\r
417 This must also be a multiple of NvramAccessSize.\r
418 @param Buffer A pointer to the data buffer.\r
419\r
420 @retval EFI_SUCCESS The NVRAM access was performed.\r
421 @retval EFI_NOT_STARTED The network interface has not been started.\r
422 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
423 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
424 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
425\r
426**/\r
427typedef\r
428EFI_STATUS\r
429(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (\r
430 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
431 IN BOOLEAN ReadWrite,\r
432 IN UINTN Offset,\r
433 IN UINTN BufferSize,\r
434 IN OUT VOID *Buffer\r
435 )\r
436;\r
437\r
438/**\r
439 Reads the current interrupt status and recycled transmit buffer status from \r
440 a network interface.\r
441\r
442 @param This Protocol instance pointer.\r
443 @param InterruptStatus A pointer to the bit mask of the currently active interrupts\r
444 If this is NULL, the interrupt status will not be read from\r
445 the device. If this is not NULL, the interrupt status will\r
446 be read from the device. When the interrupt status is read,\r
447 it will also be cleared. Clearing the transmit interrupt\r
448 does not empty the recycled transmit buffer array.\r
449 @param TxBuf Recycled transmit buffer address. The network interface will\r
450 not transmit if its internal recycled transmit buffer array\r
451 is full. Reading the transmit buffer does not clear the\r
452 transmit interrupt. If this is NULL, then the transmit buffer\r
453 status will not be read. If there are no transmit buffers to\r
454 recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
455\r
456 @retval EFI_SUCCESS The status of the network interface was retrieved.\r
457 @retval EFI_NOT_STARTED The network interface has not been started.\r
458 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
459 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
460 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
461\r
462**/\r
463typedef\r
464EFI_STATUS\r
465(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (\r
466 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
467 OUT UINT32 *InterruptStatus OPTIONAL,\r
468 OUT VOID **TxBuf OPTIONAL\r
469 )\r
470;\r
471\r
472/**\r
473 Places a packet in the transmit queue of a network interface.\r
474\r
475 @param This Protocol instance pointer.\r
476 @param HeaderSize The size, in bytes, of the media header to be filled in by\r
477 the Transmit() function. If HeaderSize is non-zero, then it\r
478 must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
479 and Protocol parameters must not be NULL.\r
480 @param BufferSize The size, in bytes, of the entire packet (media header and\r
481 data) to be transmitted through the network interface.\r
482 @param Buffer A pointer to the packet (media header followed by data) to be\r
483 transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
484 then the media header in Buffer must already be filled in by the\r
485 caller. If HeaderSize is non-zero, then the media header will be\r
486 filled in by the Transmit() function.\r
487 @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter\r
488 is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
489 This->Mode->CurrentAddress is used for the source HW MAC address.\r
490 @param DsetAddr The destination HW MAC address. If HeaderSize is zero, then this\r
491 parameter is ignored.\r
492 @param Protocol The type of header to build. If HeaderSize is zero, then this\r
493 parameter is ignored. See RFC 1700, section "Ether Types", for\r
494 examples.\r
495\r
496 @retval EFI_SUCCESS The packet was placed on the transmit queue.\r
497 @retval EFI_NOT_STARTED The network interface has not been started.\r
498 @retval EFI_NOT_READY The network interface is too busy to accept this transmit request. \r
499 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
500 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
501 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
502 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
503\r
504**/\r
505typedef\r
506EFI_STATUS\r
507(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (\r
508 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
509 IN UINTN HeaderSize,\r
510 IN UINTN BufferSize,\r
511 IN VOID *Buffer,\r
512 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
513 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
514 IN UINT16 *Protocol OPTIONAL\r
515 )\r
516;\r
517\r
518/**\r
519 Receives a packet from a network interface.\r
520\r
521 @param This Protocol instance pointer.\r
522 @param HeaderSize The size, in bytes, of the media header received on the network\r
523 interface. If this parameter is NULL, then the media header size\r
524 will not be returned.\r
525 @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in\r
526 bytes, of the packet that was received on the network interface.\r
527 @param Buffer A pointer to the data buffer to receive both the media header and\r
528 the data.\r
529 @param SrcAddr The source HW MAC address. If this parameter is NULL, the\r
530 HW MAC source address will not be extracted from the media\r
531 header.\r
532 @param DsetAddr The destination HW MAC address. If this parameter is NULL,\r
533 the HW MAC destination address will not be extracted from the\r
534 media header.\r
535 @param Protocol The media header type. If this parameter is NULL, then the\r
536 protocol will not be extracted from the media header. See\r
537 RFC 1700 section "Ether Types" for examples.\r
538\r
539 @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has\r
540 been updated to the number of bytes received.\r
541 @retval EFI_NOT_STARTED The network interface has not been started.\r
542 @retval EFI_NOT_READY The network interface is too busy to accept this transmit\r
543 request.\r
544 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
545 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
546 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
547 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
548\r
549**/\r
550typedef\r
551EFI_STATUS\r
552(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (\r
553 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
554 OUT UINTN *HeaderSize OPTIONAL,\r
555 IN OUT UINTN *BufferSize,\r
556 OUT VOID *Buffer,\r
557 OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
558 OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
559 OUT UINT16 *Protocol OPTIONAL\r
560 )\r
561;\r
562\r
563#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000\r
564\r
a6508c05 565//\r
566// Revision defined in EFI1.1\r
567// \r
568#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION\r
569\r
d1f95000 570struct _EFI_SIMPLE_NETWORK_PROTOCOL {\r
571 UINT64 Revision;\r
572 EFI_SIMPLE_NETWORK_START Start;\r
573 EFI_SIMPLE_NETWORK_STOP Stop;\r
574 EFI_SIMPLE_NETWORK_INITIALIZE Initialize;\r
575 EFI_SIMPLE_NETWORK_RESET Reset;\r
576 EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;\r
577 EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;\r
578 EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;\r
579 EFI_SIMPLE_NETWORK_STATISTICS Statistics;\r
580 EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;\r
581 EFI_SIMPLE_NETWORK_NVDATA NvData;\r
582 EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;\r
583 EFI_SIMPLE_NETWORK_TRANSMIT Transmit;\r
584 EFI_SIMPLE_NETWORK_RECEIVE Receive;\r
585 EFI_EVENT WaitForPacket;\r
586 EFI_SIMPLE_NETWORK_MODE *Mode;\r
587};\r
588\r
589extern EFI_GUID gEfiSimpleNetworkProtocolGuid;\r
590\r
591#endif\r