3 Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _BIOS_SNP_16_H_
10 #define _BIOS_SNP_16_H_
14 #include <Protocol/LegacyBios.h>
15 #include <Protocol/SimpleNetwork.h>
16 #include <Protocol/PciIo.h>
17 #include <Protocol/NetworkInterfaceIdentifier.h>
18 #include <Protocol/DevicePath.h>
20 #include <Library/UefiDriverEntryPoint.h>
21 #include <Library/DebugLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/UefiBootServicesTableLib.h>
24 #include <Library/UefiLib.h>
25 #include <Library/BaseLib.h>
26 #include <Library/DevicePathLib.h>
27 #include <Library/MemoryAllocationLib.h>
29 #include <Guid/EventGroup.h>
31 #include <IndustryStandard/Pci.h>
36 // BIOS Simple Network Protocol Device Structure
38 #define EFI_SIMPLE_NETWORK_DEV_SIGNATURE SIGNATURE_32 ('s', 'n', '1', '6')
40 #define INIT_PXE_STATUS 0xabcd
42 #define EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE 64
47 VOID
* Data
[EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE
];
48 } EFI_SIMPLE_NETWORK_DEV_FIFO
;
53 EFI_SIMPLE_NETWORK_PROTOCOL SimpleNetwork
;
54 EFI_SIMPLE_NETWORK_MODE SimpleNetworkMode
;
55 EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL Nii
;
56 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
57 EFI_PCI_IO_PROTOCOL
*PciIo
;
58 EFI_LEGACY_BIOS_PROTOCOL
*LegacyBios
;
61 // Local Data for Simple Network Protocol interface goes here
64 EFI_EVENT EfiBootEvent
;
65 EFI_EVENT LegacyBootEvent
;
66 UINT16 PxeEntrySegment
;
67 UINT16 PxeEntryOffset
;
68 EFI_SIMPLE_NETWORK_DEV_FIFO TxBufferFifo
;
69 EFI_DEVICE_PATH_PROTOCOL
*BaseDevicePath
;
70 PXE_T
*Pxe
; ///< Pointer to !PXE structure
71 PXENV_UNDI_GET_INFORMATION_T GetInformation
; ///< Data from GET INFORMATION
72 PXENV_UNDI_GET_NIC_TYPE_T GetNicType
; ///< Data from GET NIC TYPE
73 PXENV_UNDI_GET_NDIS_INFO_T GetNdisInfo
; ///< Data from GET NDIS INFO
74 BOOLEAN IsrValid
; ///< TRUE if Isr contains valid data
75 PXENV_UNDI_ISR_T Isr
; ///< Data from ISR
76 PXENV_UNDI_TBD_T
*Xmit
; //
77 VOID
*TxRealModeMediaHeader
; ///< < 1 MB Size = 0x100
78 VOID
*TxRealModeDataBuffer
; ///< < 1 MB Size = GetInformation.MaxTranUnit
79 VOID
*TxDestAddr
; ///< < 1 MB Size = 16
80 UINT8 InterruptStatus
; ///< returned/cleared by GetStatus, set in ISR
81 UINTN UndiLoaderTablePages
;
82 UINTN DestinationDataSegmentPages
;
83 UINTN DestinationStackSegmentPages
;
84 UINTN DestinationCodeSegmentPages
;
85 VOID
*UndiLoaderTable
;
86 VOID
*DestinationDataSegment
;
87 VOID
*DestinationStackSegment
;
88 VOID
*DestinationCodeSegment
;
89 } EFI_SIMPLE_NETWORK_DEV
;
91 #define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) \
93 EFI_SIMPLE_NETWORK_DEV, \
95 EFI_SIMPLE_NETWORK_DEV_SIGNATURE \
101 extern EFI_DRIVER_BINDING_PROTOCOL gBiosSnp16DriverBinding
;
102 extern EFI_COMPONENT_NAME_PROTOCOL gBiosSnp16ComponentName
;
103 extern EFI_COMPONENT_NAME2_PROTOCOL gBiosSnp16ComponentName2
;
107 // Driver Binding Protocol functions
110 Tests to see if this driver supports a given controller.
112 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
113 @param Controller The handle of the controller to test.
114 @param RemainingDevicePath A pointer to the remaining portion of a device path.
116 @retval EFI_SUCCESS The driver supports given controller.
117 @retval EFI_UNSUPPORT The driver doesn't support given controller.
118 @retval Other Other errors prevent driver finishing to test
119 if the driver supports given controller.
123 BiosSnp16DriverBindingSupported (
124 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
125 IN EFI_HANDLE Controller
,
126 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
131 Starts the Snp device controller
133 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
134 @param Controller The handle of the controller to test.
135 @param RemainingDevicePath A pointer to the remaining portion of a device path.
137 @retval EFI_SUCCESS - The device was started.
138 @retval EFI_DEVICE_ERROR - The device could not be started due to a device error.
139 @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.
143 BiosSnp16DriverBindingStart (
144 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
145 IN EFI_HANDLE Controller
,
146 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
151 Stops the device by given device controller.
153 @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
154 @param Controller The handle of the controller to test.
155 @param NumberOfChildren The number of child device handles in ChildHandleBuffer.
156 @param ChildHandleBuffer An array of child handles to be freed. May be NULL if
157 NumberOfChildren is 0.
159 @retval EFI_SUCCESS - The device was stopped.
160 @retval EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
164 BiosSnp16DriverBindingStop (
165 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
166 IN EFI_HANDLE Controller
,
167 IN UINTN NumberOfChildren
,
168 IN EFI_HANDLE
*ChildHandleBuffer
173 // Simple Network Protocol functions
176 Call 16 bit UNDI ROM to start the network interface
178 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
180 @retval EFI_DEVICE_ERROR Network interface has not be initialized.
181 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
182 @retval EFI_SUCESS Success operation.
186 Undi16SimpleNetworkStart (
187 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
192 Call 16 bit UNDI ROM to stop the network interface
194 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
196 @retval EFI_DEVICE_ERROR Network interface has not be initialized.
197 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
198 @retval EFI_SUCESS Success operation.
202 Undi16SimpleNetworkStop (
203 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
208 Initialize network interface
210 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
211 @param ExtraRxBufferSize The size of extra request receive buffer.
212 @param ExtraTxBufferSize The size of extra request transmit buffer.
214 @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.
215 @retval EFI_SUCESS Success operation.
219 Undi16SimpleNetworkInitialize (
220 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
221 IN UINTN ExtraRxBufferSize OPTIONAL
,
222 IN UINTN ExtraTxBufferSize OPTIONAL
227 Reset network interface.
229 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
230 @param ExtendedVerification Need extended verfication.
232 @retval EFI_INVALID_PARAMETER Invalid This parameter.
233 @retval EFI_DEVICE_ERROR Network device has not been initialized.
234 @retval EFI_NOT_STARTED Network device has been stopped.
235 @retval EFI_DEVICE_ERROR Invalid status for network device
236 @retval EFI_SUCCESS Success operation.
240 Undi16SimpleNetworkReset (
241 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
242 IN BOOLEAN ExtendedVerification
247 Shutdown network interface.
249 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
251 @retval EFI_INVALID_PARAMETER Invalid This parameter.
252 @retval EFI_DEVICE_ERROR Network device has not been initialized.
253 @retval EFI_NOT_STARTED Network device has been stopped.
254 @retval EFI_DEVICE_ERROR Invalid status for network device
255 @retval EFI_SUCCESS Success operation.
259 Undi16SimpleNetworkShutdown (
260 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
265 Reset network interface.
267 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
268 @param Enable Enable mask value
269 @param Disable Disable mask value
270 @param ResetMCastFilter Whether reset multi cast filter or not
271 @param MCastFilterCnt Count of mutli cast filter for different MAC address
272 @param MCastFilter Buffer for mustli cast filter for different MAC address.
274 @retval EFI_INVALID_PARAMETER Invalid This parameter.
275 @retval EFI_DEVICE_ERROR Network device has not been initialized.
276 @retval EFI_NOT_STARTED Network device has been stopped.
277 @retval EFI_DEVICE_ERROR Invalid status for network device
278 @retval EFI_SUCCESS Success operation.
282 Undi16SimpleNetworkReceiveFilters (
283 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
286 IN BOOLEAN ResetMCastFilter
,
287 IN UINTN MCastFilterCnt OPTIONAL
,
288 IN EFI_MAC_ADDRESS
* MCastFilter OPTIONAL
295 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
296 @param Reset Whether reset station MAC address to permanent address
297 @param New A pointer to New address
299 @retval EFI_INVALID_PARAMETER Invalid This parameter.
300 @retval EFI_DEVICE_ERROR Network device has not been initialized.
301 @retval EFI_NOT_STARTED Network device has been stopped.
302 @retval EFI_DEVICE_ERROR Invalid status for network device
303 @retval EFI_SUCCESS Success operation.
307 Undi16SimpleNetworkStationAddress (
308 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
310 IN EFI_MAC_ADDRESS
* New OPTIONAL
317 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
318 @param Reset Whether cleanup old statistics data.
319 @param StatisticsSize The buffer of statistics table.
320 @param StatisticsTable A pointer to statistics buffer.
322 @retval EFI_INVALID_PARAMETER Invalid This parameter.
323 @retval EFI_DEVICE_ERROR Network device has not been initialized.
324 @retval EFI_NOT_STARTED Network device has been stopped.
325 @retval EFI_DEVICE_ERROR Invalid status for network device
326 @retval EFI_SUCCESS Success operation.
330 Undi16SimpleNetworkStatistics (
331 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
333 IN OUT UINTN
*StatisticsSize OPTIONAL
,
334 OUT EFI_NETWORK_STATISTICS
* StatisticsTable OPTIONAL
339 Translate IP address to MAC address.
341 @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.
342 @param IPv6 IPv6 or IPv4
343 @param IP A pointer to given Ip address.
344 @param MAC On return, translated MAC address.
346 @retval EFI_INVALID_PARAMETER Invalid This parameter.
347 @retval EFI_INVALID_PARAMETER Invalid IP address.
348 @retval EFI_INVALID_PARAMETER Invalid return buffer for holding MAC address.
349 @retval EFI_UNSUPPORTED Do not support IPv6
350 @retval EFI_DEVICE_ERROR Network device has not been initialized.
351 @retval EFI_NOT_STARTED Network device has been stopped.
352 @retval EFI_DEVICE_ERROR Invalid status for network device
353 @retval EFI_SUCCESS Success operation.
357 Undi16SimpleNetworkMCastIpToMac (
358 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
360 IN EFI_IP_ADDRESS
*IP
,
361 OUT EFI_MAC_ADDRESS
*MAC
366 Performs read and write operations on the NVRAM device attached to a
369 @param This The protocol instance pointer.
370 @param ReadWrite TRUE for read operations, FALSE for write operations.
371 @param Offset Byte offset in the NVRAM device at which to start the read or
372 write operation. This must be a multiple of NvRamAccessSize and
374 @param BufferSize The number of bytes to read or write from the NVRAM device.
375 This must also be a multiple of NvramAccessSize.
376 @param Buffer A pointer to the data buffer.
378 @retval EFI_SUCCESS The NVRAM access was performed.
379 @retval EFI_NOT_STARTED The network interface has not been started.
380 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
381 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
382 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
387 Undi16SimpleNetworkNvData (
388 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
397 Reads the current interrupt status and recycled transmit buffer status from
400 @param This The protocol instance pointer.
401 @param InterruptStatus A pointer to the bit mask of the currently active interrupts
402 If this is NULL, the interrupt status will not be read from
403 the device. If this is not NULL, the interrupt status will
404 be read from the device. When the interrupt status is read,
405 it will also be cleared. Clearing the transmit interrupt
406 does not empty the recycled transmit buffer array.
407 @param TxBuf Recycled transmit buffer address. The network interface will
408 not transmit if its internal recycled transmit buffer array
409 is full. Reading the transmit buffer does not clear the
410 transmit interrupt. If this is NULL, then the transmit buffer
411 status will not be read. If there are no transmit buffers to
412 recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
414 @retval EFI_SUCCESS The status of the network interface was retrieved.
415 @retval EFI_NOT_STARTED The network interface has not been started.
416 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
417 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
418 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
423 Undi16SimpleNetworkGetStatus (
424 IN EFI_SIMPLE_NETWORK_PROTOCOL
* This
,
425 OUT UINT32
*InterruptStatus OPTIONAL
,
426 OUT VOID
**TxBuf OPTIONAL
431 Places a packet in the transmit queue of a network interface.
433 @param This The protocol instance pointer.
434 @param HeaderSize The size, in bytes, of the media header to be filled in by
435 the Transmit() function. If HeaderSize is non-zero, then it
436 must be equal to This->Mode->MediaHeaderSize and the DestAddr
437 and Protocol parameters must not be NULL.
438 @param BufferSize The size, in bytes, of the entire packet (media header and
439 data) to be transmitted through the network interface.
440 @param Buffer A pointer to the packet (media header followed by data) to be
441 transmitted. This parameter cannot be NULL. If HeaderSize is zero,
442 then the media header in Buffer must already be filled in by the
443 caller. If HeaderSize is non-zero, then the media header will be
444 filled in by the Transmit() function.
445 @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter
446 is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
447 This->Mode->CurrentAddress is used for the source HW MAC address.
448 @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this
449 parameter is ignored.
450 @param Protocol The type of header to build. If HeaderSize is zero, then this
451 parameter is ignored. See RFC 1700, section "Ether Types", for
454 @retval EFI_SUCCESS The packet was placed on the transmit queue.
455 @retval EFI_NOT_STARTED The network interface has not been started.
456 @retval EFI_NOT_READY The network interface is too busy to accept this transmit request.
457 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
458 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
459 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
460 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
465 Undi16SimpleNetworkTransmit (
466 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
470 IN EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
471 IN EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
472 IN UINT16
*Protocol OPTIONAL
477 Receives a packet from a network interface.
479 @param This The protocol instance pointer.
480 @param HeaderSize The size, in bytes, of the media header received on the network
481 interface. If this parameter is NULL, then the media header size
482 will not be returned.
483 @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in
484 bytes, of the packet that was received on the network interface.
485 @param Buffer A pointer to the data buffer to receive both the media header and
487 @param SrcAddr The source HW MAC address. If this parameter is NULL, the
488 HW MAC source address will not be extracted from the media
490 @param DestAddr The destination HW MAC address. If this parameter is NULL,
491 the HW MAC destination address will not be extracted from the
493 @param Protocol The media header type. If this parameter is NULL, then the
494 protocol will not be extracted from the media header. See
495 RFC 1700 section "Ether Types" for examples.
497 @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
498 been updated to the number of bytes received.
499 @retval EFI_NOT_STARTED The network interface has not been started.
500 @retval EFI_NOT_READY The network interface is too busy to accept this transmit
502 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
503 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
504 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
505 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
510 Undi16SimpleNetworkReceive (
511 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
,
512 OUT UINTN
*HeaderSize OPTIONAL
,
513 IN OUT UINTN
*BufferSize
,
515 OUT EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
516 OUT EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
517 OUT UINT16
*Protocol OPTIONAL
522 wait for a packet to be received.
524 @param Event Event used with WaitForEvent() to wait for a packet to be received.
525 @param Context Event Context
530 Undi16SimpleNetworkWaitForPacket (
537 Check whether packet is ready for receive.
539 @param This The protocol instance pointer.
541 @retval EFI_SUCCESS Receive data is ready.
542 @retval EFI_NOT_STARTED The network interface has not been started.
543 @retval EFI_NOT_READY The network interface is too busy to accept this transmit
545 @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
546 @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
547 @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
548 @retval EFI_UNSUPPORTED This function is not supported by the network interface.
551 Undi16SimpleNetworkCheckForPacket (
552 IN EFI_SIMPLE_NETWORK_PROTOCOL
*This
557 Cache Interrupt verctor address converted from IVT number.
559 @param VectorNumber IVT number
561 @retval EFI_SUCCESS Success to operation.
570 Get interrupt vector address according to IVT number.
572 @param VectorNumber Given IVT number
574 @return cached interrupt vector address.
577 RestoreCachedVectorAddress (
583 If available, launch the BaseCode from a NIC option ROM.
584 This should install the !PXE and PXENV+ structures in memory for
588 @param SimpleNetworkDevice Simple network device instance
589 @param RomAddress The ROM base address for NIC rom.
591 @retval EFI_NOT_FOUND The check sum does not match
592 @retval EFI_NOT_FOUND Rom ID offset is wrong
593 @retval EFI_NOT_FOUND No Rom ID structure is found
597 EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
605 Op-Code: PXENV_START_UNDI (0000h)
606 Input: Far pointer to a PXENV_START_UNDI_T parameter structure that has been initialized by the caller.
607 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
608 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
610 Description: This service is used to pass the BIOS parameter registers to the UNDI driver. The UNDI driver is
611 responsible for saving the information it needs to communicate with the hardware.
612 This service is also responsible for hooking the Int 1Ah service routine
613 Note: This API service must be called only once during UNDI Option ROM boot.
614 The UNDI driver is responsible for saving this information and using it every time
615 PXENV_UNDI_STARTUP is called.
616 Service cannot be used in protected mode.
624 } PXENV_START_UNDI_T;
625 Set before calling API service
626 AX, BX, DX, DI, ES: BIOS initialization parameter registers. These
627 fields should contain the same information passed to the option ROM
628 initialization routine by the Host System BIOS. Information about the
629 contents of these registers can be found in the [PnP], [PCI] and
630 [BBS] specifications.
631 Returned from API service
632 Status: See the PXENV_STATUS_xxx constants.
634 @param SimpleNetworkDevice Device instance
635 @param PxeUndiTable Point to structure which hold parameter and return value
638 @return Return value of PXE option ROM far call.
642 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
643 IN OUT PXENV_START_UNDI_T
*PxeUndiTable
650 Op-Code: PXENV_UNDI_STARTUP (0001h)
651 Input: Far pointer to a PXENV_UNDI_STARTUP_T parameter structure that has been initialized by the
653 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
654 the parameter structure must be set to one of the values represented by the
655 PXENV_STATUS_xxx constants.
656 Description: This API is responsible for initializing the contents of the UNDI code & data segment for proper
657 operation. Information from the !PXE structure and the first PXENV_START_UNDI API call is used
658 to complete this initialization. The rest of the UNDI APIs will not be available until this call has
660 Note: PXENV_UNDI_STARTUP must not be called again without first calling
662 PXENV_UNDI_STARTUP and PXENV_UNDI_SHUTDOWN are no longer responsible for
663 chaining interrupt 1Ah. This must be done by the PXENV_START_UNDI and
664 PXENV_STOP_UNDI API calls.
665 This service cannot be used in protected mode.
669 } PXENV_UNDI_STARTUP_T;
670 Set before calling API service
672 Returned from API service
673 Status: See the PXENV_STATUS_xxx constants.
675 @param SimpleNetworkDevice Device instance
676 @param PxeUndiTable Point to structure which hold parameter and return value
679 @return Return value of PXE option ROM far call.
683 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
684 IN OUT PXENV_UNDI_STARTUP_T
*PxeUndiTable
691 Op-Code: PXENV_UNDI_CLEANUP (0002h)
692 Input: Far pointer to a PXENV_UNDI_CLEANUP_T parameter structure.
693 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field
694 in the parameter structure must be set to one of the values represented by the
695 PXENV_STATUS_xxx constants.
696 Description: This call will prepare the network adapter driver to be unloaded from memory. This call must be
697 made just before unloading the Universal NIC Driver. The rest of the API will not be available
698 after this call executes.
699 This service cannot be used in protected mode.
702 } PXENV_UNDI_CLEANUP_T;
703 Set before calling API service
705 Returned from API service
706 Status: See the PXENV_STATUS_xxx constants.
708 @param SimpleNetworkDevice Device instance
709 @param PxeUndiTable Point to structure which hold parameter and return value
712 @return Return value of PXE option ROM far call.
716 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
717 IN OUT PXENV_UNDI_CLEANUP_T
*PxeUndiTable
724 Op-Code: PXENV_UNDI_INITIALIZE (0003h)
725 Input: Far pointer to a PXENV_UNDI_INITIALIZE_T parameter structure that has been initialized by the
727 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
728 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
730 Description: This call resets the adapter and programs it with default parameters. The default parameters used
731 are those supplied to the most recent UNDI_STARTUP call. This routine does not enable the
732 receive and transmit units of the network adapter to readily receive or transmit packets. The
733 application must call PXENV_UNDI_OPEN to logically connect the network adapter to the network.
734 This call must be made by an application to establish an interface to the network adapter driver.
735 Note: When the PXE code makes this call to initialize the network adapter, it passes a NULL pointer for
736 the Protocol field in the parameter structure.
741 } PXENV_UNDI_INITIALIZE_T;
742 Set before calling API service
743 ProtocolIni: Physical address of a memory copy of the driver
744 module from the protocol.ini file obtained from the protocol manager
745 driver (refer to the NDIS 2.0 specification). This parameter is
746 supported for the universal NDIS driver to pass the information
747 contained in the protocol.ini file to the NIC driver for any specific
748 configuration of the NIC. (Note that the module identification in the
749 protocol.ini file was done by NDIS.) This value can be NULL for any
750 other application interfacing to the universal NIC driver
751 Returned from API service
752 Status: See the PXENV_STATUS_xxx constants.
754 @param SimpleNetworkDevice Device instance.
755 @param PxeUndiTable Point to structure which hold parameter and return value
758 @return Return value of PXE option ROM far call.
762 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
763 IN OUT PXENV_UNDI_INITIALIZE_T
*PxeUndiTable
768 Wrapper routine for reset adapter.
772 Op-Code: PXENV_UNDI_RESET_ADAPTER (0004h)
773 Input: Far pointer to a PXENV_UNDI_RESET_ADAPTER_t parameter structure that has been initialized
775 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
776 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
778 Description: This call resets and reinitializes the network adapter with the same set of parameters supplied to
779 Initialize Routine. Unlike Initialize, this call opens the adapter that is, it connects logically to the
780 network. This routine cannot be used to replace Initialize or Shutdown calls.
783 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
784 } PXENV_UNDI_RESET_T;
786 #define MAXNUM_MCADDR 8
789 UINT16 MCastAddrCount;
790 MAC_ADDR McastAddr[MAXNUM_MCADDR];
791 } PXENV_UNDI_MCAST_ADDRESS_t;
793 Set before calling API service
794 R_Mcast_Buf: This is a structure of MCastAddrCount and
796 MCastAddrCount: Number of multicast MAC addresses in the
798 McastAddr: List of up to MAXNUM_MCADDR multicast MAC
800 Returned from API service
801 Status: See the PXENV_STATUS_xxx constants.
803 @param SimpleNetworkDevice Device instance.
804 @param PxeUndiTable Point to structure which hold parameter and return value
806 @param RxFilter Filter setting mask value for PXE recive .
808 @return Return value of PXE option ROM far call.
812 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
813 IN OUT PXENV_UNDI_RESET_T
*PxeUndiTable
,
821 Op-Code: PXENV_UNDI_SHUTDOWN (0005h)
822 Input: Far pointer to a PXENV_UNDI_SHUTDOWN_T parameter.
823 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
824 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
826 Description: This call resets the network adapter and leaves it in a safe state for another driver to program it.
827 Note: The contents of the PXENV_UNDI_STARTUP parameter structure need to be saved by the
828 Universal NIC Driver in case PXENV_UNDI_INITIALIZE is called again.
832 } PXENV_UNDI_SHUTDOWN_T;
833 Set before calling API service
835 Returned from API service
836 Status: See the PXENV_STATUS_xxx constants.
838 @param SimpleNetworkDevice Device instance
839 @param PxeUndiTable Point to structure which hold parameter and return value
842 @return Return value of PXE option ROM far call.
846 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
847 IN OUT PXENV_UNDI_SHUTDOWN_T
*PxeUndiTable
854 Op-Code: PXENV_UNDI_OPEN (0006h)
855 Input: Far pointer to a PXENV_UNDI_OPEN_T parameter structure that has been initialized by the caller.
856 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
857 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
859 Description: This call activates the adapter network connection and sets the adapter ready to accept packets
860 for transmit and receive.
865 #define FLTR_DIRECTED 0x0001
866 #define FLTR_BRDCST 0x0002
867 #define FLTR_PRMSCS 0x0004
868 #define FLTR_SRC_RTG 0x0008
869 PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
871 Set before calling API service
872 OpenFlag: This is an adapter specific input parameter. This is
873 supported for the universal NDIS 2.0 driver to pass in the open flags
874 provided by the protocol driver. (See the NDIS 2.0 specification.)
876 PktFilter: Filter for receiving packets. This can be one, or more, of
877 the FLTR_xxx constants. Multiple values are arithmetically or-ed
879 directed packets are packets that may come to your MAC address
880 or the multicast MAC address.
881 R_Mcast_Buf: See definition in UNDI RESET ADAPTER (0004h).
882 Returned from API service
883 Status: See the PXENV_STATUS_xxx constants.
885 @param SimpleNetworkDevice Device instance
886 @param PxeUndiTable Point to structure which hold parameter and return value
889 @return Return value of PXE option ROM far call.
893 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
894 IN OUT PXENV_UNDI_OPEN_T
*PxeUndiTable
901 Op-Code: PXENV_UNDI_CLOSE (0007h)
902 Input: Far pointer to a PXENV_UNDI_CLOSE_T parameter.
903 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
904 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
906 Description: This call disconnects the network adapter from the network. Packets cannot be transmitted or
907 received until the network adapter is open again.
910 } PXENV_UNDI_CLOSE_T;
911 Set before calling API service
913 Returned from API service
914 Status: See the PXENV_STATUS_xxx constants.
916 @param SimpleNetworkDevice Device instance
917 @param PxeUndiTable Point to structure which hold parameter and return value
920 @return Return value of PXE option ROM far call.
924 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
925 IN OUT PXENV_UNDI_CLOSE_T
*PxeUndiTable
932 Op-Code: PXENV_UNDI_TRANSMIT (0008h)
933 Input: Far pointer to a PXENV_UNDI_TRANSMIT_T parameter structure that
934 has been initialized by the caller.
935 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX.
936 The status code must be set to one of the values represented by the
937 PXENV_STATUS_xxx constants.
938 Description: This call transmits a buffer to the network. The media header
939 for the packet can be filled by the calling protocol, but it might not be.
940 The network adapter driver will fill it if required by the values in the
941 parameter block. The packet is buffered for transmission provided there is
942 an available buffer, and the function returns PXENV_EXIT_SUCCESS. If no
943 buffer is available the function returns PXENV_EXIT_FAILURE with a status
944 code of PXE_UNDI_STATUS__OUT OF_RESOURCE. The number of buffers is
945 implementation-dependent. An interrupt is generated on completion of the
946 transmission of one or more packets. A call to PXENV_UNDI_TRANSMIT is
947 permitted in the context of a transmit complete interrupt.
957 #define XMT_DESTADDR 0x0000
958 #define XMT_BROADCAST 0x0001
962 } t_PXENV_UNDI_TRANSMIT;
964 #define MAX_DATA_BLKS 8
975 } DataBlock[MAX_DATA_BLKS];
978 Set before calling API service
979 Protocol: This is the protocol of the upper layer that is calling UNDI
980 TRANSMIT call. If the upper layer has filled the media header, this
981 field must be P_UNKNOWN.
982 XmitFlag: If this flag is XMT_DESTADDR, the NIC driver expects a
983 pointer to the destination media address in the field DestAddr. If
984 XMT_BROADCAST, the NIC driver fills the broadcast address for the
986 TBD: Segment:Offset address of the transmit buffer descriptor.
987 ImmedLength: Length of the immediate transmit buffer: Xmit.
988 Xmit: Segment:Offset of the immediate transmit buffer.
989 DataBlkCount: Number of blocks in this transmit buffer.
991 0 => 32-bit physical address in TDDataPtr (not supported in this
993 1 => segment:offset in TDDataPtr which can be a real mode or 16-bit
994 protected mode pointer
995 TDRsvdByte: Reserved must be zero.
996 TDDatalen: Data block length in bytes.
997 TDDataPtr: Segment:Offset of the transmit block.
998 DataBlock: Array of transmit data blocks.
999 Returned from API service
1000 Status: See the PXENV_STATUS_xxx constants
1002 @param SimpleNetworkDevice Device instance
1003 @param PxeUndiTable Point to structure which hold parameter and return value
1004 for option ROM call.
1006 @return Return value of PXE option ROM far call.
1010 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1011 IN OUT PXENV_UNDI_TRANSMIT_T
*PxeUndiTable
1018 UNDI SET STATION ADDRESS
1019 Op-Code: PXENV_UNDI_SET_STATION_ADDRESS (000Ah)
1020 Input: Far pointer to a PXENV_UNDI_SET_STATION_ADDRESS_t parameter structure that has been
1021 initialized by the caller.
1022 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1023 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1025 Description: This call sets the MAC address to be the input value and is called before opening the network
1026 adapter. Later, the open call uses this variable as a temporary MAC address to program the
1027 adapter individual address registers.
1029 PXENV_STATUS Status;
1030 MAC_ADDR StationAddress;
1031 } PXENV_UNDI_SET_STATION_ADDR_T;
1032 Set before calling API service
1033 StationAddress: Temporary MAC address to be used for
1034 transmit and receive.
1035 Returned from API service
1036 Status: See the PXENV_STATUS_xxx constants.
1038 @param SimpleNetworkDevice Device instance
1039 @param PxeUndiTable Point to structure which hold parameter and return value
1040 for option ROM call.
1042 @return Return value of PXE option ROM far call.
1045 PxeUndiSetStationAddr (
1046 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1047 IN OUT PXENV_UNDI_SET_STATION_ADDR_T
*PxeUndiTable
1054 UNDI GET INFORMATION
1055 Op-Code: PXENV_UNDI_GET_INFORMATION (000Ch)
1056 Input: Far pointer to a PXENV_UNDI_GET_INFORMATION_T parameter structure that has been
1057 initialized by the caller.
1058 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1059 the parameter structure must be set to one of the values represented by the
1060 PXENV_STATUS_xxx constants.
1061 Description: This call copies the network adapter variables, including the MAC address, into the input buffer.
1062 Note: The PermNodeAddress field must be valid after PXENV_START_UNDI and
1063 PXENV_UNDI_STARTUP have been issued. All other fields must be valid after
1064 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE have been
1067 PXENV_STATUS Status;
1072 #define ETHER_TYPE 1
1073 #define EXP_ETHER_TYPE 2
1075 #define ARCNET_TYPE 7
1077 MAC_ADDR CurrentNodeAddress;
1078 MAC_ADDR PermNodeAddress;
1082 } PXENV_UNDI_GET_INFORMATION_T;
1083 Set before calling API service
1085 Returned from API service
1086 Status: See the PXENV_STATUS_xxx constants.
1087 BaseIO: Adapter base I/O address.
1088 IntNumber: Adapter IRQ number.
1089 MaxTranUnit: Adapter maximum transmit unit.
1090 HWType: Type of protocol at the hardware level.
1091 HWAddrLen: Length of the hardware address.
1092 CurrentNodeAddress: Current hardware address.
1093 PermNodeAddress: Permanent hardware address.
1094 ROMAddress: Real mode ROM segment address.
1095 RxBufCnt: Receive queue length.
1096 TxBufCnt: Transmit queue length.
1098 @param SimpleNetworkDevice Device instance
1099 @param PxeUndiTable Point to structure which hold parameter and return value
1100 for option ROM call.
1102 @return Return value of PXE option ROM far call.
1105 PxeUndiGetInformation (
1106 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1107 IN OUT PXENV_UNDI_GET_INFORMATION_T
*PxeUndiTable
1114 Op-Code: PXENV_UNDI_GET_STATISTICS (000Dh)
1115 Input: Far pointer to a PXENV_UNDI_GET_STATISTICS_T parameter structure that has been initialized
1117 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1118 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1120 Description: This call reads statistical information from the network adapter, and returns.
1122 PXENV_STATUS Status;
1123 UINT32 XmtGoodFrames;
1124 UINT32 RcvGoodFrames;
1125 UINT32 RcvCRCErrors;
1126 UINT32 RcvResourceErrors;
1127 } PXENV_UNDI_GET_STATISTICS_T;
1128 Set before calling API service
1130 Returned from API service
1131 Status: See the PXENV_STATUS_xxx constants.
1132 XmtGoodFrames: Number of successful transmissions.
1133 RcvGoodFrames: Number of good frames received.
1134 RcvCRCErrors: Number of frames received with CRC
1136 RcvResourceErrors: Number of frames discarded
1137 because receive queue was full.
1139 @param SimpleNetworkDevice Device instance
1140 @param PxeUndiTable Point to structure which hold parameter and return value
1141 for option ROM call.
1143 @return Return value of PXE option ROM far call.
1146 PxeUndiGetStatistics (
1147 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1148 IN OUT PXENV_UNDI_GET_STATISTICS_T
*PxeUndiTable
1154 UNDI CLEAR STATISTICS
1155 Op-Code: PXENV_UNDI_CLEAR_STATISTICS (000Eh)
1156 Input: Far pointer to a PXENV_UNDI_CLEAR_STATISTICS_T parameter.
1157 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1158 the parameter structure must be set to one of the values represented by the
1159 PXENV_STATUS_xxx constants.
1160 Description: This call clears the statistical information from the network adapter.
1162 PXENV_STATUS Status;
1163 } PXENV_UNDI_CLEAR_STATISTICS_T;
1164 Set before calling API service
1166 Returned from API service
1167 Status: See the PXENV_STATUS_xxx constants.
1169 @param SimpleNetworkDevice Device instance
1170 @param PxeUndiTable Point to structure which hold parameter and return value
1171 for option ROM call.
1173 @return Return value of PXE option ROM far call.
1176 PxeUndiClearStatistics (
1177 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1178 IN OUT PXENV_UNDI_CLEAR_STATISTICS_T
*PxeUndiTable
1185 UNDI GET MULTICAST ADDRESS
1186 Op-Code: PXENV_UNDI_GET_MCAST_ADDRESS (0011h)
1187 Input: Far pointer to a PXENV_GET_MCAST_ADDRESS_t parameter structure that has been initialized
1189 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1190 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1192 Description: This call converts the given IP multicast address to a hardware multicast address.
1194 PXENV_STATUS Status;
1197 } PXENV_UNDI_GET_MCAST_ADDR_T;
1198 Set before calling API service
1199 InetAddr: IP multicast address.
1200 Returned from API service
1201 Status: See the PXENV_STATUS_xxx constants.
1202 MediaAddr: MAC multicast address.
1204 @param SimpleNetworkDevice Device instance
1205 @param PxeUndiTable Point to structure which hold parameter and return value
1206 for option ROM call.
1208 @return Return value of PXE option ROM far call.
1211 PxeUndiGetMcastAddr (
1212 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1213 IN OUT PXENV_UNDI_GET_MCAST_ADDR_T
*PxeUndiTable
1220 Op-Code: PXENV_UNDI_GET_NIC_TYPE (0012h)
1221 Input: Far pointer to a PXENV_UNDI_GET_NIC_TYPE_T parameter structure that has been initialized by
1223 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1224 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1225 constants. If the PXENV_EXIT_SUCCESS is returned the parameter structure must contain the
1227 Description: This call, if successful, provides the NIC-specific information necessary to identify the network
1228 adapter that is used to boot the system.
1229 Note: The application first gets the DHCPDISCOVER packet using GET_CACHED_INFO and checks if
1230 the UNDI is supported before making this call. If the UNDI is not supported, the NIC-specific
1231 information can be obtained from the DHCPDISCOVER packet itself.
1232 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called
1233 before the information provided is valid.
1235 PXENV_STATUS Status;
1239 #define CardBus_NIC 4
1249 UINT16 SubVendor_ID;
1250 UINT16 SubDevice_ID;
1260 } PXENV_UNDI_GET_NIC_TYPE_T;
1261 Set before calling API service
1263 Returned from API service
1264 Status: See the PXENV_STATUS_xxx constants.
1265 NICType: Type of NIC information stored in the parameter
1267 Info: Information about the fields in this union can be found
1268 in the [PnP] and [PCI] specifications
1270 @param SimpleNetworkDevice Device instance
1271 @param PxeUndiTable Point to structure which hold parameter and return value
1272 for option ROM call.
1274 @return Return value of PXE option ROM far call.
1278 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1279 IN OUT PXENV_UNDI_GET_NIC_TYPE_T
*PxeUndiTable
1286 Op-Code: PXENV_UNDI_GET_IFACE_INFO (0013h)
1287 Input: Far pointer to a PXENV_UNDI_GET_IFACE_INFO_t parameter structure that has been initialized
1289 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1290 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1291 constants. If the PXENV_EXIT_SUCCESS is returned, the parameter structure must contain the
1292 interface specific information.
1293 Description: This call, if successful, provides the network interface specific information such as the interface
1294 type at the link layer (Ethernet, Tokenring) and the link speed. This information can be used in the
1295 universal drivers such as NDIS or Miniport to communicate to the upper protocol modules.
1296 Note: UNDI follows the NDIS2 specification in giving this information. It is the responsibility of the
1297 universal driver to translate/convert this information into a format that is required in its specification
1298 or to suit the expectation of the upper level protocol modules.
1299 PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called
1300 before the information provided is valid.
1303 UINT8 IfaceType[16];
1305 UINT32 ServiceFlags;
1307 } PXENV_UNDI_GET_NDIS_INFO_T;
1308 Set before calling API service
1310 Returned from API service
1311 Status: See the PXENV_STATUS_xxx constants.
1312 IfaceType: Name of MAC type in ASCIIZ format. This is
1313 used by the universal NDIS driver to specify its driver type
1314 to the protocol driver.
1315 LinkSpeed: Defined in the NDIS 2.0 specification.
1316 ServiceFlags: Defined in the NDIS 2.0 specification.
1317 Reserved: Must be zero.
1319 @param SimpleNetworkDevice Device instance
1320 @param PxeUndiTable Point to structure which hold parameter and return value
1321 for option ROM call.
1323 @return Return value of PXE option ROM far call.
1326 PxeUndiGetNdisInfo (
1327 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1328 IN OUT PXENV_UNDI_GET_NDIS_INFO_T
*PxeUndiTable
1335 Op-Code: PXENV_UNDI_ISR (0014h)
1336 Input: Far pointer to a PXENV_UNDI_ISR_T parameter structure that has been initialized by the caller.
1337 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1338 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1340 Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in
1341 the parameter block indicates the operation to be performed for the call. This field is filled with the
1342 status of that operation on return.
1343 Note: Interrupt Service Routine Operation:
1344 In this design the UNDI does not hook the interrupt for the Network Interface. Instead, the
1345 application or the protocol driver hooks the interrupt and calls UNDI with the PXENV_UNDI_ISR
1346 API call for interrupt verification (PXENV_UNDI_ISR_IN_START) and processing
1347 (PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_GET_NEXT).
1348 When the Network Interface HW generates an interrupt the protocol driver interrupt service
1349 routine (ISR) gets control and takes care of the interrupt processing at the PIC level. The ISR then
1350 calls the UNDI using the PXENV_UNDI_ISR API with the value PXENV_UNDI_ISR_IN_START for
1351 the FuncFlag parameter. At this time UNDI must disable the interrupts at the Network Interface
1352 level and read any status values required to further process the interrupt. UNDI must return as
1353 quickly as possible with one of the two values, PXENV_UNDI_ISR_OUT_OURS or
1354 PXENV_UNDI_ISR_OUT_NOT_OURS, for the parameter FuncFlag depending on whether the
1355 interrupt was generated by this particular Network Interface or not.
1356 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_NOT_OURS, then the interrupt was
1357 not generated by our NIC, and interrupt processing is complete.
1358 If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_OURS, the protocol driver must start
1359 a handler thread and send an end-of-interrupt (EOI) command to the PIC. Interrupt processing is
1361 The protocol driver strategy routine will call UNDI using this same API with FuncFlag equal to
1362 PXENV_UNDI_ISR_IN_PROCESS. At this time UNDI must find the cause of this interrupt and
1363 return the status in the FuncFlag. It first checks if there is a frame received and if so it returns the
1364 first buffer pointer of that frame in the parameter block.
1365 The protocol driver calls UNDI repeatedly with the FuncFlag equal to
1366 PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the received
1367 frames in the queue. On this call, UNDI must remember the previous buffer given to the protoco,l
1368 remove it from the receive queue and recycle it. In case of a multi-buffered frame, if the previous
1369 buffer is not the last buffer in the frame it must return the next buffer in the frame in the parameter
1370 block. Otherwise it must return the first buffer in the next frame.
1371 If there is no received frame pending to be processed, UNDI processes the transmit completes and
1372 if there is no other interrupt status to be processed, UNDI re-enables the interrupt at the
1373 NETWORK INTERFACE level and returns PXENV_UNDI_ISR_OUT_DONE in the FuncFlag.
1374 IMPORTANT: It is possible for the protocol driver to be interrupted again while in the
1375 strategy routine when the UNDI re-enables interrupts.
1377 @param SimpleNetworkDevice Device instance
1378 @param PxeUndiTable Point to structure which hold parameter and return value
1379 for option ROM call.
1381 @return Return value of PXE option ROM far call.
1385 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1386 IN OUT PXENV_UNDI_ISR_T
*PxeUndiTable
1393 Op-Code: PXENV_STOP_UNDI (0015h)
1394 Input: Far pointer to a PXENV_STOP_UNDI_T parameter structure that has been initialized by the caller.
1395 Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in
1396 the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx
1398 Description: This routine is responsible for unhooking the Int 1Ah service routine.
1399 Note: This API service must be called only once at the end of UNDI Option ROM boot. One of the valid
1400 status codes is PXENV_STATUS_KEEP. If this status is returned, UNDI must not be removed from
1401 base memory. Also, UNDI must not be removed from base memory if BC is not removed from base
1403 Service cannot be used in protected mode.
1405 PXENV_STATUS Status;
1406 } PXENV_STOP_UNDI_T;
1407 Set before calling API service
1409 Returned from API service
1410 Status: See the PXENV_STATUS_xxx constants.
1412 @param SimpleNetworkDevice Device instance
1413 @param PxeUndiTable Point to structure which hold parameter and return value
1414 for option ROM call.
1416 @return Return value of PXE option ROM far call.
1420 IN EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1421 IN OUT PXENV_STOP_UNDI_T
*PxeUndiTable
1427 Effect the Far Call into the PXE Layer
1429 Note: When using a 32-bit stack segment do not push 32-bit words onto the stack. The PXE API
1430 services will not work, unless there are three 16-bit parameters pushed onto the stack.
1431 push DS ;Far pointer to parameter structure
1432 push offset pxe_data_call_struct ;is pushed onto stack.
1433 push Index ;UINT16 is pushed onto stack.
1434 call dword ptr (s_PXE ptr es:[di]).EntryPointSP
1435 add sp, 6 ;Caller cleans up stack.
1437 @param SimpleNetworkDevice Device instance for simple network
1438 @param Table Point to parameter/retun value table for legacy far call
1439 @param TableSize The size of parameter/return value table
1440 @param CallIndex The index of legacy call.
1446 EFI_SIMPLE_NETWORK_DEV
*SimpleNetworkDevice
,
1454 Allocate buffer below 1M for real mode.
1456 @param NumPages The number pages want to be allocated.
1457 @param Buffer On return, allocated buffer.
1459 @return Status of allocating pages.
1462 BiosSnp16AllocatePagesBelowOneMb (