+++ /dev/null
-/** @file\r
-\r
-Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.<BR>\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#ifndef _BIOS_SNP_16_H_\r
-#define _BIOS_SNP_16_H_\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Protocol/LegacyBios.h>\r
-#include <Protocol/SimpleNetwork.h>\r
-#include <Protocol/PciIo.h>\r
-#include <Protocol/NetworkInterfaceIdentifier.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-#include <Guid/EventGroup.h>\r
-\r
-#include <IndustryStandard/Pci.h>\r
-\r
-#include "Pxe.h"\r
-\r
-//\r
-// BIOS Simple Network Protocol Device Structure\r
-//\r
-#define EFI_SIMPLE_NETWORK_DEV_SIGNATURE SIGNATURE_32 ('s', 'n', '1', '6')\r
-\r
-#define INIT_PXE_STATUS 0xabcd\r
-\r
-#define EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE 64\r
-\r
-typedef struct {\r
- UINT32 First;\r
- UINT32 Last;\r
- VOID * Data[EFI_SIMPLE_NETWORK_MAX_TX_FIFO_SIZE];\r
-} EFI_SIMPLE_NETWORK_DEV_FIFO;\r
-\r
-typedef struct {\r
- UINTN Signature;\r
- EFI_HANDLE Handle;\r
- EFI_SIMPLE_NETWORK_PROTOCOL SimpleNetwork;\r
- EFI_SIMPLE_NETWORK_MODE SimpleNetworkMode;\r
- EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL Nii;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- EFI_PCI_IO_PROTOCOL *PciIo;\r
- EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;\r
-\r
- //\r
- // Local Data for Simple Network Protocol interface goes here\r
- //\r
- BOOLEAN UndiLoaded;\r
- EFI_EVENT EfiBootEvent;\r
- EFI_EVENT LegacyBootEvent;\r
- UINT16 PxeEntrySegment;\r
- UINT16 PxeEntryOffset;\r
- EFI_SIMPLE_NETWORK_DEV_FIFO TxBufferFifo;\r
- EFI_DEVICE_PATH_PROTOCOL *BaseDevicePath;\r
- PXE_T *Pxe; ///< Pointer to !PXE structure\r
- PXENV_UNDI_GET_INFORMATION_T GetInformation; ///< Data from GET INFORMATION\r
- PXENV_UNDI_GET_NIC_TYPE_T GetNicType; ///< Data from GET NIC TYPE\r
- PXENV_UNDI_GET_NDIS_INFO_T GetNdisInfo; ///< Data from GET NDIS INFO\r
- BOOLEAN IsrValid; ///< TRUE if Isr contains valid data\r
- PXENV_UNDI_ISR_T Isr; ///< Data from ISR\r
- PXENV_UNDI_TBD_T *Xmit; //\r
- VOID *TxRealModeMediaHeader; ///< < 1 MB Size = 0x100\r
- VOID *TxRealModeDataBuffer; ///< < 1 MB Size = GetInformation.MaxTranUnit\r
- VOID *TxDestAddr; ///< < 1 MB Size = 16\r
- UINT8 InterruptStatus; ///< returned/cleared by GetStatus, set in ISR\r
- UINTN UndiLoaderTablePages;\r
- UINTN DestinationDataSegmentPages;\r
- UINTN DestinationStackSegmentPages;\r
- UINTN DestinationCodeSegmentPages;\r
- VOID *UndiLoaderTable;\r
- VOID *DestinationDataSegment;\r
- VOID *DestinationStackSegment;\r
- VOID *DestinationCodeSegment;\r
-} EFI_SIMPLE_NETWORK_DEV;\r
-\r
-#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) \\r
- CR (a, \\r
- EFI_SIMPLE_NETWORK_DEV, \\r
- SimpleNetwork, \\r
- EFI_SIMPLE_NETWORK_DEV_SIGNATURE \\r
- )\r
-\r
-//\r
-// Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL gBiosSnp16DriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gBiosSnp16ComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL gBiosSnp16ComponentName2;\r
-\r
-\r
-//\r
-// Driver Binding Protocol functions\r
-//\r
-/**\r
- Tests to see if this driver supports a given controller.\r
-\r
- @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param Controller The handle of the controller to test.\r
- @param RemainingDevicePath A pointer to the remaining portion of a device path.\r
-\r
- @retval EFI_SUCCESS The driver supports given controller.\r
- @retval EFI_UNSUPPORT The driver doesn't support given controller.\r
- @retval Other Other errors prevent driver finishing to test\r
- if the driver supports given controller.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BiosSnp16DriverBindingSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- )\r
-;\r
-\r
-/**\r
- Starts the Snp device controller\r
-\r
- @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param Controller The handle of the controller to test.\r
- @param RemainingDevicePath A pointer to the remaining portion of a device path.\r
-\r
- @retval EFI_SUCCESS - The device was started.\r
- @retval EFI_DEVICE_ERROR - The device could not be started due to a device error.\r
- @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of resources.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BiosSnp16DriverBindingStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- )\r
-;\r
-\r
-/**\r
- Stops the device by given device controller.\r
-\r
- @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
- @param Controller The handle of the controller to test.\r
- @param NumberOfChildren The number of child device handles in ChildHandleBuffer.\r
- @param ChildHandleBuffer An array of child handles to be freed. May be NULL if\r
- NumberOfChildren is 0.\r
-\r
- @retval EFI_SUCCESS - The device was stopped.\r
- @retval EFI_DEVICE_ERROR - The device could not be stopped due to a device error.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BiosSnp16DriverBindingStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- )\r
-;\r
-\r
-//\r
-// Simple Network Protocol functions\r
-//\r
-/**\r
- Call 16 bit UNDI ROM to start the network interface\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
-\r
- @retval EFI_DEVICE_ERROR Network interface has not be initialized.\r
- @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
- @retval EFI_SUCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkStart (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
-\r
-/**\r
- Call 16 bit UNDI ROM to stop the network interface\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
-\r
- @retval EFI_DEVICE_ERROR Network interface has not be initialized.\r
- @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
- @retval EFI_SUCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkStop (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
-\r
-/**\r
- Initialize network interface\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param ExtraRxBufferSize The size of extra request receive buffer.\r
- @param ExtraTxBufferSize The size of extra request transmit buffer.\r
-\r
- @retval EFI_DEVICE_ERROR Fail to execute 16 bit ROM call.\r
- @retval EFI_SUCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkInitialize (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- IN UINTN ExtraRxBufferSize OPTIONAL,\r
- IN UINTN ExtraTxBufferSize OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Reset network interface.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param ExtendedVerification Need extended verfication.\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkReset (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- IN BOOLEAN ExtendedVerification\r
- )\r
-;\r
-\r
-/**\r
- Shutdown network interface.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkShutdown (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
-\r
-/**\r
- Reset network interface.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param Enable Enable mask value\r
- @param Disable Disable mask value\r
- @param ResetMCastFilter Whether reset multi cast filter or not\r
- @param MCastFilterCnt Count of mutli cast filter for different MAC address\r
- @param MCastFilter Buffer for mustli cast filter for different MAC address.\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkReceiveFilters (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
- IN UINT32 Enable,\r
- IN UINT32 Disable,\r
- IN BOOLEAN ResetMCastFilter,\r
- IN UINTN MCastFilterCnt OPTIONAL,\r
- IN EFI_MAC_ADDRESS * MCastFilter OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Set new MAC address.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param Reset Whether reset station MAC address to permanent address\r
- @param New A pointer to New address\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkStationAddress (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
- IN BOOLEAN Reset,\r
- IN EFI_MAC_ADDRESS * New OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Collect statistics.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param Reset Whether cleanup old statistics data.\r
- @param StatisticsSize The buffer of statistics table.\r
- @param StatisticsTable A pointer to statistics buffer.\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkStatistics (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
- IN BOOLEAN Reset,\r
- IN OUT UINTN *StatisticsSize OPTIONAL,\r
- OUT EFI_NETWORK_STATISTICS * StatisticsTable OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Translate IP address to MAC address.\r
-\r
- @param This A pointer to EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
- @param IPv6 IPv6 or IPv4\r
- @param IP A pointer to given Ip address.\r
- @param MAC On return, translated MAC address.\r
-\r
- @retval EFI_INVALID_PARAMETER Invalid This parameter.\r
- @retval EFI_INVALID_PARAMETER Invalid IP address.\r
- @retval EFI_INVALID_PARAMETER Invalid return buffer for holding MAC address.\r
- @retval EFI_UNSUPPORTED Do not support IPv6\r
- @retval EFI_DEVICE_ERROR Network device has not been initialized.\r
- @retval EFI_NOT_STARTED Network device has been stopped.\r
- @retval EFI_DEVICE_ERROR Invalid status for network device\r
- @retval EFI_SUCCESS Success operation.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkMCastIpToMac (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- IN BOOLEAN IPv6,\r
- IN EFI_IP_ADDRESS *IP,\r
- OUT EFI_MAC_ADDRESS *MAC\r
- )\r
-;\r
-\r
-/**\r
- Performs read and write operations on the NVRAM device attached to a\r
- network interface.\r
-\r
- @param This The protocol instance pointer.\r
- @param ReadWrite TRUE for read operations, FALSE for write operations.\r
- @param Offset Byte offset in the NVRAM device at which to start the read or\r
- write operation. This must be a multiple of NvRamAccessSize and\r
- less than NvRamSize.\r
- @param BufferSize The number of bytes to read or write from the NVRAM device.\r
- This must also be a multiple of NvramAccessSize.\r
- @param Buffer A pointer to the data buffer.\r
-\r
- @retval EFI_SUCCESS The NVRAM access was performed.\r
- @retval EFI_NOT_STARTED The network interface has not been started.\r
- @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
- @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkNvData (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- IN BOOLEAN Write,\r
- IN UINTN Offset,\r
- IN UINTN BufferSize,\r
- IN OUT VOID *Buffer\r
- )\r
-;\r
-\r
-/**\r
- Reads the current interrupt status and recycled transmit buffer status from\r
- a network interface.\r
-\r
- @param This The protocol instance pointer.\r
- @param InterruptStatus A pointer to the bit mask of the currently active interrupts\r
- If this is NULL, the interrupt status will not be read from\r
- the device. If this is not NULL, the interrupt status will\r
- be read from the device. When the interrupt status is read,\r
- it will also be cleared. Clearing the transmit interrupt\r
- does not empty the recycled transmit buffer array.\r
- @param TxBuf Recycled transmit buffer address. The network interface will\r
- not transmit if its internal recycled transmit buffer array\r
- is full. Reading the transmit buffer does not clear the\r
- transmit interrupt. If this is NULL, then the transmit buffer\r
- status will not be read. If there are no transmit buffers to\r
- recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
-\r
- @retval EFI_SUCCESS The status of the network interface was retrieved.\r
- @retval EFI_NOT_STARTED The network interface has not been started.\r
- @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
- @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkGetStatus (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL * This,\r
- OUT UINT32 *InterruptStatus OPTIONAL,\r
- OUT VOID **TxBuf OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Places a packet in the transmit queue of a network interface.\r
-\r
- @param This The protocol instance pointer.\r
- @param HeaderSize The size, in bytes, of the media header to be filled in by\r
- the Transmit() function. If HeaderSize is non-zero, then it\r
- must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
- and Protocol parameters must not be NULL.\r
- @param BufferSize The size, in bytes, of the entire packet (media header and\r
- data) to be transmitted through the network interface.\r
- @param Buffer A pointer to the packet (media header followed by data) to be\r
- transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
- then the media header in Buffer must already be filled in by the\r
- caller. If HeaderSize is non-zero, then the media header will be\r
- filled in by the Transmit() function.\r
- @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter\r
- is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
- This->Mode->CurrentAddress is used for the source HW MAC address.\r
- @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this\r
- parameter is ignored.\r
- @param Protocol The type of header to build. If HeaderSize is zero, then this\r
- parameter is ignored. See RFC 1700, section "Ether Types", for\r
- examples.\r
-\r
- @retval EFI_SUCCESS The packet was placed on the transmit queue.\r
- @retval EFI_NOT_STARTED The network interface has not been started.\r
- @retval EFI_NOT_READY The network interface is too busy to accept this transmit request.\r
- @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
- @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
- @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkTransmit (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- IN UINTN HeaderSize,\r
- IN UINTN BufferSize,\r
- IN VOID *Buffer,\r
- IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
- IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
- IN UINT16 *Protocol OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- Receives a packet from a network interface.\r
-\r
- @param This The protocol instance pointer.\r
- @param HeaderSize The size, in bytes, of the media header received on the network\r
- interface. If this parameter is NULL, then the media header size\r
- will not be returned.\r
- @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in\r
- bytes, of the packet that was received on the network interface.\r
- @param Buffer A pointer to the data buffer to receive both the media header and\r
- the data.\r
- @param SrcAddr The source HW MAC address. If this parameter is NULL, the\r
- HW MAC source address will not be extracted from the media\r
- header.\r
- @param DestAddr The destination HW MAC address. If this parameter is NULL,\r
- the HW MAC destination address will not be extracted from the\r
- media header.\r
- @param Protocol The media header type. If this parameter is NULL, then the\r
- protocol will not be extracted from the media header. See\r
- RFC 1700 section "Ether Types" for examples.\r
-\r
- @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has\r
- been updated to the number of bytes received.\r
- @retval EFI_NOT_STARTED The network interface has not been started.\r
- @retval EFI_NOT_READY The network interface is too busy to accept this transmit\r
- request.\r
- @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
- @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
- @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Undi16SimpleNetworkReceive (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
- OUT UINTN *HeaderSize OPTIONAL,\r
- IN OUT UINTN *BufferSize,\r
- OUT VOID *Buffer,\r
- OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
- OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
- OUT UINT16 *Protocol OPTIONAL\r
- )\r
-;\r
-\r
-/**\r
- wait for a packet to be received.\r
-\r
- @param Event Event used with WaitForEvent() to wait for a packet to be received.\r
- @param Context Event Context\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-Undi16SimpleNetworkWaitForPacket (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-;\r
-\r
-/**\r
- Check whether packet is ready for receive.\r
-\r
- @param This The protocol instance pointer.\r
-\r
- @retval EFI_SUCCESS Receive data is ready.\r
- @retval EFI_NOT_STARTED The network interface has not been started.\r
- @retval EFI_NOT_READY The network interface is too busy to accept this transmit\r
- request.\r
- @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r
- @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
- @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
- @retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
-**/\r
-EFI_STATUS\r
-Undi16SimpleNetworkCheckForPacket (\r
- IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
-\r
-/**\r
- Cache Interrupt verctor address converted from IVT number.\r
-\r
- @param VectorNumber IVT number\r
-\r
- @retval EFI_SUCCESS Success to operation.\r
-**/\r
-EFI_STATUS\r
-CacheVectorAddress (\r
- UINT8 VectorNumber\r
- )\r
-;\r
-\r
-/**\r
- Get interrupt vector address according to IVT number.\r
-\r
- @param VectorNumber Given IVT number\r
-\r
- @return cached interrupt vector address.\r
-**/\r
-EFI_STATUS\r
-RestoreCachedVectorAddress (\r
- UINT8 VectorNumber\r
- )\r
-;\r
-\r
-/**\r
- If available, launch the BaseCode from a NIC option ROM.\r
- This should install the !PXE and PXENV+ structures in memory for\r
- subsequent use.\r
-\r
-\r
- @param SimpleNetworkDevice Simple network device instance\r
- @param RomAddress The ROM base address for NIC rom.\r
-\r
- @retval EFI_NOT_FOUND The check sum does not match\r
- @retval EFI_NOT_FOUND Rom ID offset is wrong\r
- @retval EFI_NOT_FOUND No Rom ID structure is found\r
-**/\r
-EFI_STATUS\r
-LaunchBaseCode (\r
- EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- UINTN RomAddress\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- START UNDI\r
- Op-Code: PXENV_START_UNDI (0000h)\r
- Input: Far pointer to a PXENV_START_UNDI_T parameter structure that has been initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This service is used to pass the BIOS parameter registers to the UNDI driver. The UNDI driver is\r
- responsible for saving the information it needs to communicate with the hardware.\r
- This service is also responsible for hooking the Int 1Ah service routine\r
- Note: This API service must be called only once during UNDI Option ROM boot.\r
- The UNDI driver is responsible for saving this information and using it every time\r
- PXENV_UNDI_STARTUP is called.\r
- Service cannot be used in protected mode.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- UINT16 AX;\r
- UINT16 BX;\r
- UINT16 DX;\r
- UINT16 DI;\r
- UINT16 ES;\r
- } PXENV_START_UNDI_T;\r
- Set before calling API service\r
- AX, BX, DX, DI, ES: BIOS initialization parameter registers. These\r
- fields should contain the same information passed to the option ROM\r
- initialization routine by the Host System BIOS. Information about the\r
- contents of these registers can be found in the [PnP], [PCI] and\r
- [BBS] specifications.\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeStartUndi (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_START_UNDI_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI STARTUP\r
- Op-Code: PXENV_UNDI_STARTUP (0001h)\r
- Input: Far pointer to a PXENV_UNDI_STARTUP_T parameter structure that has been initialized by the\r
- caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the\r
- PXENV_STATUS_xxx constants.\r
- Description: This API is responsible for initializing the contents of the UNDI code & data segment for proper\r
- operation. Information from the !PXE structure and the first PXENV_START_UNDI API call is used\r
- to complete this initialization. The rest of the UNDI APIs will not be available until this call has\r
- been completed.\r
- Note: PXENV_UNDI_STARTUP must not be called again without first calling\r
- PXENV_UNDI_SHUTDOWN.\r
- PXENV_UNDI_STARTUP and PXENV_UNDI_SHUTDOWN are no longer responsible for\r
- chaining interrupt 1Ah. This must be done by the PXENV_START_UNDI and\r
- PXENV_STOP_UNDI API calls.\r
- This service cannot be used in protected mode.\r
- typedef struct\r
- {\r
- PXENV_STATUS Status;\r
- } PXENV_UNDI_STARTUP_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiStartup (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_STARTUP_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI CLEANUP\r
- Op-Code: PXENV_UNDI_CLEANUP (0002h)\r
- Input: Far pointer to a PXENV_UNDI_CLEANUP_T parameter structure.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field\r
- in the parameter structure must be set to one of the values represented by the\r
- PXENV_STATUS_xxx constants.\r
- Description: This call will prepare the network adapter driver to be unloaded from memory. This call must be\r
- made just before unloading the Universal NIC Driver. The rest of the API will not be available\r
- after this call executes.\r
- This service cannot be used in protected mode.\r
- typedef struct {\r
- PXENX_STATUS Status;\r
- } PXENV_UNDI_CLEANUP_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiCleanup (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_CLEANUP_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI INITIALIZE\r
- Op-Code: PXENV_UNDI_INITIALIZE (0003h)\r
- Input: Far pointer to a PXENV_UNDI_INITIALIZE_T parameter structure that has been initialized by the\r
- caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call resets the adapter and programs it with default parameters. The default parameters used\r
- are those supplied to the most recent UNDI_STARTUP call. This routine does not enable the\r
- receive and transmit units of the network adapter to readily receive or transmit packets. The\r
- application must call PXENV_UNDI_OPEN to logically connect the network adapter to the network.\r
- This call must be made by an application to establish an interface to the network adapter driver.\r
- Note: When the PXE code makes this call to initialize the network adapter, it passes a NULL pointer for\r
- the Protocol field in the parameter structure.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- ADDR32 ProtocolIni;\r
- UINT8 reserved[8];\r
- } PXENV_UNDI_INITIALIZE_T;\r
- Set before calling API service\r
- ProtocolIni: Physical address of a memory copy of the driver\r
- module from the protocol.ini file obtained from the protocol manager\r
- driver (refer to the NDIS 2.0 specification). This parameter is\r
- supported for the universal NDIS driver to pass the information\r
- contained in the protocol.ini file to the NIC driver for any specific\r
- configuration of the NIC. (Note that the module identification in the\r
- protocol.ini file was done by NDIS.) This value can be NULL for any\r
- other application interfacing to the universal NIC driver\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance.\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiInitialize (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_INITIALIZE_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- Wrapper routine for reset adapter.\r
-\r
- PXE\r
- UNDI RESET ADAPTER\r
- Op-Code: PXENV_UNDI_RESET_ADAPTER (0004h)\r
- Input: Far pointer to a PXENV_UNDI_RESET_ADAPTER_t parameter structure that has been initialized\r
- by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call resets and reinitializes the network adapter with the same set of parameters supplied to\r
- Initialize Routine. Unlike Initialize, this call opens the adapter that is, it connects logically to the\r
- network. This routine cannot be used to replace Initialize or Shutdown calls.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;\r
- } PXENV_UNDI_RESET_T;\r
-\r
- #define MAXNUM_MCADDR 8\r
-\r
- typedef struct {\r
- UINT16 MCastAddrCount;\r
- MAC_ADDR McastAddr[MAXNUM_MCADDR];\r
- } PXENV_UNDI_MCAST_ADDRESS_t;\r
-\r
- Set before calling API service\r
- R_Mcast_Buf: This is a structure of MCastAddrCount and\r
- McastAddr.\r
- MCastAddrCount: Number of multicast MAC addresses in the\r
- buffer.\r
- McastAddr: List of up to MAXNUM_MCADDR multicast MAC\r
- addresses.\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance.\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
- @param RxFilter Filter setting mask value for PXE recive .\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiResetNic (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_RESET_T *PxeUndiTable,\r
- IN UINT16 RxFilter\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI SHUTDOWN\r
- Op-Code: PXENV_UNDI_SHUTDOWN (0005h)\r
- Input: Far pointer to a PXENV_UNDI_SHUTDOWN_T parameter.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call resets the network adapter and leaves it in a safe state for another driver to program it.\r
- Note: The contents of the PXENV_UNDI_STARTUP parameter structure need to be saved by the\r
- Universal NIC Driver in case PXENV_UNDI_INITIALIZE is called again.\r
- typedef struct\r
- {\r
- PXENV_STATUS Status;\r
- } PXENV_UNDI_SHUTDOWN_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiShutdown (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_SHUTDOWN_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI OPEN\r
- Op-Code: PXENV_UNDI_OPEN (0006h)\r
- Input: Far pointer to a PXENV_UNDI_OPEN_T parameter structure that has been initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call activates the adapter network connection and sets the adapter ready to accept packets\r
- for transmit and receive.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- UINT16 OpenFlag;\r
- UINT16 PktFilter;\r
- #define FLTR_DIRECTED 0x0001\r
- #define FLTR_BRDCST 0x0002\r
- #define FLTR_PRMSCS 0x0004\r
- #define FLTR_SRC_RTG 0x0008\r
- PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;\r
- } PXENV_UNDI_OPEN_T;\r
- Set before calling API service\r
- OpenFlag: This is an adapter specific input parameter. This is\r
- supported for the universal NDIS 2.0 driver to pass in the open flags\r
- provided by the protocol driver. (See the NDIS 2.0 specification.)\r
- This can be zero.\r
- PktFilter: Filter for receiving packets. This can be one, or more, of\r
- the FLTR_xxx constants. Multiple values are arithmetically or-ed\r
- together.\r
- directed packets are packets that may come to your MAC address\r
- or the multicast MAC address.\r
- R_Mcast_Buf: See definition in UNDI RESET ADAPTER (0004h).\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiOpen (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_OPEN_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI CLOSE\r
- Op-Code: PXENV_UNDI_CLOSE (0007h)\r
- Input: Far pointer to a PXENV_UNDI_CLOSE_T parameter.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call disconnects the network adapter from the network. Packets cannot be transmitted or\r
- received until the network adapter is open again.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- } PXENV_UNDI_CLOSE_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiClose (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_CLOSE_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI TRANSMIT PACKET\r
- Op-Code: PXENV_UNDI_TRANSMIT (0008h)\r
- Input: Far pointer to a PXENV_UNDI_TRANSMIT_T parameter structure that\r
- has been initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX.\r
- The status code must be set to one of the values represented by the\r
- PXENV_STATUS_xxx constants.\r
- Description: This call transmits a buffer to the network. The media header\r
- for the packet can be filled by the calling protocol, but it might not be.\r
- The network adapter driver will fill it if required by the values in the\r
- parameter block. The packet is buffered for transmission provided there is\r
- an available buffer, and the function returns PXENV_EXIT_SUCCESS. If no\r
- buffer is available the function returns PXENV_EXIT_FAILURE with a status\r
- code of PXE_UNDI_STATUS__OUT OF_RESOURCE. The number of buffers is\r
- implementation-dependent. An interrupt is generated on completion of the\r
- transmission of one or more packets. A call to PXENV_UNDI_TRANSMIT is\r
- permitted in the context of a transmit complete interrupt.\r
-\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- UINT8 Protocol;\r
- #define P_UNKNOWN 0\r
- #define P_IP 1\r
- #define P_ARP 2\r
- #define P_RARP 3\r
- UINT8 XmitFlag;\r
- #define XMT_DESTADDR 0x0000\r
- #define XMT_BROADCAST 0x0001\r
- SEGOFF16 DestAddr;\r
- SEGOFF16 TBD;\r
- UINT32 Reserved[2];\r
- } t_PXENV_UNDI_TRANSMIT;\r
-\r
- #define MAX_DATA_BLKS 8\r
-\r
- typedef struct {\r
- UINT16 ImmedLength;\r
- SEGOFF16 Xmit;\r
- UINT16 DataBlkCount;\r
- struct DataBlk {\r
- UINT8 TDPtrType;\r
- UINT8 TDRsvdByte;\r
- UINT16 TDDataLen;\r
- SEGOFF16 TDDataPtr;\r
- } DataBlock[MAX_DATA_BLKS];\r
- } PXENV_UNDI_TBD_T\r
-\r
- Set before calling API service\r
- Protocol: This is the protocol of the upper layer that is calling UNDI\r
- TRANSMIT call. If the upper layer has filled the media header, this\r
- field must be P_UNKNOWN.\r
- XmitFlag: If this flag is XMT_DESTADDR, the NIC driver expects a\r
- pointer to the destination media address in the field DestAddr. If\r
- XMT_BROADCAST, the NIC driver fills the broadcast address for the\r
- destination.\r
- TBD: Segment:Offset address of the transmit buffer descriptor.\r
- ImmedLength: Length of the immediate transmit buffer: Xmit.\r
- Xmit: Segment:Offset of the immediate transmit buffer.\r
- DataBlkCount: Number of blocks in this transmit buffer.\r
- TDPtrType:\r
- 0 => 32-bit physical address in TDDataPtr (not supported in this\r
- version of PXE)\r
- 1 => segment:offset in TDDataPtr which can be a real mode or 16-bit\r
- protected mode pointer\r
- TDRsvdByte: Reserved must be zero.\r
- TDDatalen: Data block length in bytes.\r
- TDDataPtr: Segment:Offset of the transmit block.\r
- DataBlock: Array of transmit data blocks.\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiTransmit (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_TRANSMIT_T *PxeUndiTable\r
- )\r
-;\r
-\r
-\r
-/**\r
- PXE\r
- UNDI SET STATION ADDRESS\r
- Op-Code: PXENV_UNDI_SET_STATION_ADDRESS (000Ah)\r
- Input: Far pointer to a PXENV_UNDI_SET_STATION_ADDRESS_t parameter structure that has been\r
- initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call sets the MAC address to be the input value and is called before opening the network\r
- adapter. Later, the open call uses this variable as a temporary MAC address to program the\r
- adapter individual address registers.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- MAC_ADDR StationAddress;\r
- } PXENV_UNDI_SET_STATION_ADDR_T;\r
- Set before calling API service\r
- StationAddress: Temporary MAC address to be used for\r
- transmit and receive.\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiSetStationAddr (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_SET_STATION_ADDR_T *PxeUndiTable\r
- )\r
-;\r
-\r
-\r
-/**\r
- PXE\r
- UNDI GET INFORMATION\r
- Op-Code: PXENV_UNDI_GET_INFORMATION (000Ch)\r
- Input: Far pointer to a PXENV_UNDI_GET_INFORMATION_T parameter structure that has been\r
- initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the\r
- PXENV_STATUS_xxx constants.\r
- Description: This call copies the network adapter variables, including the MAC address, into the input buffer.\r
- Note: The PermNodeAddress field must be valid after PXENV_START_UNDI and\r
- PXENV_UNDI_STARTUP have been issued. All other fields must be valid after\r
- PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE have been\r
- called.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- UINT16 BaseIo;\r
- UINT16 IntNumber;\r
- UINT16 MaxTranUnit;\r
- UINT16 HwType;\r
- #define ETHER_TYPE 1\r
- #define EXP_ETHER_TYPE 2\r
- #define IEEE_TYPE 6\r
- #define ARCNET_TYPE 7\r
- UINT16 HwAddrLen;\r
- MAC_ADDR CurrentNodeAddress;\r
- MAC_ADDR PermNodeAddress;\r
- SEGSEL ROMAddress;\r
- UINT16 RxBufCt;\r
- UINT16 TxBufCt;\r
- } PXENV_UNDI_GET_INFORMATION_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
- BaseIO: Adapter base I/O address.\r
- IntNumber: Adapter IRQ number.\r
- MaxTranUnit: Adapter maximum transmit unit.\r
- HWType: Type of protocol at the hardware level.\r
- HWAddrLen: Length of the hardware address.\r
- CurrentNodeAddress: Current hardware address.\r
- PermNodeAddress: Permanent hardware address.\r
- ROMAddress: Real mode ROM segment address.\r
- RxBufCnt: Receive queue length.\r
- TxBufCnt: Transmit queue length.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiGetInformation (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_GET_INFORMATION_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI GET STATISTICS\r
- Op-Code: PXENV_UNDI_GET_STATISTICS (000Dh)\r
- Input: Far pointer to a PXENV_UNDI_GET_STATISTICS_T parameter structure that has been initialized\r
- by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call reads statistical information from the network adapter, and returns.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- UINT32 XmtGoodFrames;\r
- UINT32 RcvGoodFrames;\r
- UINT32 RcvCRCErrors;\r
- UINT32 RcvResourceErrors;\r
- } PXENV_UNDI_GET_STATISTICS_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
- XmtGoodFrames: Number of successful transmissions.\r
- RcvGoodFrames: Number of good frames received.\r
- RcvCRCErrors: Number of frames received with CRC\r
- error.\r
- RcvResourceErrors: Number of frames discarded\r
- because receive queue was full.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiGetStatistics (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_GET_STATISTICS_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI CLEAR STATISTICS\r
- Op-Code: PXENV_UNDI_CLEAR_STATISTICS (000Eh)\r
- Input: Far pointer to a PXENV_UNDI_CLEAR_STATISTICS_T parameter.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the\r
- PXENV_STATUS_xxx constants.\r
- Description: This call clears the statistical information from the network adapter.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- } PXENV_UNDI_CLEAR_STATISTICS_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiClearStatistics (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_CLEAR_STATISTICS_T *PxeUndiTable\r
- )\r
-;\r
-\r
-\r
-/**\r
- PXE\r
- UNDI GET MULTICAST ADDRESS\r
- Op-Code: PXENV_UNDI_GET_MCAST_ADDRESS (0011h)\r
- Input: Far pointer to a PXENV_GET_MCAST_ADDRESS_t parameter structure that has been initialized\r
- by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This call converts the given IP multicast address to a hardware multicast address.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- IP4 InetAddr;\r
- MAC_ADDR MediaAddr;\r
- } PXENV_UNDI_GET_MCAST_ADDR_T;\r
- Set before calling API service\r
- InetAddr: IP multicast address.\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
- MediaAddr: MAC multicast address.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiGetMcastAddr (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_GET_MCAST_ADDR_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI GET NIC TYPE\r
- Op-Code: PXENV_UNDI_GET_NIC_TYPE (0012h)\r
- Input: Far pointer to a PXENV_UNDI_GET_NIC_TYPE_T parameter structure that has been initialized by\r
- the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants. If the PXENV_EXIT_SUCCESS is returned the parameter structure must contain the\r
- NIC information.\r
- Description: This call, if successful, provides the NIC-specific information necessary to identify the network\r
- adapter that is used to boot the system.\r
- Note: The application first gets the DHCPDISCOVER packet using GET_CACHED_INFO and checks if\r
- the UNDI is supported before making this call. If the UNDI is not supported, the NIC-specific\r
- information can be obtained from the DHCPDISCOVER packet itself.\r
- PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called\r
- before the information provided is valid.\r
- typedef {\r
- PXENV_STATUS Status;\r
- UINT8 NicType;\r
- #define PCI_NIC 2\r
- #define PnP_NIC 3\r
- #define CardBus_NIC 4\r
- Union {\r
- Struct {\r
- UINT16 Vendor_ID;\r
- UINT16 Dev_ID;\r
- UINT8 Base_Class;\r
- UINT8 Sub_Class;\r
- UINT8 Prog_Intf;\r
- UINT8 Rev;\r
- UINT16 BusDevFunc;\r
- UINT16 SubVendor_ID;\r
- UINT16 SubDevice_ID;\r
- } pci, cardbus;\r
- struct {\r
- UINT32 EISA_Dev_ID;\r
- UINT8 Base_Class;\r
- UINT8 Sub_Class;\r
- UINT8 Prog_Intf;\r
- UINT16 CardSelNum;\r
- } pnp;\r
- } info;\r
- } PXENV_UNDI_GET_NIC_TYPE_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
- NICType: Type of NIC information stored in the parameter\r
- structure.\r
- Info: Information about the fields in this union can be found\r
- in the [PnP] and [PCI] specifications\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiGetNicType (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_GET_NIC_TYPE_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI GET IFACE INFO\r
- Op-Code: PXENV_UNDI_GET_IFACE_INFO (0013h)\r
- Input: Far pointer to a PXENV_UNDI_GET_IFACE_INFO_t parameter structure that has been initialized\r
- by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants. If the PXENV_EXIT_SUCCESS is returned, the parameter structure must contain the\r
- interface specific information.\r
- Description: This call, if successful, provides the network interface specific information such as the interface\r
- type at the link layer (Ethernet, Tokenring) and the link speed. This information can be used in the\r
- universal drivers such as NDIS or Miniport to communicate to the upper protocol modules.\r
- Note: UNDI follows the NDIS2 specification in giving this information. It is the responsibility of the\r
- universal driver to translate/convert this information into a format that is required in its specification\r
- or to suit the expectation of the upper level protocol modules.\r
- PXENV_START_UNDI, PXENV_UNDI_STARTUP and PXENV_UNDI_INITIALIZE must be called\r
- before the information provided is valid.\r
- typedef struct {\r
- PXENV_STATUS Status\r
- UINT8 IfaceType[16];\r
- UINT32 LinkSpeed;\r
- UINT32 ServiceFlags;\r
- UINT32 Reserved[4];\r
- } PXENV_UNDI_GET_NDIS_INFO_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
- IfaceType: Name of MAC type in ASCIIZ format. This is\r
- used by the universal NDIS driver to specify its driver type\r
- to the protocol driver.\r
- LinkSpeed: Defined in the NDIS 2.0 specification.\r
- ServiceFlags: Defined in the NDIS 2.0 specification.\r
- Reserved: Must be zero.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiGetNdisInfo (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_GET_NDIS_INFO_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- UNDI ISR\r
- Op-Code: PXENV_UNDI_ISR (0014h)\r
- Input: Far pointer to a PXENV_UNDI_ISR_T parameter structure that has been initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This API function will be called at different levels of processing the interrupt. The FuncFlag field in\r
- the parameter block indicates the operation to be performed for the call. This field is filled with the\r
- status of that operation on return.\r
- Note: Interrupt Service Routine Operation:\r
- In this design the UNDI does not hook the interrupt for the Network Interface. Instead, the\r
- application or the protocol driver hooks the interrupt and calls UNDI with the PXENV_UNDI_ISR\r
- API call for interrupt verification (PXENV_UNDI_ISR_IN_START) and processing\r
- (PXENV_UNDI_ISR_IN_PROCESS and PXENV_UNDI_ISR_GET_NEXT).\r
- When the Network Interface HW generates an interrupt the protocol driver interrupt service\r
- routine (ISR) gets control and takes care of the interrupt processing at the PIC level. The ISR then\r
- calls the UNDI using the PXENV_UNDI_ISR API with the value PXENV_UNDI_ISR_IN_START for\r
- the FuncFlag parameter. At this time UNDI must disable the interrupts at the Network Interface\r
- level and read any status values required to further process the interrupt. UNDI must return as\r
- quickly as possible with one of the two values, PXENV_UNDI_ISR_OUT_OURS or\r
- PXENV_UNDI_ISR_OUT_NOT_OURS, for the parameter FuncFlag depending on whether the\r
- interrupt was generated by this particular Network Interface or not.\r
- If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_NOT_OURS, then the interrupt was\r
- not generated by our NIC, and interrupt processing is complete.\r
- If the value returned in FuncFlag is PXENV_UNDI_ISR_OUT_OURS, the protocol driver must start\r
- a handler thread and send an end-of-interrupt (EOI) command to the PIC. Interrupt processing is\r
- now complete.\r
- The protocol driver strategy routine will call UNDI using this same API with FuncFlag equal to\r
- PXENV_UNDI_ISR_IN_PROCESS. At this time UNDI must find the cause of this interrupt and\r
- return the status in the FuncFlag. It first checks if there is a frame received and if so it returns the\r
- first buffer pointer of that frame in the parameter block.\r
- The protocol driver calls UNDI repeatedly with the FuncFlag equal to\r
- PXENV_UNDI_ISR_IN_GET_NEXT to get all the buffers in a frame and also all the received\r
- frames in the queue. On this call, UNDI must remember the previous buffer given to the protoco,l\r
- remove it from the receive queue and recycle it. In case of a multi-buffered frame, if the previous\r
- buffer is not the last buffer in the frame it must return the next buffer in the frame in the parameter\r
- block. Otherwise it must return the first buffer in the next frame.\r
- If there is no received frame pending to be processed, UNDI processes the transmit completes and\r
- if there is no other interrupt status to be processed, UNDI re-enables the interrupt at the\r
- NETWORK INTERFACE level and returns PXENV_UNDI_ISR_OUT_DONE in the FuncFlag.\r
- IMPORTANT: It is possible for the protocol driver to be interrupted again while in the\r
- strategy routine when the UNDI re-enables interrupts.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiIsr (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_UNDI_ISR_T *PxeUndiTable\r
- )\r
-;\r
-\r
-/**\r
- PXE\r
- STOP UNDI\r
- Op-Code: PXENV_STOP_UNDI (0015h)\r
- Input: Far pointer to a PXENV_STOP_UNDI_T parameter structure that has been initialized by the caller.\r
- Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The status field in\r
- the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx\r
- constants.\r
- Description: This routine is responsible for unhooking the Int 1Ah service routine.\r
- Note: This API service must be called only once at the end of UNDI Option ROM boot. One of the valid\r
- status codes is PXENV_STATUS_KEEP. If this status is returned, UNDI must not be removed from\r
- base memory. Also, UNDI must not be removed from base memory if BC is not removed from base\r
- memory.\r
- Service cannot be used in protected mode.\r
- typedef struct {\r
- PXENV_STATUS Status;\r
- } PXENV_STOP_UNDI_T;\r
- Set before calling API service\r
- N/A\r
- Returned from API service\r
- Status: See the PXENV_STATUS_xxx constants.\r
-\r
- @param SimpleNetworkDevice Device instance\r
- @param PxeUndiTable Point to structure which hold parameter and return value\r
- for option ROM call.\r
-\r
- @return Return value of PXE option ROM far call.\r
-**/\r
-EFI_STATUS\r
-PxeUndiStop (\r
- IN EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT PXENV_STOP_UNDI_T *PxeUndiTable\r
- )\r
-;\r
-\r
-\r
-/**\r
- Effect the Far Call into the PXE Layer\r
-\r
- Note: When using a 32-bit stack segment do not push 32-bit words onto the stack. The PXE API\r
- services will not work, unless there are three 16-bit parameters pushed onto the stack.\r
- push DS ;Far pointer to parameter structure\r
- push offset pxe_data_call_struct ;is pushed onto stack.\r
- push Index ;UINT16 is pushed onto stack.\r
- call dword ptr (s_PXE ptr es:[di]).EntryPointSP\r
- add sp, 6 ;Caller cleans up stack.\r
-\r
- @param SimpleNetworkDevice Device instance for simple network\r
- @param Table Point to parameter/retun value table for legacy far call\r
- @param TableSize The size of parameter/return value table\r
- @param CallIndex The index of legacy call.\r
-\r
- @return EFI_STATUS\r
-**/\r
-EFI_STATUS\r
-MakePxeCall (\r
- EFI_SIMPLE_NETWORK_DEV *SimpleNetworkDevice,\r
- IN OUT VOID *Table,\r
- IN UINTN TableSize,\r
- IN UINT16 CallIndex\r
- )\r
-;\r
-\r
-/**\r
- Allocate buffer below 1M for real mode.\r
-\r
- @param NumPages The number pages want to be allocated.\r
- @param Buffer On return, allocated buffer.\r
-\r
- @return Status of allocating pages.\r
-**/\r
-EFI_STATUS\r
-BiosSnp16AllocatePagesBelowOneMb (\r
- UINTN NumPages,\r
- VOID **Buffer\r
- )\r
-;\r
-\r
-#endif\r