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