]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.h
SecurityPkg: SmmTcg2PhysicalPresenceLib: Fix coding style issue
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / Snp16Dxe / BiosSnp16.h
CommitLineData
bcecde14 1/** @file\r
2\r
3Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>\r
4\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions\r
7of the BSD License which accompanies this distribution. The\r
8full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _BIOS_SNP_16_H_\r
17#define _BIOS_SNP_16_H_\r
18\r
19#include <Uefi.h>\r
20\r
21#include <Protocol/LegacyBios.h>\r
22#include <Protocol/SimpleNetwork.h>\r
23#include <Protocol/PciIo.h>\r
24#include <Protocol/NetworkInterfaceIdentifier.h>\r
25#include <Protocol/DevicePath.h>\r
26\r
27#include <Library/UefiDriverEntryPoint.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/BaseMemoryLib.h>\r
30#include <Library/UefiBootServicesTableLib.h>\r
31#include <Library/UefiLib.h>\r
32#include <Library/BaseLib.h>\r
33#include <Library/DevicePathLib.h>\r
34#include <Library/MemoryAllocationLib.h>\r
35\r
36#include <Guid/EventGroup.h>\r
37\r
38#include <IndustryStandard/Pci.h>\r
39\r
40#include "Pxe.h"\r
41\r
42//\r
43// BIOS Simple Network Protocol Device Structure\r
44//\r
45#define EFI_SIMPLE_NETWORK_DEV_SIGNATURE SIGNATURE_32 ('s', 'n', '1', '6')\r
46\r
47#define INIT_PXE_STATUS 0xabcd\r
48\r
49#define EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE 64\r
50\r
51typedef struct {\r
52 UINT32 First;\r
53 UINT32 Last;\r
54 VOID * Data[EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE];\r
55} EFI_SIMPLE_NETWORK_DEV_FIFO;\r
56\r
57typedef struct {\r
58 UINTN Signature;\r
59 EFI_HANDLE Handle;\r
60 EFI_SIMPLE_NETWORK_PROTOCOL SimpleNetwork;\r
61 EFI_SIMPLE_NETWORK_MODE SimpleNetworkMode;\r
62 EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL Nii;\r
63 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
64 EFI_PCI_IO_PROTOCOL *PciIo;\r
65 EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r
66\r
67 //\r
68 // Local Data for Simple Network Protocol interface goes here\r
69 //\r
70 BOOLEAN UndiLoaded;\r
71 EFI_EVENT EfiBootEvent;\r
72 EFI_EVENT LegacyBootEvent;\r
73 UINT16 PxeEntrySegment;\r
74 UINT16 PxeEntryOffset;\r
75 EFI_SIMPLE_NETWORK_DEV_FIFO TxBufferFifo;\r
76 EFI_DEVICE_PATH_PROTOCOL *BaseDevicePath;\r
77 PXE_T *Pxe; ///< Pointer to !PXE structure\r
78 PXENV_UNDI_GET_INFORMATION_T GetInformation; ///< Data from GET INFORMATION\r
79 PXENV_UNDI_GET_NIC_TYPE_T GetNicType; ///< Data from GET NIC TYPE\r
80 PXENV_UNDI_GET_NDIS_INFO_T GetNdisInfo; ///< Data from GET NDIS INFO\r
81 BOOLEAN IsrValid; ///< TRUE if Isr contains valid data\r
82 PXENV_UNDI_ISR_T Isr; ///< Data from ISR\r
83 PXENV_UNDI_TBD_T *Xmit; //\r
84 VOID *TxRealModeMediaHeader; ///< < 1 MB Size = 0x100\r
85 VOID *TxRealModeDataBuffer; ///< < 1 MB Size = GetInformation.MaxTranUnit\r
86 VOID *TxDestAddr; ///< < 1 MB Size = 16\r
87 UINT8 InterruptStatus; ///< returned/cleared by GetStatus, set in ISR\r
88 UINTN UndiLoaderTablePages;\r
89 UINTN DestinationDataSegmentPages;\r
90 UINTN DestinationStackSegmentPages;\r
91 UINTN DestinationCodeSegmentPages;\r
92 VOID *UndiLoaderTable;\r
93 VOID *DestinationDataSegment;\r
94 VOID *DestinationStackSegment;\r
95 VOID *DestinationCodeSegment;\r
96} EFI_SIMPLE_NETWORK_DEV;\r
97\r
98#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) \\r
99 CR (a, \\r
100 EFI_SIMPLE_NETWORK_DEV, \\r
101 SimpleNetwork, \\r
102 EFI_SIMPLE_NETWORK_DEV_SIGNATURE \\r
103 )\r
104\r
105//\r
106// Global Variables\r
107//\r
108extern EFI_DRIVER_BINDING_PROTOCOL gBiosSnp16DriverBinding;\r
109extern EFI_COMPONENT_NAME_PROTOCOL gBiosSnp16ComponentName;\r
110extern EFI_COMPONENT_NAME2_PROTOCOL gBiosSnp16ComponentName2;\r
111\r
112\r
113//\r
114// Driver Binding Protocol functions\r
115//\r
116/**\r
117 Tests to see if this driver supports a given controller.\r
118\r
119 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
120 @param Controller The handle of the controller to test.\r
121 @param RemainingDevicePath A pointer to the remaining portion of a device path.\r
122 \r
123 @retval EFI_SUCCESS The driver supports given controller.\r
124 @retval EFI_UNSUPPORT The driver doesn't support given controller.\r
125 @retval Other Other errors prevent driver finishing to test\r
126 if the driver supports given controller.\r
127**/\r
128EFI_STATUS\r
129EFIAPI\r
130BiosSnp16DriverBindingSupported (\r
131 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
132 IN EFI_HANDLE Controller,\r
133 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
134 )\r
135;\r
136\r
137/**\r
138 Starts the Snp device controller\r
139\r
140 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
141 @param Controller The handle of the controller to test.\r
142 @param RemainingDevicePath A pointer to the remaining portion of a device path.\r
143 \r
144 @retval EFI_SUCCESS - The device was started. \r
145 @retval EFI_DEVICE_ERROR - The device could not be started due to a device error.\r
146 @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
147**/\r
148EFI_STATUS\r
149EFIAPI\r
150BiosSnp16DriverBindingStart (\r
151 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
152 IN EFI_HANDLE Controller,\r
153 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
154 )\r
155;\r
156\r
157/**\r
158 Stops the device by given device controller.\r
159\r
160 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
161 @param Controller The handle of the controller to test.\r
162 @param NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
163 @param ChildHandleBuffer An array of child handles to be freed. May be NULL if\r
164 NumberOfChildren is 0.\r
165 \r
166 @retval EFI_SUCCESS - The device was stopped.\r
167 @retval EFI_DEVICE_ERROR - The device could not be stopped due to a device error.\r
168**/\r
169EFI_STATUS\r
170EFIAPI\r
171BiosSnp16DriverBindingStop (\r
172 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
173 IN EFI_HANDLE Controller,\r
174 IN UINTN NumberOfChildren,\r
175 IN EFI_HANDLE *ChildHandleBuffer\r
176 )\r
177;\r
178\r
179//\r
180// Simple Network Protocol functions\r
181//\r
182/**\r
183 Call 16 bit UNDI ROM to start the network interface\r
184\r
185 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
186 \r
187 @retval EFI_DEVICE_ERROR Network interface has not be initialized.\r
188 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
189 @retval EFI_SUCESS Success operation.\r
190**/\r
191EFI_STATUS\r
192EFIAPI\r
193Undi16SimpleNetworkStart (\r
194 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
195 )\r
196;\r
197\r
198/**\r
199 Call 16 bit UNDI ROM to stop the network interface\r
200\r
201 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
202 \r
203 @retval EFI_DEVICE_ERROR Network interface has not be initialized.\r
204 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
205 @retval EFI_SUCESS Success operation.\r
206**/\r
207EFI_STATUS\r
208EFIAPI\r
209Undi16SimpleNetworkStop (\r
210 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
211 )\r
212;\r
213\r
214/**\r
215 Initialize network interface \r
216\r
217 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
218 @param ExtraRxBufferSize The size of extra request receive buffer.\r
219 @param ExtraTxBufferSize The size of extra request transmit buffer.\r
220 \r
221 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
222 @retval EFI_SUCESS Success operation.\r
223**/\r
224EFI_STATUS\r
225EFIAPI\r
226Undi16SimpleNetworkInitialize (\r
227 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
228 IN UINTN ExtraRxBufferSize OPTIONAL,\r
229 IN UINTN ExtraTxBufferSize OPTIONAL\r
230 )\r
231;\r
232\r
233/**\r
234 Reset network interface.\r
235\r
236 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
237 @param ExtendedVerification Need extended verfication.\r
238 \r
239 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
240 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
241 @retval EFI_NOT_STARTED Network device has been stopped.\r
242 @retval EFI_DEVICE_ERROR Invalid status for network device\r
243 @retval EFI_SUCCESS Success operation.\r
244**/\r
245EFI_STATUS\r
246EFIAPI\r
247Undi16SimpleNetworkReset (\r
248 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
249 IN BOOLEAN ExtendedVerification\r
250 )\r
251;\r
252\r
253/**\r
254 Shutdown network interface.\r
255\r
256 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
257 \r
258 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
259 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
260 @retval EFI_NOT_STARTED Network device has been stopped.\r
261 @retval EFI_DEVICE_ERROR Invalid status for network device\r
262 @retval EFI_SUCCESS Success operation.\r
263**/\r
264EFI_STATUS\r
265EFIAPI\r
266Undi16SimpleNetworkShutdown (\r
267 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
268 )\r
269;\r
270\r
271/**\r
272 Reset network interface.\r
273\r
274 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
275 @param Enable Enable mask value\r
276 @param Disable Disable mask value\r
277 @param ResetMCastFilter Whether reset multi cast filter or not\r
278 @param MCastFilterCnt Count of mutli cast filter for different MAC address\r
279 @param MCastFilter Buffer for mustli cast filter for different MAC address.\r
280 \r
281 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
282 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
283 @retval EFI_NOT_STARTED Network device has been stopped.\r
284 @retval EFI_DEVICE_ERROR Invalid status for network device\r
285 @retval EFI_SUCCESS Success operation.\r
286**/\r
287EFI_STATUS\r
288EFIAPI\r
289Undi16SimpleNetworkReceiveFilters (\r
290 IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
291 IN UINT32 Enable,\r
292 IN UINT32 Disable,\r
293 IN BOOLEAN ResetMCastFilter,\r
294 IN UINTN MCastFilterCnt OPTIONAL,\r
295 IN EFI_MAC_ADDRESS * MCastFilter OPTIONAL\r
296 )\r
297;\r
298\r
299/**\r
300 Set new MAC address.\r
301\r
302 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
303 @param Reset Whether reset station MAC address to permenent address\r
304 @param New A pointer to New address\r
305 \r
306 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
307 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
308 @retval EFI_NOT_STARTED Network device has been stopped.\r
309 @retval EFI_DEVICE_ERROR Invalid status for network device\r
310 @retval EFI_SUCCESS Success operation.\r
311**/\r
312EFI_STATUS\r
313EFIAPI\r
314Undi16SimpleNetworkStationAddress (\r
315 IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
316 IN BOOLEAN Reset,\r
317 IN EFI_MAC_ADDRESS * New OPTIONAL\r
318 )\r
319;\r
320\r
321/**\r
322 Collect statistics.\r
323\r
324 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
325 @param Reset Whether cleanup old statistics data.\r
326 @param StatisticsSize The buffer of statistics table.\r
327 @param StatisticsTable A pointer to statistics buffer.\r
328 \r
329 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
330 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
331 @retval EFI_NOT_STARTED Network device has been stopped.\r
332 @retval EFI_DEVICE_ERROR Invalid status for network device\r
333 @retval EFI_SUCCESS Success operation.\r
334**/\r
335EFI_STATUS\r
336EFIAPI\r
337Undi16SimpleNetworkStatistics (\r
338 IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
339 IN BOOLEAN Reset,\r
340 IN OUT UINTN *StatisticsSize OPTIONAL,\r
341 OUT EFI_NETWORK_STATISTICS * StatisticsTable OPTIONAL\r
342 )\r
343;\r
344\r
345/**\r
346 Translate IP address to MAC address.\r
347\r
348 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
349 @param IPv6 IPv6 or IPv4\r
350 @param IP A pointer to given Ip address.\r
351 @param MAC On return, translated MAC address.\r
352 \r
353 @retval EFI_INVALID_PARAMETER Invalid This paramter.\r
354 @retval EFI_INVALID_PARAMETER Invalid IP address.\r
355 @retval EFI_INVALID_PARAMETER Invalid return buffer for holding MAC address.\r
356 @retval EFI_UNSUPPORTED Do not support IPv6 \r
357 @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
358 @retval EFI_NOT_STARTED Network device has been stopped.\r
359 @retval EFI_DEVICE_ERROR Invalid status for network device\r
360 @retval EFI_SUCCESS Success operation.\r
361**/\r
362EFI_STATUS\r
363EFIAPI\r
364Undi16SimpleNetworkMCastIpToMac (\r
365 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
366 IN BOOLEAN IPv6,\r
367 IN EFI_IP_ADDRESS *IP,\r
368 OUT EFI_MAC_ADDRESS *MAC\r
369 )\r
370;\r
371\r
372/**\r
373 Performs read and write operations on the NVRAM device attached to a \r
374 network interface.\r
375\r
376 @param This The protocol instance pointer.\r
377 @param ReadWrite TRUE for read operations, FALSE for write operations.\r
378 @param Offset Byte offset in the NVRAM device at which to start the read or\r
379 write operation. This must be a multiple of NvRamAccessSize and\r
380 less than NvRamSize.\r
381 @param BufferSize The number of bytes to read or write from the NVRAM device.\r
382 This must also be a multiple of NvramAccessSize.\r
383 @param Buffer A pointer to the data buffer.\r
384\r
385 @retval EFI_SUCCESS The NVRAM access was performed.\r
386 @retval EFI_NOT_STARTED The network interface has not been started.\r
387 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
388 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
389 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
390\r
391**/\r
392EFI_STATUS\r
393EFIAPI\r
394Undi16SimpleNetworkNvData (\r
395 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
396 IN BOOLEAN Write,\r
397 IN UINTN Offset,\r
398 IN UINTN BufferSize,\r
399 IN OUT VOID *Buffer\r
400 )\r
401;\r
402\r
403/**\r
404 Reads the current interrupt status and recycled transmit buffer status from \r
405 a network interface.\r
406\r
407 @param This The protocol instance pointer.\r
408 @param InterruptStatus A pointer to the bit mask of the currently active interrupts\r
409 If this is NULL, the interrupt status will not be read from\r
410 the device. If this is not NULL, the interrupt status will\r
411 be read from the device. When the interrupt status is read,\r
412 it will also be cleared. Clearing the transmit interrupt\r
413 does not empty the recycled transmit buffer array.\r
414 @param TxBuf Recycled transmit buffer address. The network interface will\r
415 not transmit if its internal recycled transmit buffer array\r
416 is full. Reading the transmit buffer does not clear the\r
417 transmit interrupt. If this is NULL, then the transmit buffer\r
418 status will not be read. If there are no transmit buffers to\r
419 recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
420\r
421 @retval EFI_SUCCESS The status of the network interface was retrieved.\r
422 @retval EFI_NOT_STARTED The network interface has not been started.\r
423 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
424 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
425 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
426\r
427**/\r
428EFI_STATUS\r
429EFIAPI\r
430Undi16SimpleNetworkGetStatus (\r
431 IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
432 OUT UINT32 *InterruptStatus OPTIONAL,\r
433 OUT VOID **TxBuf OPTIONAL\r
434 )\r
435;\r
436\r
437/**\r
438 Places a packet in the transmit queue of a network interface.\r
439\r
440 @param This The protocol instance pointer.\r
441 @param HeaderSize The size, in bytes, of the media header to be filled in by\r
442 the Transmit() function. If HeaderSize is non-zero, then it\r
443 must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
444 and Protocol parameters must not be NULL.\r
445 @param BufferSize The size, in bytes, of the entire packet (media header and\r
446 data) to be transmitted through the network interface.\r
447 @param Buffer A pointer to the packet (media header followed by data) to be\r
448 transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
449 then the media header in Buffer must already be filled in by the\r
450 caller. If HeaderSize is non-zero, then the media header will be\r
451 filled in by the Transmit() function.\r
452 @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter\r
453 is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
454 This->Mode->CurrentAddress is used for the source HW MAC address.\r
455 @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this\r
456 parameter is ignored.\r
457 @param Protocol The type of header to build. If HeaderSize is zero, then this\r
458 parameter is ignored. See RFC 1700, section "Ether Types", for\r
459 examples.\r
460\r
461 @retval EFI_SUCCESS The packet was placed on the transmit queue.\r
462 @retval EFI_NOT_STARTED The network interface has not been started.\r
463 @retval EFI_NOT_READY The network interface is too busy to accept this transmit request. \r
464 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
465 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
466 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
467 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
468\r
469**/\r
470EFI_STATUS\r
471EFIAPI\r
472Undi16SimpleNetworkTransmit (\r
473 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
474 IN UINTN HeaderSize,\r
475 IN UINTN BufferSize,\r
476 IN VOID *Buffer,\r
477 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
478 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
479 IN UINT16 *Protocol OPTIONAL\r
480 )\r
481;\r
482\r
483/**\r
484 Receives a packet from a network interface.\r
485\r
486 @param This The protocol instance pointer.\r
487 @param HeaderSize The size, in bytes, of the media header received on the network\r
488 interface. If this parameter is NULL, then the media header size\r
489 will not be returned.\r
490 @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in\r
491 bytes, of the packet that was received on the network interface.\r
492 @param Buffer A pointer to the data buffer to receive both the media header and\r
493 the data.\r
494 @param SrcAddr The source HW MAC address. If this parameter is NULL, the\r
495 HW MAC source address will not be extracted from the media\r
496 header.\r
497 @param DestAddr The destination HW MAC address. If this parameter is NULL,\r
498 the HW MAC destination address will not be extracted from the\r
499 media header.\r
500 @param Protocol The media header type. If this parameter is NULL, then the\r
501 protocol will not be extracted from the media header. See\r
502 RFC 1700 section "Ether Types" for examples.\r
503\r
504 @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has\r
505 been updated to the number of bytes received.\r
506 @retval EFI_NOT_STARTED The network interface has not been started.\r
507 @retval EFI_NOT_READY The network interface is too busy to accept this transmit\r
508 request.\r
509 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
510 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
511 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
512 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
513\r
514**/\r
515EFI_STATUS\r
516EFIAPI\r
517Undi16SimpleNetworkReceive (\r
518 IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
519 OUT UINTN *HeaderSize OPTIONAL,\r
520 IN OUT UINTN *BufferSize,\r
521 OUT VOID *Buffer,\r
522 OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
523 OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
524 OUT UINT16 *Protocol OPTIONAL\r
525 )\r
526;\r
527\r
528/**\r
529 wait for a packet to be received.\r
530\r
531 @param Event Event used with WaitForEvent() to wait for a packet to be received.\r
532 @param Context Event Context\r
533 \r
534**/\r
535VOID\r
536EFIAPI\r
537Undi16SimpleNetworkWaitForPacket (\r
538 IN EFI_EVENT Event,\r
539 IN VOID *Context\r
540 )\r
541;\r
542\r
543/**\r
544 Check whether packet is ready for receive.\r
545\r
546 @param This The protocol instance pointer.\r
547 \r
548 @retval EFI_SUCCESS Receive data is ready.\r
549 @retval EFI_NOT_STARTED The network interface has not been started.\r
550 @retval EFI_NOT_READY The network interface is too busy to accept this transmit\r
551 request.\r
552 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
553 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
554 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
555 @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
556**/\r
557EFI_STATUS\r
558Undi16SimpleNetworkCheckForPacket (\r
559 IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
560 )\r
561;\r
562\r
563/**\r
564 Cache Interrupt verctor address converted from IVT number.\r
565\r
566 @param VectorNumber IVT number\r
567 \r
568 @retval EFI_SUCCESS Success to operation.\r
569**/\r
570EFI_STATUS\r
571CacheVectorAddress (\r
572 UINT8 VectorNumber\r
573 )\r
574;\r
575\r
576/**\r
577 Get interrupt vector address according to IVT number. \r
578 \r
579 @param VectorNumber Given IVT number\r
580 \r
581 @return cached interrupt vector address.\r
582**/\r
583EFI_STATUS\r
584RestoreCachedVectorAddress (\r
585 UINT8 VectorNumber\r
586 )\r
587;\r
588\r
589/**\r
590 If available, launch the BaseCode from a NIC option ROM.\r
591 This should install the !PXE and PXENV+ structures in memory for\r
592 subsequent use.\r
593 \r
594\r
595 @param SimpleNetworkDevice Simple network device instance\r
596 @param RomAddress The ROM base address for NIC rom.\r
597 \r
598 @retval EFI_NOT_FOUND The check sum does not match \r
599 @retval EFI_NOT_FOUND Rom ID offset is wrong \r
600 @retval EFI_NOT_FOUND No Rom ID structure is found \r
601**/\r
602EFI_STATUS\r
603LaunchBaseCode (\r
604 EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
605 UINTN RomAddress\r
606 )\r
607;\r
608\r
609/**\r
610 PXE \r
611 START UNDI\r
612 Op-Code: PXENV_START_UNDI (0000h)\r
613 Input: Far pointer to a PXENV_START_UNDI_T parameter structure that has been initialized by the caller.\r
614 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
615 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
616 constants.\r
617 Description: This service is used to pass the BIOS parameter registers to the UNDI driver. The UNDI driver is\r
618 responsible for saving the information it needs to communicate with the hardware.\r
619 This service is also responsible for hooking the Int 1Ah service routine\r
620 Note: This API service must be called only once during UNDI Option ROM boot.\r
621 The UNDI driver is responsible for saving this information and using it every time\r
622 PXENV_UNDI_STARTUP is called.\r
623 Service cannot be used in protected mode.\r
624 typedef struct {\r
625 PXENV_STATUS Status;\r
626 UINT16 AX;\r
627 UINT16 BX;\r
628 UINT16 DX;\r
629 UINT16 DI;\r
630 UINT16 ES;\r
631 } PXENV_START_UNDI_T;\r
632 Set before calling API service\r
633 AX, BX, DX, DI, ES: BIOS initialization parameter registers. These\r
634 fields should contain the same information passed to the option ROM\r
635 initialization routine by the Host System BIOS. Information about the\r
636 contents of these registers can be found in the [PnP], [PCI] and\r
637 [BBS] specifications.\r
638 Returned from API service\r
639 Status: See the PXENV_STATUS_xxx constants. \r
640\r
641 @param SimpleNetworkDevice Device instance\r
642 @param PxeUndiTable Point to structure which hold paramter and return value \r
643 for option ROM call.\r
644 \r
645 @return Return value of PXE option ROM far call. \r
646**/\r
647EFI_STATUS\r
648PxeStartUndi (\r
649 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
650 IN OUT PXENV_START_UNDI_T *PxeUndiTable\r
651 )\r
652;\r
653\r
654/**\r
655 PXE \r
656 UNDI STARTUP \r
657 Op-Code: PXENV_UNDI_STARTUP (0001h)\r
658 Input: Far pointer to a PXENV_UNDI_STARTUP_T parameter structure that has been initialized by the\r
659 caller.\r
660 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
661 the parameter structure must be set to one of the values represented by the\r
662 PXENV_STATUS_xxx constants.\r
663 Description: This API is responsible for initializing the contents of the UNDI code & data segment for proper\r
664 operation. Information from the !PXE structure and the first PXENV_START_UNDI API call is used\r
665 to complete this initialization. The rest of the UNDI APIs will not be available until this call has\r
666 been completed.\r
667 Note: PXENV_UNDI_STARTUP must not be called again without first calling\r
668 PXENV_UNDI_SHUTDOWN.\r
669 PXENV_UNDI_STARTUP and PXENV_UNDI_SHUTDOWN are no longer responsible for\r
670 chaining interrupt 1Ah. This must be done by the PXENV_START_UNDI and\r
671 PXENV_STOP_UNDI API calls.\r
672 This service cannot be used in protected mode.\r
673 typedef struct \r
674 {\r
675 PXENV_STATUS Status;\r
676 } PXENV_UNDI_STARTUP_T;\r
677 Set before calling API service\r
678 N/A\r
679 Returned from API service\r
680 Status: See the PXENV_STATUS_xxx constants.\r
681\r
682 @param SimpleNetworkDevice Device instance\r
683 @param PxeUndiTable Point to structure which hold paramter and return value \r
684 for option ROM call.\r
685 \r
686 @return Return value of PXE option ROM far call. \r
687**/\r
688EFI_STATUS\r
689PxeUndiStartup (\r
690 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
691 IN OUT PXENV_UNDI_STARTUP_T *PxeUndiTable\r
692 )\r
693;\r
694\r
695/**\r
696 PXE \r
697 UNDI CLEANUP\r
698 Op-Code: PXENV_UNDI_CLEANUP (0002h)\r
699 Input: Far pointer to a PXENV_UNDI_CLEANUP_T parameter structure.\r
700 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field\r
701 in the parameter structure must be set to one of the values represented by the\r
702 PXENV_STATUS_xxx constants.\r
703 Description: This call will prepare the network adapter driver to be unloaded from memory. This call must be\r
704 made just before unloading the Universal NIC Driver. The rest of the API will not be available\r
705 after this call executes.\r
706 This service cannot be used in protected mode.\r
707 typedef struct {\r
708 PXENX_STATUS Status;\r
709 } PXENV_UNDI_CLEANUP_T;\r
710 Set before calling API service\r
711 N/A\r
712 Returned from API service\r
713 Status: See the PXENV_STATUS_xxx constants.\r
714\r
715 @param SimpleNetworkDevice Device instance\r
716 @param PxeUndiTable Point to structure which hold paramter and return value \r
717 for option ROM call.\r
718 \r
719 @return Return value of PXE option ROM far call. \r
720**/\r
721EFI_STATUS\r
722PxeUndiCleanup (\r
723 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
724 IN OUT PXENV_UNDI_CLEANUP_T *PxeUndiTable\r
725 )\r
726;\r
727\r
728/**\r
729 PXE \r
730 UNDI INITIALIZE\r
731 Op-Code: PXENV_UNDI_INITIALIZE (0003h)\r
732 Input: Far pointer to a PXENV_UNDI_INITIALIZE_T parameter structure that has been initialized by the\r
733 caller.\r
734 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
735 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
736 constants.\r
737 Description: This call resets the adapter and programs it with default parameters. The default parameters used\r
738 are those supplied to the most recent UNDI_STARTUP call. This routine does not enable the\r
739 receive and transmit units of the network adapter to readily receive or transmit packets. The\r
740 application must call PXENV_UNDI_OPEN to logically connect the network adapter to the network.\r
741 This call must be made by an application to establish an interface to the network adapter driver.\r
742 Note: When the PXE code makes this call to initialize the network adapter, it passes a NULL pointer for\r
743 the Protocol field in the parameter structure.\r
744 typedef struct {\r
745 PXENV_STATUS Status;\r
746 ADDR32 ProtocolIni;\r
747 UINT8 reserved[8];\r
748 } PXENV_UNDI_INITIALIZE_T;\r
749 Set before calling API service\r
750 ProtocolIni: Physical address of a memory copy of the driver\r
751 module from the protocol.ini file obtained from the protocol manager\r
752 driver (refer to the NDIS 2.0 specification). This parameter is\r
753 supported for the universal NDIS driver to pass the information\r
754 contained in the protocol.ini file to the NIC driver for any specific\r
755 configuration of the NIC. (Note that the module identification in the\r
756 protocol.ini file was done by NDIS.) This value can be NULL for any\r
757 other application interfacing to the universal NIC driver\r
758 Returned from API service\r
759 Status: See the PXENV_STATUS_xxx constants. \r
760 \r
761 @param SimpleNetworkDevice Device instance.\r
762 @param PxeUndiTable Point to structure which hold paramter and return value \r
763 for option ROM call.\r
764 \r
765 @return Return value of PXE option ROM far call. \r
766**/\r
767EFI_STATUS\r
768PxeUndiInitialize (\r
769 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
770 IN OUT PXENV_UNDI_INITIALIZE_T *PxeUndiTable\r
771 )\r
772;\r
773\r
774/**\r
775 Wrapper routine for reset adapter.\r
776 \r
777 PXE \r
778 UNDI RESET ADAPTER\r
779 Op-Code: PXENV_UNDI_RESET_ADAPTER (0004h)\r
780 Input: Far pointer to a PXENV_UNDI_RESET_ADAPTER_t parameter structure that has been initialized\r
781 by the caller.\r
782 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
783 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
784 constants.\r
785 Description: This call resets and reinitializes the network adapter with the same set of parameters supplied to\r
786 Initialize Routine. Unlike Initialize, this call opens the adapter that is, it connects logically to the\r
787 network. This routine cannot be used to replace Initialize or Shutdown calls.\r
788 typedef struct {\r
789 PXENV_STATUS Status;\r
790 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;\r
791 } PXENV_UNDI_RESET_T;\r
792\r
793 #define MAXNUM_MCADDR 8\r
794\r
795 typedef struct {\r
796 UINT16 MCastAddrCount;\r
797 MAC_ADDR McastAddr[MAXNUM_MCADDR];\r
798 } PXENV_UNDI_MCAST_ADDRESS_t;\r
799\r
800 Set before calling API service\r
801 R_Mcast_Buf: This is a structure of MCastAddrCount and\r
802 McastAddr.\r
803 MCastAddrCount: Number of multicast MAC addresses in the\r
804 buffer.\r
805 McastAddr: List of up to MAXNUM_MCADDR multicast MAC\r
806 addresses.\r
807 Returned from API service\r
808 Status: See the PXENV_STATUS_xxx constants.\r
809 \r
810 @param SimpleNetworkDevice Device instance.\r
811 @param PxeUndiTable Point to structure which hold paramter and return value \r
812 for option ROM call.\r
813 @param RxFilter Filter setting mask value for PXE recive . \r
814 \r
815 @return Return value of PXE option ROM far call. \r
816**/\r
817EFI_STATUS\r
818PxeUndiResetNic (\r
819 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
820 IN OUT PXENV_UNDI_RESET_T *PxeUndiTable,\r
821 IN UINT16 RxFilter\r
822 )\r
823;\r
824\r
825/**\r
826 PXE \r
827 UNDI SHUTDOWN\r
828 Op-Code: PXENV_UNDI_SHUTDOWN (0005h)\r
829 Input: Far pointer to a PXENV_UNDI_SHUTDOWN_T parameter.\r
830 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
831 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
832 constants.\r
833 Description: This call resets the network adapter and leaves it in a safe state for another driver to program it.\r
834 Note: The contents of the PXENV_UNDI_STARTUP parameter structure need to be saved by the\r
835 Universal NIC Driver in case PXENV_UNDI_INITIALIZE is called again.\r
836 typedef struct \r
837 {\r
838 PXENV_STATUS Status;\r
839 } PXENV_UNDI_SHUTDOWN_T;\r
840 Set before calling API service\r
841 N/A\r
842 Returned from API service\r
843 Status: See the PXENV_STATUS_xxx constants.\r
844 \r
845 @param SimpleNetworkDevice Device instance\r
846 @param PxeUndiTable Point to structure which hold paramter and return value \r
847 for option ROM call.\r
848 \r
849 @return Return value of PXE option ROM far call. \r
850**/\r
851EFI_STATUS\r
852PxeUndiShutdown (\r
853 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
854 IN OUT PXENV_UNDI_SHUTDOWN_T *PxeUndiTable\r
855 )\r
856;\r
857\r
858/**\r
859 PXE \r
860 UNDI OPEN\r
861 Op-Code: PXENV_UNDI_OPEN (0006h)\r
862 Input: Far pointer to a PXENV_UNDI_OPEN_T parameter structure that has been initialized by the caller.\r
863 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
864 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
865 constants.\r
866 Description: This call activates the adapter network connection and sets the adapter ready to accept packets\r
867 for transmit and receive.\r
868 typedef struct {\r
869 PXENV_STATUS Status;\r
870 UINT16 OpenFlag;\r
871 UINT16 PktFilter;\r
872 #define FLTR_DIRECTED 0x0001\r
873 #define FLTR_BRDCST 0x0002\r
874 #define FLTR_PRMSCS 0x0004\r
875 #define FLTR_SRC_RTG 0x0008\r
876 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;\r
877 } PXENV_UNDI_OPEN_T;\r
878 Set before calling API service\r
879 OpenFlag: This is an adapter specific input parameter. This is\r
880 supported for the universal NDIS 2.0 driver to pass in the open flags\r
881 provided by the protocol driver. (See the NDIS 2.0 specification.)\r
882 This can be zero.\r
883 PktFilter: Filter for receiving packets. This can be one, or more, of\r
884 the FLTR_xxx constants. Multiple values are arithmetically or-ed\r
885 together.\r
886 directed packets are packets that may come to your MAC address\r
887 or the multicast MAC address.\r
888 R_Mcast_Buf: See definition in UNDI RESET ADAPTER (0004h).\r
889 Returned from API service\r
890 Status: See the PXENV_STATUS_xxx constants.\r
891 \r
892 @param SimpleNetworkDevice Device instance\r
893 @param PxeUndiTable Point to structure which hold paramter and return value \r
894 for option ROM call.\r
895 \r
896 @return Return value of PXE option ROM far call. \r
897**/\r
898EFI_STATUS\r
899PxeUndiOpen (\r
900 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
901 IN OUT PXENV_UNDI_OPEN_T *PxeUndiTable\r
902 )\r
903;\r
904\r
905/**\r
906 PXE \r
907 UNDI CLOSE\r
908 Op-Code: PXENV_UNDI_CLOSE (0007h)\r
909 Input: Far pointer to a PXENV_UNDI_CLOSE_T parameter.\r
910 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
911 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
912 constants.\r
913 Description: This call disconnects the network adapter from the network. Packets cannot be transmitted or\r
914 received until the network adapter is open again.\r
915 typedef struct {\r
916 PXENV_STATUS Status;\r
917 } PXENV_UNDI_CLOSE_T;\r
918 Set before calling API service\r
919 N/A\r
920 Returned from API service\r
921 Status: See the PXENV_STATUS_xxx constants.\r
922 \r
923 @param SimpleNetworkDevice Device instance\r
924 @param PxeUndiTable Point to structure which hold paramter and return value \r
925 for option ROM call.\r
926 \r
927 @return Return value of PXE option ROM far call. \r
928**/\r
929EFI_STATUS\r
930PxeUndiClose (\r
931 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
932 IN OUT PXENV_UNDI_CLOSE_T *PxeUndiTable\r
933 )\r
934;\r
935\r
936/**\r
937 PXE \r
938 UNDI TRANSMIT PACKET\r
939 Op-Code: PXENV_UNDI_TRANSMIT (0008h)\r
940 Input: Far pointer to a PXENV_UNDI_TRANSMIT_T parameter structure that\r
941 has been initialized by the caller.\r
942 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX.\r
943 The status code must be set to one of the values represented by the\r
944 PXENV_STATUS_xxx constants.\r
945 Description: This call transmits a buffer to the network. The media header\r
946 for the packet can be filled by the calling protocol, but it might not be.\r
947 The network adapter driver will fill it if required by the values in the\r
948 parameter block. The packet is buffered for transmission provided there is\r
949 an available buffer, and the function returns PXENV_EXIT_SUCCESS. If no\r
950 buffer is available the function returns PXENV_EXIT_FAILURE with a status\r
951 code of PXE_UNDI_STATUS__OUT OF_RESOURCE. The number of buffers is\r
952 implementation-dependent. An interrupt is generated on completion of the\r
953 transmission of one or more packets. A call to PXENV_UNDI_TRANSMIT is\r
954 permitted in the context of a transmit complete interrupt.\r
955\r
956 typedef struct {\r
957 PXENV_STATUS Status;\r
958 UINT8 Protocol;\r
959 #define P_UNKNOWN 0\r
960 #define P_IP 1\r
961 #define P_ARP 2\r
962 #define P_RARP 3\r
963 UINT8 XmitFlag;\r
964 #define XMT_DESTADDR 0x0000\r
965 #define XMT_BROADCAST 0x0001\r
966 SEGOFF16 DestAddr;\r
967 SEGOFF16 TBD;\r
968 UINT32 Reserved[2];\r
969 } t_PXENV_UNDI_TRANSMIT;\r
970\r
971 #define MAX_DATA_BLKS 8\r
972\r
973 typedef struct {\r
974 UINT16 ImmedLength;\r
975 SEGOFF16 Xmit;\r
976 UINT16 DataBlkCount;\r
977 struct DataBlk {\r
978 UINT8 TDPtrType;\r
979 UINT8 TDRsvdByte;\r
980 UINT16 TDDataLen;\r
981 SEGOFF16 TDDataPtr;\r
982 } DataBlock[MAX_DATA_BLKS];\r
983 } PXENV_UNDI_TBD_T\r
984\r
985 Set before calling API service\r
986 Protocol: This is the protocol of the upper layer that is calling UNDI\r
987 TRANSMIT call. If the upper layer has filled the media header, this\r
988 field must be P_UNKNOWN.\r
989 XmitFlag: If this flag is XMT_DESTADDR, the NIC driver expects a\r
990 pointer to the destination media address in the field DestAddr. If\r
991 XMT_BROADCAST, the NIC driver fills the broadcast address for the\r
992 destination.\r
993 TBD: Segment:Offset address of the transmit buffer descriptor.\r
994 ImmedLength: Length of the immediate transmit buffer: Xmit.\r
995 Xmit: Segment:Offset of the immediate transmit buffer.\r
996 DataBlkCount: Number of blocks in this transmit buffer.\r
997 TDPtrType:\r
998 0 => 32-bit physical address in TDDataPtr (not supported in this\r
999 version of PXE)\r
1000 1 => segment:offset in TDDataPtr which can be a real mode or 16-bit\r
1001 protected mode pointer\r
1002 TDRsvdByte: Reserved must be zero.\r
1003 TDDatalen: Data block length in bytes.\r
1004 TDDataPtr: Segment:Offset of the transmit block.\r
1005 DataBlock: Array of transmit data blocks.\r
1006 Returned from API service\r
1007 Status: See the PXENV_STATUS_xxx constants \r
1008 \r
1009 @param SimpleNetworkDevice Device instance\r
1010 @param PxeUndiTable Point to structure which hold paramter and return value \r
1011 for option ROM call.\r
1012 \r
1013 @return Return value of PXE option ROM far call. \r
1014**/\r
1015EFI_STATUS\r
1016PxeUndiTransmit (\r
1017 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1018 IN OUT PXENV_UNDI_TRANSMIT_T *PxeUndiTable\r
1019 )\r
1020;\r
1021\r
1022/**\r
1023 PXE \r
1024 UNDI SET MULTICAST ADDRESS\r
1025 Op-Code: PXENV_UNDI_SET_MCAST_ADDRESS (0009h)\r
1026 Input: Far pointer to a PXENV_TFTP_SET_MCAST_ADDRESS_t parameter structure that has been\r
1027 initialized by the caller.\r
1028 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1029 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1030 constants.\r
1031 Description: This call changes the current list of multicast addresses to the input list and resets the network\r
1032 adapter to accept it. If the number of multicast addresses is zero, multicast is disabled.\r
1033 typedef struct {\r
1034 PXENV_STATUS Status;\r
1035 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;\r
1036 } PXENV_UNDI_SET_MCAST_ADDR_T;\r
1037 Set before calling API service\r
1038 R_Mcast_Buf: See description in the UNDI RESET ADAPTER\r
1039 (0004h) API.\r
1040 Returned from API service\r
1041 Status: See the PXENV_STATUS_xxx constants \r
1042 \r
1043 @param SimpleNetworkDevice Device instance\r
1044 @param PxeUndiTable Point to structure which hold paramter and return value \r
1045 for option ROM call.\r
1046 \r
1047 @return Return value of PXE option ROM far call. \r
1048**/\r
1049EFI_STATUS\r
1050PxeUndiSetMcastAddr (\r
1051 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1052 IN OUT PXENV_UNDI_SET_MCAST_ADDR_T *PxeUndiTable\r
1053 )\r
1054;\r
1055\r
1056/**\r
1057 PXE \r
1058 UNDI SET STATION ADDRESS\r
1059 Op-Code: PXENV_UNDI_SET_STATION_ADDRESS (000Ah)\r
1060 Input: Far pointer to a PXENV_UNDI_SET_STATION_ADDRESS_t parameter structure that has been\r
1061 initialized by the caller.\r
1062 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1063 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1064 constants.\r
1065 Description: This call sets the MAC address to be the input value and is called before opening the network\r
1066 adapter. Later, the open call uses this variable as a temporary MAC address to program the\r
1067 adapter individual address registers.\r
1068 typedef struct {\r
1069 PXENV_STATUS Status;\r
1070 MAC_ADDR StationAddress;\r
1071 } PXENV_UNDI_SET_STATION_ADDR_T;\r
1072 Set before calling API service\r
1073 StationAddress: Temporary MAC address to be used for\r
1074 transmit and receive.\r
1075 Returned from API service\r
1076 Status: See the PXENV_STATUS_xxx constants. \r
1077 \r
1078 @param SimpleNetworkDevice Device instance\r
1079 @param PxeUndiTable Point to structure which hold paramter and return value \r
1080 for option ROM call.\r
1081 \r
1082 @return Return value of PXE option ROM far call. \r
1083**/\r
1084EFI_STATUS\r
1085PxeUndiSetStationAddr (\r
1086 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1087 IN OUT PXENV_UNDI_SET_STATION_ADDR_T *PxeUndiTable\r
1088 )\r
1089;\r
1090\r
1091/**\r
1092 PXE \r
1093 UNDI SET PACKET FILTER\r
1094 Op-Code: PXENV_UNDI_SET_PACKET_FILTER (000Bh)\r
1095 Input: Far pointer to a PXENV_UNDI_SET_PACKET_FILTER_T parameter structure that has been\r
1096 initialized by the caller.\r
1097 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1098 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1099 constants.\r
1100 Description: This call resets the adapter's receive unit to accept a new filter, different from the one provided with\r
1101 the open call.\r
1102 typedef struct {\r
1103 PXENV_STATUS Status;\r
1104 UINT8 filter;\r
1105 } PXENV_UNDI_SET_PACKET_FILTER_T;\r
1106 Set before calling API service\r
1107 Filter: See the receive filter values in the UNDI OPEN\r
1108 (0006h) API description.\r
1109 Returned from API service\r
1110 Status: See the PXENV_STATUS_xxx constants. \r
1111 \r
1112 @param SimpleNetworkDevice Device instance\r
1113 @param PxeUndiTable Point to structure which hold paramter and return value \r
1114 for option ROM call.\r
1115 \r
1116 @return Return value of PXE option ROM far call. \r
1117**/\r
1118EFI_STATUS\r
1119PxeUndiSetPacketFilter (\r
1120 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1121 IN OUT PXENV_UNDI_SET_PACKET_FILTER_T *PxeUndiTable\r
1122 )\r
1123;\r
1124\r
1125/**\r
1126 PXE \r
1127 UNDI GET INFORMATION\r
1128 Op-Code: PXENV_UNDI_GET_INFORMATION (000Ch)\r
1129 Input: Far pointer to a PXENV_UNDI_GET_INFORMATION_T parameter structure that has been\r
1130 initialized by the caller.\r
1131 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1132 the parameter structure must be set to one of the values represented by the\r
1133 PXENV_STATUS_xxx constants.\r
1134 Description: This call copies the network adapter variables, including the MAC address, into the input buffer.\r
1135 Note: The PermNodeAddress field must be valid after PXENV_START_UNDI and\r
1136 PXENV_UNDI_STARTUP have been issued. All other fields must be valid after\r
1137 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE have been\r
1138 called.\r
1139 typedef struct {\r
1140 PXENV_STATUS Status;\r
1141 UINT16 BaseIo;\r
1142 UINT16 IntNumber;\r
1143 UINT16 MaxTranUnit;\r
1144 UINT16 HwType;\r
1145 #define ETHER_TYPE 1\r
1146 #define EXP_ETHER_TYPE 2\r
1147 #define IEEE_TYPE 6\r
1148 #define ARCNET_TYPE 7\r
1149 UINT16 HwAddrLen;\r
1150 MAC_ADDR CurrentNodeAddress;\r
1151 MAC_ADDR PermNodeAddress;\r
1152 SEGSEL ROMAddress;\r
1153 UINT16 RxBufCt;\r
1154 UINT16 TxBufCt;\r
1155 } PXENV_UNDI_GET_INFORMATION_T;\r
1156 Set before calling API service\r
1157 N/A\r
1158 Returned from API service\r
1159 Status: See the PXENV_STATUS_xxx constants.\r
1160 BaseIO: Adapter base I/O address.\r
1161 IntNumber: Adapter IRQ number.\r
1162 MaxTranUnit: Adapter maximum transmit unit.\r
1163 HWType: Type of protocol at the hardware level.\r
1164 HWAddrLen: Length of the hardware address.\r
1165 CurrentNodeAddress: Current hardware address.\r
1166 PermNodeAddress: Permanent hardware address.\r
1167 ROMAddress: Real mode ROM segment address.\r
1168 RxBufCnt: Receive queue length.\r
1169 TxBufCnt: Transmit queue length. \r
1170 \r
1171 @param SimpleNetworkDevice Device instance\r
1172 @param PxeUndiTable Point to structure which hold paramter and return value \r
1173 for option ROM call.\r
1174 \r
1175 @return Return value of PXE option ROM far call. \r
1176**/\r
1177EFI_STATUS\r
1178PxeUndiGetInformation (\r
1179 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1180 IN OUT PXENV_UNDI_GET_INFORMATION_T *PxeUndiTable\r
1181 )\r
1182;\r
1183\r
1184/**\r
1185 PXE \r
1186 UNDI GET STATISTICS\r
1187 Op-Code: PXENV_UNDI_GET_STATISTICS (000Dh)\r
1188 Input: Far pointer to a PXENV_UNDI_GET_STATISTICS_T parameter structure that has been initialized\r
1189 by the caller.\r
1190 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1191 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1192 constants.\r
1193 Description: This call reads statistical information from the network adapter, and returns.\r
1194 typedef struct {\r
1195 PXENV_STATUS Status;\r
1196 UINT32 XmtGoodFrames;\r
1197 UINT32 RcvGoodFrames;\r
1198 UINT32 RcvCRCErrors;\r
1199 UINT32 RcvResourceErrors;\r
1200 } PXENV_UNDI_GET_STATISTICS_T;\r
1201 Set before calling API service\r
1202 N/A\r
1203 Returned from API service\r
1204 Status: See the PXENV_STATUS_xxx constants.\r
1205 XmtGoodFrames: Number of successful transmissions.\r
1206 RcvGoodFrames: Number of good frames received.\r
1207 RcvCRCErrors: Number of frames received with CRC\r
1208 error.\r
1209 RcvResourceErrors: Number of frames discarded\r
1210 because receive queue was full.\r
1211 \r
1212 @param SimpleNetworkDevice Device instance\r
1213 @param PxeUndiTable Point to structure which hold paramter and return value \r
1214 for option ROM call.\r
1215 \r
1216 @return Return value of PXE option ROM far call. \r
1217**/\r
1218EFI_STATUS\r
1219PxeUndiGetStatistics (\r
1220 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1221 IN OUT PXENV_UNDI_GET_STATISTICS_T *PxeUndiTable\r
1222 )\r
1223;\r
1224\r
1225/**\r
1226 PXE \r
1227 UNDI CLEAR STATISTICS\r
1228 Op-Code: PXENV_UNDI_CLEAR_STATISTICS (000Eh)\r
1229 Input: Far pointer to a PXENV_UNDI_CLEAR_STATISTICS_T parameter.\r
1230 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1231 the parameter structure must be set to one of the values represented by the\r
1232 PXENV_STATUS_xxx constants.\r
1233 Description: This call clears the statistical information from the network adapter.\r
1234 typedef struct {\r
1235 PXENV_STATUS Status;\r
1236 } PXENV_UNDI_CLEAR_STATISTICS_T;\r
1237 Set before calling API service\r
1238 N/A\r
1239 Returned from API service\r
1240 Status: See the PXENV_STATUS_xxx constants.\r
1241 \r
1242 @param SimpleNetworkDevice Device instance\r
1243 @param PxeUndiTable Point to structure which hold paramter and return value \r
1244 for option ROM call.\r
1245 \r
1246 @return Return value of PXE option ROM far call. \r
1247**/\r
1248EFI_STATUS\r
1249PxeUndiClearStatistics (\r
1250 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1251 IN OUT PXENV_UNDI_CLEAR_STATISTICS_T *PxeUndiTable\r
1252 )\r
1253;\r
1254\r
1255/**\r
1256 PXE \r
1257 UNDI INITIATE DIAGS\r
1258 Op-Code: PXENV_UNDI_INITIATE_DIAGS (000Fh)\r
1259 Input: Far pointer to a PXENV_UNDI_INITIATE_DIAGS_T parameter.\r
1260 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1261 the parameter structure must be set to one of the values represented by the\r
1262 PXENV_STATUS_xxx constants.\r
1263 Description: This call can be used to initiate the run-time diagnostics. It causes the network adapter to run\r
1264 hardware diagnostics and to update its status information.\r
1265 typedef struct {\r
1266 PXENV_STATUS Status;\r
1267 } PXENV_UNDI_INITIATE_DIAGS_T;\r
1268 Set before calling API service\r
1269 N/A\r
1270 Returned from API service\r
1271 Status: See the PXENV_STATUS_xxx constants. \r
1272 \r
1273 @param SimpleNetworkDevice Device instance\r
1274 @param PxeUndiTable Point to structure which hold paramter and return value \r
1275 for option ROM call.\r
1276 \r
1277 @return Return value of PXE option ROM far call. \r
1278**/\r
1279EFI_STATUS\r
1280PxeUndiInitiateDiags (\r
1281 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1282 IN OUT PXENV_UNDI_INITIATE_DIAGS_T *PxeUndiTable\r
1283 )\r
1284;\r
1285\r
1286/**\r
1287 PXE \r
1288 UNDI FORCE INTERRUPT\r
1289 Op-Code: PXENV_UNDI_FORCE_INTERRUPT (0010h)\r
1290 Input: Far pointer to a PXENV_UNDI_FORCE_INTERRUPT_T parameter structure that has been\r
1291 initialized by the caller.\r
1292 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1293 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1294 constants.\r
1295 Description: This call forces the network adapter to generate an interrupt. When a receive interrupt occurs, the\r
1296 network adapter driver usually queues the packet and calls the application's callback receive\r
1297 routine with a pointer to the packet received. Then, the callback routine either can copy the packet\r
1298 to its buffer or can decide to delay the copy to a later time. If the packet is not immediately copied,\r
1299 the network adapter driver does not remove it from the input queue. When the application wants to\r
1300 copy the packet, it can call the PXENV_UNDI_FORCE_INTERRUPT routine to simulate the receive\r
1301 interrupt.\r
1302 typedef struct {\r
1303 PXENV_STATUS Status;\r
1304 } PXENV_UNDI_FORCE_INTERRUPT_T;\r
1305 Set before calling API service\r
1306 N/A\r
1307 Returned from API service\r
1308 Status: See the PXENV_STATUS_xxx constants. \r
1309 \r
1310 @param SimpleNetworkDevice Device instance\r
1311 @param PxeUndiTable Point to structure which hold paramter and return value \r
1312 for option ROM call.\r
1313 \r
1314 @return Return value of PXE option ROM far call. \r
1315**/\r
1316EFI_STATUS\r
1317PxeUndiForceInterrupt (\r
1318 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1319 IN OUT PXENV_UNDI_FORCE_INTERRUPT_T *PxeUndiTable\r
1320 )\r
1321;\r
1322\r
1323/**\r
1324 PXE \r
1325 UNDI GET MULTICAST ADDRESS\r
1326 Op-Code: PXENV_UNDI_GET_MCAST_ADDRESS (0011h)\r
1327 Input: Far pointer to a PXENV_GET_MCAST_ADDRESS_t parameter structure that has been initialized\r
1328 by the caller.\r
1329 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1330 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1331 constants.\r
1332 Description: This call converts the given IP multicast address to a hardware multicast address.\r
1333 typedef struct {\r
1334 PXENV_STATUS Status;\r
1335 IP4 InetAddr;\r
1336 MAC_ADDR MediaAddr;\r
1337 } PXENV_UNDI_GET_MCAST_ADDR_T;\r
1338 Set before calling API service\r
1339 InetAddr: IP multicast address.\r
1340 Returned from API service\r
1341 Status: See the PXENV_STATUS_xxx constants.\r
1342 MediaAddr: MAC multicast address.\r
1343 \r
1344 @param SimpleNetworkDevice Device instance\r
1345 @param PxeUndiTable Point to structure which hold paramter and return value \r
1346 for option ROM call.\r
1347 \r
1348 @return Return value of PXE option ROM far call. \r
1349**/\r
1350EFI_STATUS\r
1351PxeUndiGetMcastAddr (\r
1352 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1353 IN OUT PXENV_UNDI_GET_MCAST_ADDR_T *PxeUndiTable\r
1354 )\r
1355;\r
1356\r
1357/**\r
1358 PXE \r
1359 UNDI GET NIC TYPE\r
1360 Op-Code: PXENV_UNDI_GET_NIC_TYPE (0012h)\r
1361 Input: Far pointer to a PXENV_UNDI_GET_NIC_TYPE_T parameter structure that has been initialized by\r
1362 the caller.\r
1363 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1364 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1365 constants. If the PXENV_EXIT_SUCCESS is returned the parameter structure must contain the\r
1366 NIC information.\r
1367 Description: This call, if successful, provides the NIC-specific information necessary to identify the network\r
1368 adapter that is used to boot the system.\r
1369 Note: The application first gets the DHCPDISCOVER packet using GET_CACHED_INFO and checks if\r
1370 the UNDI is supported before making this call. If the UNDI is not supported, the NIC-specific\r
1371 information can be obtained from the DHCPDISCOVER packet itself.\r
1372 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called\r
1373 before the information provided is valid.\r
1374 typedef {\r
1375 PXENV_STATUS Status;\r
1376 UINT8 NicType;\r
1377 #define PCI_NIC 2\r
1378 #define PnP_NIC 3\r
1379 #define CardBus_NIC 4\r
1380 Union {\r
1381 Struct {\r
1382 UINT16 Vendor_ID;\r
1383 UINT16 Dev_ID;\r
1384 UINT8 Base_Class;\r
1385 UINT8 Sub_Class;\r
1386 UINT8 Prog_Intf;\r
1387 UINT8 Rev;\r
1388 UINT16 BusDevFunc;\r
1389 UINT16 SubVendor_ID;\r
1390 UINT16 SubDevice_ID;\r
1391 } pci, cardbus;\r
1392 struct {\r
1393 UINT32 EISA_Dev_ID;\r
1394 UINT8 Base_Class;\r
1395 UINT8 Sub_Class;\r
1396 UINT8 Prog_Intf;\r
1397 UINT16 CardSelNum;\r
1398 } pnp;\r
1399 } info;\r
1400 } PXENV_UNDI_GET_NIC_TYPE_T;\r
1401 Set before calling API service\r
1402 N/A\r
1403 Returned from API service\r
1404 Status: See the PXENV_STATUS_xxx constants.\r
1405 NICType: Type of NIC information stored in the parameter\r
1406 structure.\r
1407 Info: Information about the fields in this union can be found\r
1408 in the [PnP] and [PCI] specifications \r
1409 \r
1410 @param SimpleNetworkDevice Device instance\r
1411 @param PxeUndiTable Point to structure which hold paramter and return value \r
1412 for option ROM call.\r
1413 \r
1414 @return Return value of PXE option ROM far call. \r
1415**/\r
1416EFI_STATUS\r
1417PxeUndiGetNicType (\r
1418 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1419 IN OUT PXENV_UNDI_GET_NIC_TYPE_T *PxeUndiTable\r
1420 )\r
1421;\r
1422\r
1423/**\r
1424 PXE \r
1425 UNDI GET IFACE INFO\r
1426 Op-Code: PXENV_UNDI_GET_IFACE_INFO (0013h)\r
1427 Input: Far pointer to a PXENV_UNDI_GET_IFACE_INFO_t parameter structure that has been initialized\r
1428 by the caller.\r
1429 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1430 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1431 constants. If the PXENV_EXIT_SUCCESS is returned, the parameter structure must contain the\r
1432 interface specific information.\r
1433 Description: This call, if successful, provides the network interface specific information such as the interface\r
1434 type at the link layer (Ethernet, Tokenring) and the link speed. This information can be used in the\r
1435 universal drivers such as NDIS or Miniport to communicate to the upper protocol modules.\r
1436 Note: UNDI follows the NDIS2 specification in giving this information. It is the responsibility of the\r
1437 universal driver to translate/convert this information into a format that is required in its specification\r
1438 or to suit the expectation of the upper level protocol modules.\r
1439 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called\r
1440 before the information provided is valid.\r
1441 typedef struct {\r
1442 PXENV_STATUS Status\r
1443 UINT8 IfaceType[16];\r
1444 UINT32 LinkSpeed;\r
1445 UINT32 ServiceFlags;\r
1446 UINT32 Reserved[4];\r
1447 } PXENV_UNDI_GET_NDIS_INFO_T;\r
1448 Set before calling API service\r
1449 N/A\r
1450 Returned from API service\r
1451 Status: See the PXENV_STATUS_xxx constants.\r
1452 IfaceType: Name of MAC type in ASCIIZ format. This is\r
1453 used by the universal NDIS driver to specify its driver type\r
1454 to the protocol driver.\r
1455 LinkSpeed: Defined in the NDIS 2.0 specification.\r
1456 ServiceFlags: Defined in the NDIS 2.0 specification.\r
1457 Reserved: Must be zero. \r
1458 \r
1459 @param SimpleNetworkDevice Device instance\r
1460 @param PxeUndiTable Point to structure which hold paramter and return value \r
1461 for option ROM call.\r
1462 \r
1463 @return Return value of PXE option ROM far call. \r
1464**/\r
1465EFI_STATUS\r
1466PxeUndiGetNdisInfo (\r
1467 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1468 IN OUT PXENV_UNDI_GET_NDIS_INFO_T *PxeUndiTable\r
1469 )\r
1470;\r
1471\r
1472/**\r
1473 PXE \r
1474 UNDI ISR\r
1475 Op-Code: PXENV_UNDI_ISR (0014h)\r
1476 Input: Far pointer to a PXENV_UNDI_ISR_T parameter structure that has been initialized by the caller.\r
1477 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1478 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1479 constants.\r
1480 Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in\r
1481 the parameter block indicates the operation to be performed for the call. This field is filled with the\r
1482 status of that operation on return.\r
1483 Note: Interrupt Service Routine Operation:\r
1484 In this design the UNDI does not hook the interrupt for the Network Interface. Instead, the\r
1485 application or the protocol driver hooks the interrupt and calls UNDI with the PXENV_UNDI_ISR\r
1486 API call for interrupt verification (PXENV_UNDI_ISR_IN_START) and processing\r
1487 (PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_GET_NEXT).\r
1488 When the Network Interface HW generates an interrupt the protocol driver interrupt service\r
1489 routine (ISR) gets control and takes care of the interrupt processing at the PIC level. The ISR then\r
1490 calls the UNDI using the PXENV_UNDI_ISR API with the value PXENV_UNDI_ISR_IN_START for\r
1491 the FuncFlag parameter. At this time UNDI must disable the interrupts at the Network Interface\r
1492 level and read any status values required to further process the interrupt. UNDI must return as\r
1493 quickly as possible with one of the two values, PXENV_UNDI_ISR_OUT_OURS or\r
1494 PXENV_UNDI_ISR_OUT_NOT_OURS, for the parameter FuncFlag depending on whether the\r
1495 interrupt was generated by this particular Network Interface or not.\r
1496 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_NOT_OURS, then the interrupt was\r
1497 not generated by our NIC, and interrupt processing is complete.\r
1498 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_OURS, the protocol driver must start\r
1499 a handler thread and send an end-of-interrupt (EOI) command to the PIC. Interrupt processing is\r
1500 now complete.\r
1501 The protocol driver strategy routine will call UNDI using this same API with FuncFlag equal to\r
1502 PXENV_UNDI_ISR_IN_PROCESS. At this time UNDI must find the cause of this interrupt and\r
1503 return the status in the FuncFlag. It first checks if there is a frame received and if so it returns the\r
1504 first buffer pointer of that frame in the parameter block.\r
1505 The protocol driver calls UNDI repeatedly with the FuncFlag equal to\r
1506 PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the received\r
1507 frames in the queue. On this call, UNDI must remember the previous buffer given to the protoco,l\r
1508 remove it from the receive queue and recycle it. In case of a multi-buffered frame, if the previous\r
1509 buffer is not the last buffer in the frame it must return the next buffer in the frame in the parameter\r
1510 block. Otherwise it must return the first buffer in the next frame.\r
1511 If there is no received frame pending to be processed, UNDI processes the transmit completes and\r
1512 if there is no other interrupt status to be processed, UNDI re-enables the interrupt at the\r
1513 NETWORK INTERFACE level and returns PXENV_UNDI_ISR_OUT_DONE in the FuncFlag.\r
1514 IMPORTANT: It is possible for the protocol driver to be interrupted again while in the\r
1515 strategy routine when the UNDI re-enables interrupts. \r
1516 \r
1517 @param SimpleNetworkDevice Device instance\r
1518 @param PxeUndiTable Point to structure which hold paramter and return value \r
1519 for option ROM call.\r
1520 \r
1521 @return Return value of PXE option ROM far call. \r
1522**/\r
1523EFI_STATUS\r
1524PxeUndiIsr (\r
1525 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1526 IN OUT PXENV_UNDI_ISR_T *PxeUndiTable\r
1527 )\r
1528;\r
1529\r
1530/**\r
1531 PXE \r
1532 STOP UNDI\r
1533 Op-Code: PXENV_STOP_UNDI (0015h)\r
1534 Input: Far pointer to a PXENV_STOP_UNDI_T parameter structure that has been initialized by the caller.\r
1535 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1536 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1537 constants.\r
1538 Description: This routine is responsible for unhooking the Int 1Ah service routine.\r
1539 Note: This API service must be called only once at the end of UNDI Option ROM boot. One of the valid\r
1540 status codes is PXENV_STATUS_KEEP. If this status is returned, UNDI must not be removed from\r
1541 base memory. Also, UNDI must not be removed from base memory if BC is not removed from base\r
1542 memory.\r
1543 Service cannot be used in protected mode.\r
1544 typedef struct {\r
1545 PXENV_STATUS Status;\r
1546 } PXENV_STOP_UNDI_T;\r
1547 Set before calling API service\r
1548 N/A\r
1549 Returned from API service\r
1550 Status: See the PXENV_STATUS_xxx constants. \r
1551 \r
1552 @param SimpleNetworkDevice Device instance\r
1553 @param PxeUndiTable Point to structure which hold paramter and return value \r
1554 for option ROM call.\r
1555 \r
1556 @return Return value of PXE option ROM far call. \r
1557**/\r
1558EFI_STATUS\r
1559PxeUndiStop (\r
1560 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1561 IN OUT PXENV_STOP_UNDI_T *PxeUndiTable\r
1562 )\r
1563;\r
1564\r
1565/**\r
1566 PXE \r
1567 UNDI GET STATE\r
1568 Op-Code: PXENV_UNDI_GET_STATE (0015h)\r
1569 Input: Far pointer to a PXENV_UNDI_GET_STATE_T parameter.\r
1570 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1571 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1572 constants. The UNDI_STATE field in the parameter structure must be set to one of the valid state\r
1573 constants\r
1574 Description: This call can be used to obtain state of the UNDI engine in order to avoid issuing adverse call\r
1575 sequences\r
1576 typedef struct {\r
1577 #define PXE_UNDI_GET_STATE_STARTED 1\r
1578 #define PXE_UNDI_GET_STATE_INITIALIZED 2\r
1579 #define PXE_UNDI_GET_STATE_OPENED 3\r
1580 PXENV_STATUS Status;\r
1581 UINT8 UNDIstate;\r
1582 } PXENV_UNDI_GET_STATE_T;\r
1583 Set before calling API service\r
1584 N/A\r
1585 Returned from API service\r
1586 Status: See the PXENV_STATUS_xxx constants.\r
1587 State: See definitions of the state constants.\r
1588 Note. UNDI implementation is responsible for maintaining\r
1589 internal state machine.\r
1590 UNDI ISR\r
1591 Op-Code: PXENV_UNDI_ISR (0014h)\r
1592 Input: Far pointer to a t_PXENV_UNDI_ISR parameter structure that has been initialized by the caller.\r
1593 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
1594 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
1595 constants.\r
1596 Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in\r
1597 the parameter block indicates the operation to be performed for the call. This field is filled with the\r
1598 status of that operation on return. \r
1599 \r
1600 @param SimpleNetworkDevice Device instance\r
1601 @param PxeUndiTable Point to structure which hold paramter and return value \r
1602 for option ROM call.\r
1603 \r
1604 @return Return value of PXE option ROM far call. \r
1605**/\r
1606EFI_STATUS\r
1607PxeUndiGetState (\r
1608 IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1609 IN OUT PXENV_UNDI_GET_STATE_T *PxeUndiTable\r
1610 )\r
1611;\r
1612\r
1613/**\r
1614 Effect the Far Call into the PXE Layer\r
1615\r
1616 Note: When using a 32-bit stack segment do not push 32-bit words onto the stack. The PXE API\r
1617 services will not work, unless there are three 16-bit parameters pushed onto the stack.\r
1618 push DS ;Far pointer to parameter structure\r
1619 push offset pxe_data_call_struct ;is pushed onto stack.\r
1620 push Index ;UINT16 is pushed onto stack.\r
1621 call dword ptr (s_PXE ptr es:[di]).EntryPointSP\r
1622 add sp, 6 ;Caller cleans up stack. \r
1623\r
1624 @param SimpleNetworkDevice Device instance for simple network\r
1625 @param Table Point to parameter/retun value table for legacy far call\r
1626 @param TableSize The size of paramter/return value table\r
1627 @param CallIndex The index of legacy call.\r
1628 \r
1629 @return EFI_STATUS \r
1630**/\r
1631EFI_STATUS\r
1632MakePxeCall (\r
1633 EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
1634 IN OUT VOID *Table,\r
1635 IN UINTN TableSize,\r
1636 IN UINT16 CallIndex\r
1637 )\r
1638;\r
1639\r
1640/**\r
1641 Allocate buffer below 1M for real mode.\r
1642\r
1643 @param NumPages The number pages want to be allocated.\r
1644 @param Buffer On return, allocated buffer.\r
1645 \r
1646 @return Status of allocating pages.\r
1647**/\r
1648EFI_STATUS\r
1649BiosSnp16AllocatePagesBelowOneMb (\r
1650 UINTN NumPages,\r
1651 VOID **Buffer\r
1652 )\r
1653;\r
1654\r
1655#endif\r