EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Data Structures | Defines | Typedefs | Functions | Variables

OptionRomPkg/UndiRuntimeDxe/Undi32.h File Reference

#include <Uefi.h>
#include <Guid/EventGroup.h>
#include <Protocol/PciIo.h>
#include <Protocol/NetworkInterfaceIdentifier.h>
#include <Protocol/DevicePath.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiRuntimeLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <IndustryStandard/Pci.h>
#include "E100b.h"

Go to the source code of this file.

Data Structures

struct  UNDI32_DEV
struct  UNDI_CALL_TABLE

Defines

#define MAX_NIC_INTERFACES   16
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION_31   0x00010001
#define PXE_ROMID_MINORVER_31   0x10
#define PXE_STATFLAGS_DB_WRITE_TRUNCATED   0x2000
#define DONT_CHECK   -1
#define ANY_STATE   -1
#define MUST_BE_STARTED   1
#define MUST_BE_INITIALIZED   2
#define UNDI_DEV_SIGNATURE   SIGNATURE_32('u','n','d','i')
#define UNDI_DEV_FROM_THIS(a)   CR(a, UNDI32_DEV, NIIProtocol_31, UNDI_DEV_SIGNATURE)
#define UNDI_DEV_FROM_NIC(a)   CR(a, UNDI32_DEV, NicInfo, UNDI_DEV_SIGNATURE)

Typedefs

typedef VOID(* ptr )(VOID)
typedef VOID(* bsptr_30 )(UINTN)
typedef VOID(* virtphys_30 )(UINT64, UINT64)
typedef VOID(* block_30 )(UINT32)
typedef VOID(* mem_io_30 )(UINT8, UINT8, UINT64, UINT64)
typedef VOID(* bsptr )(UINT64, UINTN)
typedef VOID(* virtphys )(UINT64, UINT64, UINT64)
typedef VOID(* block )(UINT64, UINT32)
typedef VOID(* mem_io )(UINT64, UINT8, UINT8, UINT64, UINT64)
typedef VOID(* map_mem )(UINT64, UINT64, UINT32, UINT32, UINT64)
typedef VOID(* unmap_mem )(UINT64, UINT64, UINT32, UINT32, UINT64)
typedef VOID(* sync_mem )(UINT64, UINT64, UINT32, UINT32, UINT64)

Functions

UINT8 InByte (NIC_DATA_INSTANCE *AdapterInfo, UINT32 Port)
UINT16 InWord (NIC_DATA_INSTANCE *AdapterInfo, UINT32 Port)
UINT32 InLong (NIC_DATA_INSTANCE *AdapterInfo, UINT32 Port)
VOID OutByte (NIC_DATA_INSTANCE *AdapterInfo, UINT8 Data, UINT32 Port)
VOID OutWord (NIC_DATA_INSTANCE *AdapterInfo, UINT16 Data, UINT32 Port)
VOID OutLong (NIC_DATA_INSTANCE *AdapterInfo, UINT32 Data, UINT32 Port)
UINTN E100bInit (NIC_DATA_INSTANCE *AdapterInfo)
UINTN E100bReset (NIC_DATA_INSTANCE *AdapterInfo, INT32 OpFlags)
UINTN E100bShutdown (NIC_DATA_INSTANCE *AdapterInfo)
UINTN E100bTransmit (NIC_DATA_INSTANCE *AdapterInfo, UINT64 cpb, UINT16 opflags)
UINTN E100bReceive (NIC_DATA_INSTANCE *AdapterInfo, UINT64 cpb, UINT64 db)
UINTN E100bSetfilter (NIC_DATA_INSTANCE *AdapterInfo, UINT16 New_filter, UINT64 cpb, UINT32 cpbsize)
UINTN E100bStatistics (NIC_DATA_INSTANCE *AdapterInfo, UINT64 db, UINT16 dbsize)
UINT8 E100bSetupIAAddr (NIC_DATA_INSTANCE *AdapterInfo)
UINT8 E100bSetInterruptState (NIC_DATA_INSTANCE *AdapterInfo)
UINT8 E100bGetEepromAddrLen (NIC_DATA_INSTANCE *AdapterInfo)
UINT16 E100bReadEeprom (NIC_DATA_INSTANCE *AdapterInfo, INT32 Location, UINT8 address_len)
INT16 E100bReadEepromAndStationAddress (NIC_DATA_INSTANCE *AdapterInfo)
UINT16 next (UINT16)
UINT8 SetupCBlink (NIC_DATA_INSTANCE *AdapterInfo)
VOID SetFreeCB (NIC_DATA_INSTANCE *AdapterInfo, TxCB *)
TxCBGetFreeCB (NIC_DATA_INSTANCE *AdapterInfo)
UINT16 CheckCBList (NIC_DATA_INSTANCE *AdapterInfo)
UINT8 SelectiveReset (NIC_DATA_INSTANCE *AdapterInfo)
UINT16 InitializeChip (NIC_DATA_INSTANCE *AdapterInfo)
UINT8 SetupReceiveQueues (NIC_DATA_INSTANCE *AdapterInfo)
VOID Recycle_RFD (NIC_DATA_INSTANCE *AdapterInfo, UINT16)
VOID XmitWaitForCompletion (NIC_DATA_INSTANCE *AdapterInfo)
INT8 CommandWaitForCompletion (TxCB *cmd_ptr, NIC_DATA_INSTANCE *AdapterInfo)
BOOLEAN PhyDetect (NIC_DATA_INSTANCE *AdapterInfo)
VOID PhyReset (NIC_DATA_INSTANCE *AdapterInfo)
VOID MdiWrite (IN NIC_DATA_INSTANCE *AdapterInfo, IN UINT8 RegAddress, IN UINT8 PhyAddress, IN UINT16 DataValue)
VOID MdiRead (IN NIC_DATA_INSTANCE *AdapterInfo, IN UINT8 RegAddress, IN UINT8 PhyAddress, IN OUT UINT16 *DataValue)
BOOLEAN SetupPhy (NIC_DATA_INSTANCE *AdapterInfo)
VOID FindPhySpeedAndDpx (NIC_DATA_INSTANCE *AdapterInfo, UINT32 PhyId)
EFI_STATUS InstallConfigTable (IN VOID)
EFI_STATUS EFIAPI InitializeUNDIDriver (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID UNDI_notify_virtual (EFI_EVENT event, VOID *context)
VOID EFIAPI UndiNotifyExitBs (EFI_EVENT Event, VOID *Context)
EFI_STATUS EFIAPI UndiDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UndiDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI UndiDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS AppendMac2DevPath (IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPtr, IN EFI_DEVICE_PATH_PROTOCOL *BaseDevPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID TmpDelay (IN UINT64 UnqId, IN UINTN MicroSeconds)
VOID TmpMemIo (IN UINT64 UnqId, IN UINT8 ReadWrite, IN UINT8 Len, IN UINT64 Port, IN UINT64 BufAddr)
VOID UNDI_GetState (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Start (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Stop (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_GetInitInfo (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_GetConfigInfo (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Initialize (IN PXE_CDB *CdbPtr, NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Reset (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Shutdown (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Interrupt (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_RecFilter (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_StnAddr (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Statistics (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_ip2mac (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_NVData (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Status (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_FillHeader (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Transmit (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_Receive (IN PXE_CDB *CdbPtr, IN NIC_DATA_INSTANCE *AdapterInfo)
VOID UNDI_APIEntry_new (UINT64)
VOID UNDI_APIEntry_Common (UINT64)
PXE_IPV4 convert_mcip (PXE_MAC_ADDR *)
INT32 validate_mcip (PXE_MAC_ADDR *MCastAddr)
VOID PxeStructInit (PXE_SW_UNDI *PxePtr)
VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI *PxePtr)

Variables

UNDI_CALL_TABLE api_table []
PXE_SW_UNDIpxe_31
UNDI32_DEVUNDI32DeviceList [MAX_NIC_INTERFACES]

Detailed Description

EFI internal structures for the EFI UNDI driver.

Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file Undi32.h.


Define Documentation

#define ANY_STATE   -1

Definition at line 49 of file Undi32.h.

#define DONT_CHECK   -1

Definition at line 48 of file Undi32.h.

#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION_31   0x00010001

Definition at line 41 of file Undi32.h.

#define MAX_NIC_INTERFACES   16

Definition at line 39 of file Undi32.h.

#define MUST_BE_INITIALIZED   2

Definition at line 51 of file Undi32.h.

#define MUST_BE_STARTED   1

Definition at line 50 of file Undi32.h.

#define PXE_ROMID_MINORVER_31   0x10

Definition at line 42 of file Undi32.h.

#define PXE_STATFLAGS_DB_WRITE_TRUNCATED   0x2000

Definition at line 43 of file Undi32.h.

#define UNDI_DEV_FROM_NIC (   a)    CR(a, UNDI32_DEV, NicInfo, UNDI_DEV_SIGNATURE)

Definition at line 55 of file Undi32.h.

#define UNDI_DEV_FROM_THIS (   a)    CR(a, UNDI32_DEV, NIIProtocol_31, UNDI_DEV_SIGNATURE)

Definition at line 54 of file Undi32.h.

#define UNDI_DEV_SIGNATURE   SIGNATURE_32('u','n','d','i')

Definition at line 53 of file Undi32.h.


Typedef Documentation

typedef VOID(* block)(UINT64, UINT32)

Definition at line 82 of file Undi32.h.

typedef VOID(* block_30)(UINT32)

Definition at line 77 of file Undi32.h.

typedef VOID(* bsptr)(UINT64, UINTN)

Definition at line 80 of file Undi32.h.

typedef VOID(* bsptr_30)(UINTN)

Definition at line 75 of file Undi32.h.

typedef VOID(* map_mem)(UINT64, UINT64, UINT32, UINT32, UINT64)

Definition at line 85 of file Undi32.h.

typedef VOID(* mem_io)(UINT64, UINT8, UINT8, UINT64, UINT64)

Definition at line 83 of file Undi32.h.

typedef VOID(* mem_io_30)(UINT8, UINT8, UINT64, UINT64)

Definition at line 78 of file Undi32.h.

typedef VOID(* ptr)(VOID)

Definition at line 74 of file Undi32.h.

typedef VOID(* sync_mem)(UINT64, UINT64, UINT32, UINT32, UINT64)

Definition at line 87 of file Undi32.h.

typedef VOID(* unmap_mem)(UINT64, UINT64, UINT32, UINT32, UINT64)

Definition at line 86 of file Undi32.h.

typedef VOID(* virtphys)(UINT64, UINT64, UINT64)

Definition at line 81 of file Undi32.h.

typedef VOID(* virtphys_30)(UINT64, UINT64)

Definition at line 76 of file Undi32.h.


Function Documentation

EFI_STATUS AppendMac2DevPath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **  DevPtr,
IN EFI_DEVICE_PATH_PROTOCOL BaseDevPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

Using the NIC data structure information, read the EEPROM to get the MAC address and then allocate space for a new devicepath (**DevPtr) which will contain the original device path the NIC was found on (*BaseDevPtr) and an added MAC node.

Parameters:
DevPtrPointer which will point to the newly created device path with the MAC node attached.
BaseDevPtrPointer to the device path which the UNDI device driver is latching on to.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Return values:
EFI_SUCCESSA MAC address was successfully appended to the Base Device Path.
otherNot enough resources available to create new Device Path node.

Definition at line 802 of file Init.c.

UINT16 CheckCBList ( NIC_DATA_INSTANCE AdapterInfo)
INT8 CommandWaitForCompletion ( TxCB cmd_ptr,
NIC_DATA_INSTANCE AdapterInfo 
)

TODO: Add function description

Parameters:
cmd_ptrTODO: add argument description
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 3319 of file E100b.c.

PXE_IPV4 convert_mcip ( PXE_MAC_ADDR )
UINT8 E100bGetEepromAddrLen ( NIC_DATA_INSTANCE AdapterInfo)
UINTN E100bInit ( NIC_DATA_INSTANCE AdapterInfo)
UINT16 E100bReadEeprom ( NIC_DATA_INSTANCE AdapterInfo,
INT32  Location,
UINT8  address_len 
)
INT16 E100bReadEepromAndStationAddress ( NIC_DATA_INSTANCE AdapterInfo)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 1373 of file E100b.c.

UINTN E100bReceive ( NIC_DATA_INSTANCE AdapterInfo,
UINT64  cpb,
UINT64  db 
)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
cpbTODO: add argument description
dbTODO: add argument description
Returns:
TODO: add return values

Definition at line 1194 of file E100b.c.

UINTN E100bReset ( NIC_DATA_INSTANCE AdapterInfo,
INT32  OpFlags 
)
UINTN E100bSetfilter ( NIC_DATA_INSTANCE AdapterInfo,
UINT16  new_filter,
UINT64  cpb,
UINT32  cpbsize 
)

Instructs the NIC to start receiving packets.

Parameters:
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on.. new_filter

  • cpb - cpbsize -
Return values:
0Successful
-1Already Started

Definition at line 854 of file E100b.c.

UINT8 E100bSetInterruptState ( NIC_DATA_INSTANCE AdapterInfo)
UINT8 E100bSetupIAAddr ( NIC_DATA_INSTANCE AdapterInfo)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 578 of file E100b.c.

UINTN E100bShutdown ( NIC_DATA_INSTANCE AdapterInfo)
UINTN E100bStatistics ( NIC_DATA_INSTANCE AdapterInfo,
UINT64  DBaddr,
UINT16  DBsize 
)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
DBaddrTODO: add argument description
DBsizeTODO: add argument description
Returns:
TODO: add return values

Definition at line 2150 of file E100b.c.

UINTN E100bTransmit ( NIC_DATA_INSTANCE AdapterInfo,
UINT64  cpb,
UINT16  opflags 
)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
cpbTODO: add argument description
opflagsTODO: add argument description
Returns:
TODO: add return values

Definition at line 1011 of file E100b.c.

VOID FindPhySpeedAndDpx ( NIC_DATA_INSTANCE AdapterInfo,
UINT32  PhyId 
)
TxCB* GetFreeCB ( NIC_DATA_INSTANCE AdapterInfo)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 1502 of file E100b.c.

UINT8 InByte ( NIC_DATA_INSTANCE AdapterInfo,
UINT32  Port 
)
UINT16 InitializeChip ( NIC_DATA_INSTANCE AdapterInfo)
EFI_STATUS EFIAPI InitializeUNDIDriver ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)
UINT32 InLong ( NIC_DATA_INSTANCE AdapterInfo,
UINT32  Port 
)
EFI_STATUS InstallConfigTable ( IN  VOID)

Install a GUID/Pointer pair into the system's configuration table.

none

Return values:
EFI_SUCCESSInstall a GUID/Pointer pair into the system's configuration table.
otherDid not successfully install the GUID/Pointer pair into the configuration table.

Definition at line 932 of file Init.c.

UINT16 InWord ( NIC_DATA_INSTANCE AdapterInfo,
UINT32  Port 
)
VOID MdiRead ( IN NIC_DATA_INSTANCE AdapterInfo,
IN UINT8  RegAddress,
IN UINT8  PhyAddress,
IN OUT UINT16 DataValue 
)

This routine will read a value from the specified MII register of an external MDI compliant device (e.g. PHY 100), and return it to the calling routine. The command will execute in polled mode.

Parameters:
AdapterInfopointer to the structure that contains the NIC's context.
RegAddressThe MII register that we are reading from
PhyAddressThe MDI address of the Phy component.
DataValuepointer to the value that we read from the MII register.

Definition at line 2445 of file E100b.c.

VOID MdiWrite ( IN NIC_DATA_INSTANCE AdapterInfo,
IN UINT8  RegAddress,
IN UINT8  PhyAddress,
IN UINT16  DataValue 
)

This routine will write a value to the specified MII register of an external MDI compliant device (e.g. PHY 100). The command will execute in polled mode.

Parameters:
AdapterInfopointer to the structure that contains the NIC's context.
RegAddressThe MII register that we are writing to
PhyAddressThe MDI address of the Phy component.
DataValueThe value that we are writing to the MII register.
Returns:
nothing

Definition at line 2397 of file E100b.c.

UINT16 next ( UINT16  )
VOID OutByte ( NIC_DATA_INSTANCE AdapterInfo,
UINT8  Data,
UINT32  Port 
)
VOID OutLong ( NIC_DATA_INSTANCE AdapterInfo,
UINT32  Data,
UINT32  Port 
)
VOID OutWord ( NIC_DATA_INSTANCE AdapterInfo,
UINT16  Data,
UINT32  Port 
)
BOOLEAN PhyDetect ( NIC_DATA_INSTANCE AdapterInfo)

This routine will detect what phy we are using, set the line speed, FDX or HDX, and configure the phy if necessary. The following combinations are supported:

  • TX or T4 PHY alone at PHY address 1
  • T4 or TX PHY at address 1 and MII PHY at address 0
  • 82503 alone (10Base-T mode, no full duplex support)
  • 82503 and MII PHY (TX or T4) at address 0 The sequence / priority of detection is as follows:
  • PHY 1 with cable termination
  • PHY 0 with cable termination
  • PHY 1 (if found) without cable termination
  • 503 interface Additionally auto-negotiation capable (NWAY) and parallel detection PHYs are supported. The flow-chart is described in the 82557 software writer's manual. NOTE: 1. All PHY MDI registers are read in polled mode. 2. The routines assume that the 82557 has been RESET and we have obtained the virtual memory address of the CSR. 3. PhyDetect will not RESET the PHY. 4. If FORCEFDX is set, SPEED should also be set. The driver will check the values for inconsistency with the detected PHY technology. 5. PHY 1 (the PHY on the adapter) may have an address in the range 1 through 31 inclusive. The driver will accept addresses in this range. 6. Driver ignores FORCEFDX and SPEED overrides if a 503 interface is detected.
Parameters:
AdapterInfopointer to the structure that contains the NIC's context.
Return values:
TRUEIf a Phy was detected, and configured correctly.
FALSEIf a valid phy could not be detected and configured.

Definition at line 2554 of file E100b.c.

VOID PhyReset ( NIC_DATA_INSTANCE AdapterInfo)

This routine will reset the PHY that the adapter is currently configured to use.

Parameters:
AdapterInfopointer to the structure that contains the NIC's context.

Definition at line 2491 of file E100b.c.

VOID PxeStructInit ( PXE_SW_UNDI PxePtr)
VOID PxeUpdate ( NIC_DATA_INSTANCE NicPtr,
PXE_SW_UNDI PxePtr 
)
VOID Recycle_RFD ( NIC_DATA_INSTANCE AdapterInfo,
UINT16   
)
UINT8 SelectiveReset ( NIC_DATA_INSTANCE AdapterInfo)
VOID SetFreeCB ( NIC_DATA_INSTANCE AdapterInfo,
TxCB  
)
UINT8 SetupCBlink ( NIC_DATA_INSTANCE AdapterInfo)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 1442 of file E100b.c.

BOOLEAN SetupPhy ( NIC_DATA_INSTANCE AdapterInfo)
UINT8 SetupReceiveQueues ( NIC_DATA_INSTANCE AdapterInfo)
VOID TmpDelay ( IN UINT64  UnqId,
IN UINTN  MicroSeconds 
)

Use the EFI boot services to produce a pause. This is also the routine which gets replaced during RunTime by the O/S in the NIC_DATA_INSTANCE so it can do it's own pause.

Parameters:
UnqIdRuntime O/S routine might use this, this temp routine does not use it
MicroSecondsDetermines the length of pause.
Returns:
none

Definition at line 681 of file Init.c.

VOID TmpMemIo ( IN UINT64  UnqId,
IN UINT8  ReadWrite,
IN UINT8  Len,
IN UINT64  Port,
IN UINT64  BuffAddr 
)

Use the PCI IO abstraction to issue memory or I/O reads and writes. This is also the routine which gets replaced during RunTime by the O/S in the NIC_DATA_INSTANCE so it can do it's own I/O abstractions.

Parameters:
UnqIdRuntime O/S routine may use this field, this temp routine does not.
ReadWriteDetermine if it is an I/O or Memory Read/Write Operation.
LenDetermines the width of the data operation.
PortWhat port to Read/Write from.
BuffAddrAddress to read to or write from.
Returns:
none

Definition at line 706 of file Init.c.

VOID UNDI_APIEntry_Common ( UINT64  )
VOID UNDI_APIEntry_new ( UINT64  )
VOID UNDI_FillHeader ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to fill media header(s) in transmit packet(s). Copies the MAC address into the media header whether it is dealing with fragmented or non-fragmented packets.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 1119 of file Decode.c.

VOID UNDI_GetConfigInfo ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to retrieve the configuration information about the NIC being controlled by this driver. This will fill in data in the Data Block structure that is pointed to by the caller's CdbPtr->DBaddr. The fields filled in are as follows: DbPtr->pci.BusType, DbPtr->pci.Bus, DbPtr->pci.Device, and DbPtr->pci. In addition, the DbPtr->pci.Config.Dword[0-63] grabs a copy of this NIC's PCI configuration space.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 288 of file Decode.c.

VOID UNDI_GetInitInfo ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to retrieve the initialization information that is needed by drivers and applications to initialize the UNDI. This will fill in data in the Data Block structure that is pointed to by the caller's CdbPtr->DBaddr. The fields filled in are as follows: MemoryRequired, FrameDataLen, LinkSpeeds[0-3], NvCount, NvWidth, MediaHeaderLen, HWaddrLen, MCastFilterCnt, TxBufCnt, TxBufSize, RxBufCnt, RxBufSize, IFtype, Duplex, and LoopBack. In addition, the CdbPtr->StatFlags ORs in that this NIC supports cable detection. (APRIORI knowledge)

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 236 of file Decode.c.

VOID UNDI_GetState ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine determines the operational state of the UNDI. It updates the state flags in the Command Descriptor Block based on information derived from the AdapterInfo instance data. To ensure the command has completed successfully, CdbPtr->StatCode will contain the result of the command execution. The CdbPtr->StatFlags will contain a STOPPED, STARTED, or INITIALIZED state once the command has successfully completed. Keep in mind the AdapterInfo->State is the active state of the adapter (based on software interrogation), and the CdbPtr->StateFlags is the passed back information that is reflected to the caller of the UNDI API.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 65 of file Decode.c.

VOID UNDI_Initialize ( IN PXE_CDB CdbPtr,
NIC_DATA_INSTANCE AdapterInfo 
)

This routine resets the network adapter and initializes the UNDI using the parameters supplied in the CPB. This command must be issued before the network adapter can be setup to transmit and receive packets. Once the memory requirements of the UNDI are obtained by using the GetInitInfo command, a block of non-swappable memory may need to be allocated. The address of this memory must be passed to UNDI during the Initialize in the CPB. This memory is used primarily for transmit and receive buffers. The fields CableDetect, LinkSpeed, Duplex, LoopBack, MemoryPtr, and MemoryLength are set with information that was passed in the CPB and the NIC is initialized. If the NIC initialization fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED Otherwise, AdapterInfo->State is updated with PXE_STATFLAGS_GET_STATE_INITIALIZED showing the state of the UNDI is now initialized.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 332 of file Decode.c.

VOID UNDI_Interrupt ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine can be used to read and/or change the current external interrupt enable settings. Disabling an external interrupt enable prevents and external (hardware) interrupt from being signaled by the network device. Internally the interrupt events can still be polled by using the UNDI_GetState command. The resulting information on the interrupt state will be passed back in the CdbPtr->StatFlags.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 473 of file Decode.c.

VOID UNDI_ip2mac ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to translate a multicast IP address to a multicast MAC address. This results in a MAC address composed of 25 bits of fixed data with the upper 23 bits of the IP address being appended to it. Results passed back in the equivalent of CdbPtr->DBaddr->MAC[0-5].

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 866 of file Decode.c.

VOID UNDI_notify_virtual ( EFI_EVENT  event,
VOID *  context 
)
VOID UNDI_NVData ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to read and write non-volatile storage on the NIC (if supported). The NVRAM could be EEPROM, FLASH, or battery backed RAM. This is an optional function according to the UNDI specification (or will be......)

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 925 of file Decode.c.

VOID UNDI_Receive ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

When the network adapter has received a frame, this command is used to copy the frame into the driver/application storage location. Once a frame has been copied, it is removed from the receive queue.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 1237 of file Decode.c.

VOID UNDI_RecFilter ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to read and change receive filters and, if supported, read and change multicast MAC address filter list.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 547 of file Decode.c.

VOID UNDI_Reset ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine resets the network adapter and initializes the UNDI using the parameters supplied in the CPB. The transmit and receive queues are emptied and any pending interrupts are cleared. If the NIC reset fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 399 of file Decode.c.

VOID UNDI_Shutdown ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine resets the network adapter and leaves it in a safe state for another driver to initialize. Any pending transmits or receives are lost. Receive filters and external interrupt enables are disabled. Once the UNDI has been shutdown, it can then be stopped or initialized again. If the NIC reset fails, the CdbPtr->StatFlags are updated with PXE_STATFLAGS_COMMAND_FAILED Otherwise, AdapterInfo->State is updated with PXE_STATFLAGS_GET_STATE_STARTED showing the state of the NIC as being started.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 438 of file Decode.c.

VOID UNDI_Start ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to change the operational state of the UNDI from stopped to started. It will do this as long as the adapter's state is PXE_STATFLAGS_GET_STATE_STOPPED, otherwise the CdbPtr->StatFlags will reflect a command failure, and the CdbPtr->StatCode will reflect the UNDI as having already been started. This routine is modified to reflect the undi 1.1 specification changes. The changes in the spec are mainly in the callback routines, the new spec adds 3 more callbacks and a unique id. Since this UNDI supports both old and new undi specifications, The NIC's data structure is filled in with the callback routines (depending on the version) pointed to in the caller's CpbPtr. This seeds the Delay, Virt2Phys, Block, and Mem_IO for old and new versions and Map_Mem, UnMap_Mem and Sync_Mem routines and a unique id variable for the new version. This is the function which an external entity (SNP, O/S, etc) would call to provide it's I/O abstraction to the UNDI. It's final action is to change the AdapterInfo->State to PXE_STATFLAGS_GET_STATE_STARTED.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 100 of file Decode.c.

VOID UNDI_Statistics ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to read and clear the NIC traffic statistics. This command is supported only if the !PXE structure's Implementation flags say so. Results will be parsed out in the following manner: CdbPtr->DBaddr.Data[0] R Total Frames (Including frames with errors and dropped frames) CdbPtr->DBaddr.Data[1] R Good Frames (All frames copied into receive buffer) CdbPtr->DBaddr.Data[2] R Undersize Frames (Frames below minimum length for media <64 for ethernet) CdbPtr->DBaddr.Data[4] R Dropped Frames (Frames that were dropped because receive buffers were full) CdbPtr->DBaddr.Data[8] R CRC Error Frames (Frames with alignment or CRC errors) CdbPtr->DBaddr.Data[A] T Total Frames (Including frames with errors and dropped frames) CdbPtr->DBaddr.Data[B] T Good Frames (All frames copied into transmit buffer) CdbPtr->DBaddr.Data[C] T Undersize Frames (Frames below minimum length for media <64 for ethernet) CdbPtr->DBaddr.Data[E] T Dropped Frames (Frames that were dropped because of collisions) CdbPtr->DBaddr.Data[14] T Total Collision Frames (Total collisions on this subnet)

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 829 of file Decode.c.

VOID UNDI_Status ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine returns the current interrupt status and/or the transmitted buffer addresses. If the current interrupt status is returned, pending interrupts will be acknowledged by this command. Transmitted buffer addresses that are written to the DB are removed from the transmit buffer queue. Normally, this command would be polled with interrupts disabled. The transmit buffers are returned in CdbPtr->DBaddr->TxBufer[0 - NumEntries]. The interrupt status is returned in CdbPtr->StatFlags.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 977 of file Decode.c.

VOID UNDI_StnAddr ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to get the current station and broadcast MAC addresses, and to change the current station MAC address.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 751 of file Decode.c.

VOID UNDI_Stop ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to change the operational state of the UNDI from started to stopped. It will not do this if the adapter's state is PXE_STATFLAGS_GET_STATE_INITIALIZED, otherwise the CdbPtr->StatFlags will reflect a command failure, and the CdbPtr->StatCode will reflect the UNDI as having already not been shut down. The NIC's data structure will have the Delay, Virt2Phys, and Block, pointers zero'd out.. It's final action is to change the AdapterInfo->State to PXE_STATFLAGS_GET_STATE_STOPPED.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 191 of file Decode.c.

VOID UNDI_Transmit ( IN PXE_CDB CdbPtr,
IN NIC_DATA_INSTANCE AdapterInfo 
)

This routine is used to place a packet into the transmit queue. The data buffers given to this command are to be considered locked and the application or network driver loses ownership of these buffers and must not free or relocate them until the ownership returns. When the packets are transmitted, a transmit complete interrupt is generated (if interrupts are disabled, the transmit interrupt status is still set and can be checked using the UNDI_Status command. Some implementations and adapters support transmitting multiple packets with one transmit command. If this feature is supported, the transmit CPBs can be linked in one transmit command. All UNDIs support fragmented frames, now all network devices or protocols do. If a fragmented frame CPB is given to UNDI and the network device does not support fragmented frames (see !PXE.Implementation flag), the UNDI will have to copy the fragments into a local buffer before transmitting.

Parameters:
CdbPtrPointer to the command descriptor block.
AdapterInfoPointer to the NIC data structure information which the UNDI driver is layering on..
Returns:
None

Definition at line 1202 of file Decode.c.

EFI_STATUS EFIAPI UndiDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start this driver on Controller by opening PciIo and DevicePath protocol. Initialize PXE structures, create a copy of the Controller Device Path with the NIC's MAC address appended to it, install the NetworkInterfaceIdentifier protocol on the newly created Device Path.

Parameters:
ThisProtocol instance pointer.
ControllerHandle of device to work with.
RemainingDevicePathNot used, always produce all possible children.
Return values:
EFI_SUCCESSThis driver is added to Controller.
otherThis driver does not support this device.

Definition at line 233 of file Init.c.

EFI_STATUS EFIAPI UndiDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on Controller by removing NetworkInterfaceIdentifier protocol and closing the DevicePath and PciIo protocols on Controller.

Parameters:
ThisProtocol instance pointer.
ControllerHandle of device to stop driver on.
NumberOfChildrenHow many children need to be stopped.
ChildHandleBufferNot used.
Return values:
EFI_SUCCESSThis driver is removed Controller.
otherThis driver was not removed from this device.

Definition at line 564 of file Init.c.

EFI_STATUS EFIAPI UndiDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. Any ControllerHandle than contains a DevicePath, PciIo protocol, Class code of 2, Vendor ID of 0x8086, and DeviceId of (D100_DEVICE_ID || D102_DEVICE_ID || ICH3_DEVICE_ID_1 || ICH3_DEVICE_ID_2 || ICH3_DEVICE_ID_3 || ICH3_DEVICE_ID_4 || ICH3_DEVICE_ID_5 || ICH3_DEVICE_ID_6 || ICH3_DEVICE_ID_7 || ICH3_DEVICE_ID_8) can be supported.

Parameters:
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathNot used.
Return values:
EFI_SUCCESSThis driver supports this device.
otherThis driver does not support this device.

Definition at line 128 of file Init.c.

VOID EFIAPI UndiNotifyExitBs ( EFI_EVENT  Event,
VOID *  Context 
)

When EFI is shuting down the boot services, we need to install a configuration table for UNDI to work at runtime!

(Standard Event handler)

Returns:
None

Definition at line 102 of file Init.c.

INT32 validate_mcip ( PXE_MAC_ADDR MCastAddr)
VOID XmitWaitForCompletion ( NIC_DATA_INSTANCE AdapterInfo)

TODO: Add function description

Parameters:
AdapterInfoTODO: add argument description
Returns:
TODO: add return values

Definition at line 3286 of file E100b.c.


Variable Documentation

Definition at line 20 of file Decode.c.

Definition at line 20 of file Init.c.

UNDI32_DEV* UNDI32DeviceList[MAX_NIC_INTERFACES]

Definition at line 21 of file Init.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines