TianoCore EDK2 master
Loading...
Searching...
No Matches
PxeFunction.c File Reference
#include "DriverBinding.h"

Go to the source code of this file.

Functions

VOID EFIAPI UndiRateLimiterCallback (IN EFI_EVENT Event, IN VOID *Context)
 
VOID UndiGetState (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiStart (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiStop (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiGetInitInfo (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiGetConfigInfo (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiInitialize (IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
 
UINT16 Initialize (IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
 
VOID UndiReset (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiShutdown (IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
 
VOID UndiInterruptEnable (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiReceiveFilter (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
UINT16 SetFilter (IN NIC_DATA *Nic, IN UINT16 SetFilter, IN UINT64 CpbAddr, IN UINT32 CpbSize)
 
VOID UndiStationAddress (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiStatistics (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
UINT16 Statistics (IN NIC_DATA *Nic, IN UINT64 DbAddr, IN UINT16 DbSize)
 
VOID UndiMcastIp2Mac (IN OUT PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiNvData (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiGetStatus (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiFillHeader (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
VOID UndiTransmit (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
UINT16 Transmit (IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic, IN UINT64 CpbAddr, IN UINT16 OpFlags)
 
VOID UndiReceive (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
UINT16 Receive (IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic, IN UINT64 CpbAddr, IN OUT UINT64 DbAddr)
 
VOID PxeStructInit (OUT PXE_SW_UNDI *PxeSw)
 
VOID UpdateNicNum (IN NIC_DATA *Nic, IN OUT PXE_SW_UNDI *PxeSw)
 
EFI_STATUS EFIAPI UndiApiEntry (IN UINT64 Cdb)
 
UINTN MapIt (IN NIC_DATA *Nic, IN UINT64 MemAddr, IN UINT32 Size, IN UINT32 Direction, OUT UINT64 MappedAddr)
 
VOID UnMapIt (IN NIC_DATA *Nic, IN UINT64 MemAddr, IN UINT32 Size, IN UINT32 Direction, IN UINT64 MappedAddr)
 

Variables

API_FUNC gUndiApiTable []
 

Detailed Description

This file contains code for UNDI command based on UEFI specification.

Copyright (c) 2023, American Megatrends International LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PxeFunction.c.

Function Documentation

◆ Initialize()

UINT16 Initialize ( IN PXE_CDB Cdb,
IN OUT NIC_DATA Nic 
)

Initialize Network interface controller data.

Parameters
[in]CdbA pointer to the command descriptor block.
[in,out]NicA pointer to the Network interface controller data.
Return values
StatusA value of Pxe statcode.

Definition at line 492 of file PxeFunction.c.

◆ MapIt()

UINTN MapIt ( IN NIC_DATA Nic,
IN UINT64  MemAddr,
IN UINT32  Size,
IN UINT32  Direction,
OUT UINT64  MappedAddr 
)

Map virtual memory address for DMA. This field can be set to zero if there is no mapping service.

Parameters
[in]NicA pointer to the Network interface controller data.
[in]MemAddrVirtual address to be mapped.
[in]SizeSize of memory to be mapped.
[in]DirectionDirection of data flow for this memory's usage: cpu->device, device->cpu or both ways.
[out]MappedAddrPointer to return the mapped device address.

Definition at line 1746 of file PxeFunction.c.

◆ PxeStructInit()

VOID PxeStructInit ( OUT PXE_SW_UNDI PxeSw)

Fill out PXE SW UNDI structure.

Parameters
[out]PxeSwA pointer to the PXE SW UNDI structure.

Definition at line 1641 of file PxeFunction.c.

◆ Receive()

UINT16 Receive ( IN PXE_CDB Cdb,
IN OUT NIC_DATA Nic,
IN UINT64  CpbAddr,
IN OUT UINT64  DbAddr 
)

Use USB Ethernet Protocol Bulk in command to receive data.

Parameters
[in]CdbA pointer to the command descriptor block.
[in,out]NicA pointer to the Network interface controller data.
[in]CpbAddrCommand Parameter Block Address.
[in,out]DbAddrData Block Address.

Definition at line 1528 of file PxeFunction.c.

◆ SetFilter()

UINT16 SetFilter ( IN NIC_DATA Nic,
IN UINT16  SetFilter,
IN UINT64  CpbAddr,
IN UINT32  CpbSize 
)

Set PXE receive filter.

Parameters
[in]NicA pointer to the Network interface controller data.
[in]SetFilterPXE receive filter
[in]CpbAddrCommand Parameter Block Address
[in]CpbSizeCommand Parameter Block Size

Definition at line 804 of file PxeFunction.c.

◆ Statistics()

UINT16 Statistics ( IN NIC_DATA Nic,
IN UINT64  DbAddr,
IN UINT16  DbSize 
)

Return data for DB data.

Parameters
[in]NicA pointer to the Network interface controller data.
[in]DbAddrData Block Address.
[in]DbSizeData Block Size.

Definition at line 995 of file PxeFunction.c.

◆ Transmit()

UINT16 Transmit ( IN PXE_CDB Cdb,
IN OUT NIC_DATA Nic,
IN UINT64  CpbAddr,
IN UINT16  OpFlags 
)

Use USB Ethernet Protocol Bulk out command to transmit data.

Parameters
[in]CdbA pointer to the command descriptor block.
[in,out]NicA pointer to the Network interface controller data.
[in]CpbAddrCommand Parameter Block Address.
[in]OpFlagsOperation Flags.

Definition at line 1369 of file PxeFunction.c.

◆ UndiApiEntry()

EFI_STATUS EFIAPI UndiApiEntry ( IN UINT64  Cdb)

UNDI API table entry.

Parameters
[in]CdbA pointer to the command descriptor block.

Definition at line 1716 of file PxeFunction.c.

◆ UndiFillHeader()

VOID UndiFillHeader ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to fill the media header(s) in transmit packet(s).

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1225 of file PxeFunction.c.

◆ UndiGetConfigInfo()

VOID UndiGetConfigInfo ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to retrieve configuration information about the NIC being controlled by the UNDI.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 338 of file PxeFunction.c.

◆ UndiGetInitInfo()

VOID UndiGetInitInfo ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to retrieve initialization information that is needed by drivers and applications to initialized UNDI.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 268 of file PxeFunction.c.

◆ UndiGetState()

VOID UndiGetState ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to determine the operational state of the UNDI.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 63 of file PxeFunction.c.

◆ UndiGetStatus()

VOID UndiGetStatus ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command returns the current interrupt status and/or the transmitted buffer addresses and the current media status.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1131 of file PxeFunction.c.

◆ UndiInitialize()

VOID UndiInitialize ( IN PXE_CDB Cdb,
IN OUT NIC_DATA Nic 
)

This command resets the network adapter and initializes UNDI using the parameters supplied in the CPB.

Parameters
[in]CdbA pointer to the command descriptor block.
[in,out]NicA pointer to the Network interface controller data.

Definition at line 390 of file PxeFunction.c.

◆ UndiInterruptEnable()

VOID UndiInterruptEnable ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

The Interrupt Enables command can be used to read and/or change the current external interrupt enable settings.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 667 of file PxeFunction.c.

◆ UndiMcastIp2Mac()

VOID UndiMcastIp2Mac ( IN OUT PXE_CDB Cdb,
IN NIC_DATA Nic 
)

Translate a multicast IPv4 or IPv6 address to a multicast MAC address.

Parameters
[in,out]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1032 of file PxeFunction.c.

◆ UndiNvData()

VOID UndiNvData ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to read and write (if supported by NIC H/W) nonvolatile storage on the NIC.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1103 of file PxeFunction.c.

◆ UndiRateLimiterCallback()

VOID EFIAPI UndiRateLimiterCallback ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Callback function for enable Rate Limiter.

Parameters
[in]EventEvent whose notification function is being invoked
[in]ContextPointer to the notification function's context

Definition at line 41 of file PxeFunction.c.

◆ UndiReceive()

VOID UndiReceive ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

When the network adapter has received a frame, this command is used to copy the frame into driver/application storage.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1473 of file PxeFunction.c.

◆ UndiReceiveFilter()

VOID UndiReceiveFilter ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

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

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 695 of file PxeFunction.c.

◆ UndiReset()

VOID UndiReset ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command resets the network adapter and reinitializes the UNDI with the same parameters provided in the Initialize command.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 550 of file PxeFunction.c.

◆ UndiShutdown()

VOID UndiShutdown ( IN PXE_CDB Cdb,
IN OUT NIC_DATA Nic 
)

The Shutdown command resets the network adapter and leaves it in a safe state for another driver to initialize.

Parameters
[in]CdbA pointer to the command descriptor block.
[in,out]NicA pointer to the Network interface controller data.

Definition at line 614 of file PxeFunction.c.

◆ UndiStart()

VOID UndiStart ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to change the UNDI operational state from stopped to started.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 106 of file PxeFunction.c.

◆ UndiStationAddress()

VOID UndiStationAddress ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

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

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 871 of file PxeFunction.c.

◆ UndiStatistics()

VOID UndiStatistics ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to read and clear the NIC traffic statistics.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 941 of file PxeFunction.c.

◆ UndiStop()

VOID UndiStop ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This command is used to change the UNDI operational state from started to stopped.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 201 of file PxeFunction.c.

◆ UndiTransmit()

VOID UndiTransmit ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

The Transmit command is used to place a packet into the transmit queue.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.

Definition at line 1308 of file PxeFunction.c.

◆ UnMapIt()

VOID UnMapIt ( IN NIC_DATA Nic,
IN UINT64  MemAddr,
IN UINT32  Size,
IN UINT32  Direction,
IN UINT64  MappedAddr 
)

Un-map previously mapped virtual memory address. This field can be set to zero only if the Map_Mem() service is also set to zero.

Parameters
[in]NicA pointer to the Network interface controller data.
[in]MemAddrVirtual address to be mapped.
[in]SizeSize of memory to be mapped.
[in]DirectionDirection of data flow for this memory's usage: cpu->device, device->cpu or both ways.
[in]MappedAddrPointer to return the mapped device address.

Definition at line 1786 of file PxeFunction.c.

◆ UpdateNicNum()

VOID UpdateNicNum ( IN NIC_DATA Nic,
IN OUT PXE_SW_UNDI PxeSw 
)

Update NIC number.

Parameters
[in]NicA pointer to the Network interface controller data.
[in,out]PxeSwA pointer to the PXE SW UNDI structure.

Definition at line 1681 of file PxeFunction.c.

Variable Documentation

◆ gUndiApiTable

API_FUNC gUndiApiTable[]
Initial value:
= {
}
VOID UndiStatistics(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:941
VOID UndiGetInitInfo(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:268
VOID UndiInterruptEnable(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:667
VOID UndiGetConfigInfo(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:338
VOID UndiReceive(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1473
VOID UndiShutdown(IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
Definition: PxeFunction.c:614
VOID UndiTransmit(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1308
VOID UndiStationAddress(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:871
VOID UndiStart(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:106
VOID UndiNvData(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1103
VOID UndiReceiveFilter(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:695
VOID UndiFillHeader(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1225
VOID UndiStop(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:201
VOID UndiInitialize(IN PXE_CDB *Cdb, IN OUT NIC_DATA *Nic)
Definition: PxeFunction.c:390
VOID UndiReset(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:550
VOID UndiGetStatus(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1131
VOID UndiMcastIp2Mac(IN OUT PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:1032
VOID UndiGetState(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
Definition: PxeFunction.c:63

Definition at line 11 of file PxeFunction.c.