TianoCore EDK2 master
|
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiUsbLib.h>
#include <Protocol/UsbIo.h>
#include <Protocol/NetworkInterfaceIdentifier.h>
#include <Protocol/UsbEthernetProtocol.h>
Go to the source code of this file.
Data Structures | |
struct | ETHERNET_HEADER |
struct | NIC_DEVICE |
Macros | |
#define | NETWORK_COMMON_DRIVER_VERSION 1 |
#define | NETWORK_COMMON_POLLING_INTERVAL 0x10 |
#define | RX_BUFFER_COUNT 32 |
#define | TX_BUFFER_COUNT 32 |
#define | MEMORY_REQUIRE 0 |
#define | UNDI_DEV_SIGNATURE SIGNATURE_32('u','n','d','i') |
#define | UNDI_DEV_FROM_THIS(a) CR(a, NIC_DEVICE, NiiProtocol, UNDI_DEV_SIGNATURE) |
#define | UNDI_DEV_FROM_NIC(a) CR(a, NIC_DEVICE, NicInfo, UNDI_DEV_SIGNATURE) |
Typedefs | |
typedef VOID(* | API_FUNC) (PXE_CDB *, NIC_DATA *) |
Variables | |
PXE_SW_UNDI * | gPxe |
NIC_DEVICE * | gLanDeviceList [MAX_LAN_INTERFACE] |
EFI_COMPONENT_NAME2_PROTOCOL | gNetworkCommonComponentName2 |
Header file for for USB network common driver
Copyright (c) 2023, American Megatrends International LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DriverBinding.h.
#define MEMORY_REQUIRE 0 |
Definition at line 28 of file DriverBinding.h.
#define NETWORK_COMMON_DRIVER_VERSION 1 |
Definition at line 24 of file DriverBinding.h.
#define NETWORK_COMMON_POLLING_INTERVAL 0x10 |
Definition at line 25 of file DriverBinding.h.
#define RX_BUFFER_COUNT 32 |
Definition at line 26 of file DriverBinding.h.
#define TX_BUFFER_COUNT 32 |
Definition at line 27 of file DriverBinding.h.
#define UNDI_DEV_FROM_NIC | ( | a | ) | CR(a, NIC_DEVICE, NicInfo, UNDI_DEV_SIGNATURE) |
Definition at line 32 of file DriverBinding.h.
#define UNDI_DEV_FROM_THIS | ( | a | ) | CR(a, NIC_DEVICE, NiiProtocol, UNDI_DEV_SIGNATURE) |
Definition at line 31 of file DriverBinding.h.
#define UNDI_DEV_SIGNATURE SIGNATURE_32('u','n','d','i') |
Definition at line 30 of file DriverBinding.h.
Definition at line 52 of file DriverBinding.h.
Initialize Network interface controller data.
[in] | Cdb | A pointer to the command descriptor block. |
[in,out] | Nic | A pointer to the Network interface controller data. |
Status | A value of Pxe statcode. |
Definition at line 492 of file PxeFunction.c.
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.
[in] | Nic | A pointer to the Network interface controller data. |
[in] | MemAddr | Virtual address to be mapped. |
[in] | Size | Size of memory to be mapped. |
[in] | Direction | Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. |
[out] | MappedAddr | Pointer to return the mapped device address. |
Definition at line 1746 of file PxeFunction.c.
EFI_STATUS EFIAPI NetworkCommonDriverStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Network Common Driver Binding Start.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to bind driver to. |
[in] | RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to ControllerHandle |
EFI_DEVICE_ERROR | This driver could not be started due to a device error |
EFI_OUT_OF_RESOURCES | The driver could not install successfully due to a lack of resources. |
other | This driver does not support this device |
Definition at line 143 of file DriverBinding.c.
EFI_STATUS EFIAPI NetworkCommonDriverStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Network Common Driver Binding Stop.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to stop driver on |
[in] | NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
[in] | ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed ControllerHandle |
other | This driver was not removed from this device |
Definition at line 433 of file DriverBinding.c.
EFI_STATUS EFIAPI NetworkCommonSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Network Common Driver Binding Support.
[in] | This | Protocol instance pointer. |
[in] | ControllerHandle | Handle of device to test. |
[in] | RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device. |
EFI_ALREADY_STARTED | This driver is already running on this device. |
other | This driver does not support this device. |
Definition at line 97 of file DriverBinding.c.
VOID PxeStructInit | ( | OUT PXE_SW_UNDI * | PxeSw | ) |
Fill out PXE SW UNDI structure.
[out] | PxeSw | A pointer to the PXE SW UNDI structure. |
Definition at line 1641 of file PxeFunction.c.
Use USB Ethernet Protocol Bulk in command to receive data.
[in] | Cdb | A pointer to the command descriptor block. |
[in,out] | Nic | A pointer to the Network interface controller data. |
[in] | CpbAddr | Command Parameter Block Address. |
[in,out] | DbAddr | Data Block Address. |
Definition at line 1528 of file PxeFunction.c.
Set PXE receive filter.
[in] | Nic | A pointer to the Network interface controller data. |
[in] | SetFilter | PXE receive filter |
[in] | CpbAddr | Command Parameter Block Address |
[in] | CpbSize | Command Parameter Block Size |
Definition at line 804 of file PxeFunction.c.
Return data for DB data.
[in] | Nic | A pointer to the Network interface controller data. |
[in] | DbAddr | Data Block Address. |
[in] | DbSize | Data Block Size. |
Definition at line 995 of file PxeFunction.c.
Use USB Ethernet Protocol Bulk out command to transmit data.
[in] | Cdb | A pointer to the command descriptor block. |
[in,out] | Nic | A pointer to the Network interface controller data. |
[in] | CpbAddr | Command Parameter Block Address. |
[in] | OpFlags | Operation Flags. |
Definition at line 1369 of file PxeFunction.c.
EFI_STATUS EFIAPI UndiApiEntry | ( | IN UINT64 | Cdb | ) |
UNDI API table entry.
[in] | Cdb | A pointer to the command descriptor block. |
Definition at line 1716 of file PxeFunction.c.
This command is used to fill the media header(s) in transmit packet(s).
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1225 of file PxeFunction.c.
This command is used to retrieve configuration information about the NIC being controlled by the UNDI.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 338 of file PxeFunction.c.
This command is used to retrieve initialization information that is needed by drivers and applications to initialized UNDI.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 268 of file PxeFunction.c.
This command is used to determine the operational state of the UNDI.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 63 of file PxeFunction.c.
This command returns the current interrupt status and/or the transmitted buffer addresses and the current media status.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1131 of file PxeFunction.c.
This command resets the network adapter and initializes UNDI using the parameters supplied in the CPB.
[in] | Cdb | A pointer to the command descriptor block. |
[in,out] | Nic | A pointer to the Network interface controller data. |
Definition at line 390 of file PxeFunction.c.
The Interrupt Enables command can be used to read and/or change the current external interrupt enable settings.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 667 of file PxeFunction.c.
Translate a multicast IPv4 or IPv6 address to a multicast MAC address.
[in,out] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1032 of file PxeFunction.c.
This command is used to read and write (if supported by NIC H/W) nonvolatile storage on the NIC.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1103 of file PxeFunction.c.
When the network adapter has received a frame, this command is used to copy the frame into driver/application storage.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1473 of file PxeFunction.c.
This command is used to read and change receive filters and, if supported, read and change the multicast MAC address filter list.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 695 of file PxeFunction.c.
This command resets the network adapter and reinitializes the UNDI with the same parameters provided in the Initialize command.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 550 of file PxeFunction.c.
The Shutdown command resets the network adapter and leaves it in a safe state for another driver to initialize.
[in] | Cdb | A pointer to the command descriptor block. |
[in,out] | Nic | A pointer to the Network interface controller data. |
Definition at line 614 of file PxeFunction.c.
This command is used to change the UNDI operational state from stopped to started.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 106 of file PxeFunction.c.
This command is used to get current station and broadcast MAC addresses and, if supported, to change the current station MAC address.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 871 of file PxeFunction.c.
This command is used to read and clear the NIC traffic statistics.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 941 of file PxeFunction.c.
This command is used to change the UNDI operational state from started to stopped.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 201 of file PxeFunction.c.
The Transmit command is used to place a packet into the transmit queue.
[in] | Cdb | A pointer to the command descriptor block. |
[in] | Nic | A pointer to the Network interface controller data. |
Definition at line 1308 of file PxeFunction.c.
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.
[in] | Nic | A pointer to the Network interface controller data. |
[in] | MemAddr | Virtual address to be mapped. |
[in] | Size | Size of memory to be mapped. |
[in] | Direction | Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. |
[in] | MappedAddr | Pointer to return the mapped device address. |
Definition at line 1786 of file PxeFunction.c.
VOID UpdateNicNum | ( | IN NIC_DATA * | Nic, |
IN OUT PXE_SW_UNDI * | PxeSw | ||
) |
Update NIC number.
[in] | Nic | A pointer to the Network interface controller data. |
[in,out] | PxeSw | A pointer to the PXE SW UNDI structure. |
Definition at line 1681 of file PxeFunction.c.
|
extern |
Definition at line 11 of file DriverBinding.c.
|
extern |
Definition at line 49 of file ComponentName.c.
|
extern |
Definition at line 10 of file DriverBinding.c.