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