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