iPXE
|
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <byteswap.h>
#include <ipxe/netdevice.h>
#include <ipxe/vlan.h>
#include <ipxe/iobuf.h>
#include <ipxe/in.h>
#include <ipxe/version.h>
#include <ipxe/console.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>
#include <ipxe/efi/efi_strings.h>
#include <ipxe/efi/efi_path.h>
#include <ipxe/efi/efi_utils.h>
#include <ipxe/efi/efi_watchdog.h>
#include <ipxe/efi/efi_null.h>
#include <ipxe/efi/efi_snp.h>
#include <usr/autoboot.h>
#include <config/general.h>
Go to the source code of this file.
Data Structures | |
union | PXE_CPB_ANY |
Union type for command parameter blocks. More... | |
union | PXE_DB_ANY |
Union type for data blocks. More... | |
Variables | |
static int | efi_snp_claimed |
Network devices are currently claimed for use by iPXE. More... | |
static struct efi_saved_tpl | efi_snp_saved_tpl |
TPL prior to network devices being claimed. More... | |
static EFI_SIMPLE_NETWORK_PROTOCOL | efi_snp_device_snp |
SNP interface. More... | |
static PXE_SW_UNDI | efi_snp_undi |
UNDI interface. More... | |
static EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL | efi_snp_device_nii |
Network Identification Interface (NII) More... | |
static EFI_VLAN_CONFIG_PROTOCOL | efi_vlan |
VLAN configuration protocol. More... | |
static EFI_LOAD_FILE_PROTOCOL | efi_snp_load_file_protocol |
Load file protocol. More... | |
struct net_driver efi_snp_driver | __net_driver |
SNP driver. More... | |
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
static |
List of SNP devices.
|
static |
Set EFI SNP mode state.
snp | SNP interface |
Definition at line 91 of file efi_snp.c.
References efi_snp_claimed, EfiSimpleNetworkInitialized, EfiSimpleNetworkStarted, EfiSimpleNetworkStopped, efi_snp_device::mode, efi_snp_device::netdev, netdev, netdev_is_open(), efi_snp_device::started, and EFI_SIMPLE_NETWORK_MODE::State.
Referenced by efi_snp_add_claim(), efi_snp_initialize(), efi_snp_notify(), efi_snp_reset(), efi_snp_shutdown(), efi_snp_start(), and efi_snp_stop().
|
static |
Set EFI SNP mode based on iPXE net device parameters.
snp | SNP interface |
Definition at line 120 of file efi_snp.c.
References assert(), EFI_SIMPLE_NETWORK_MODE::BroadcastAddress, EFI_SIMPLE_NETWORK_MODE::CurrentAddress, EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST, EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST, EFI_SIMPLE_NETWORK_RECEIVE_UNICAST, FALSE, net_device::hw_addr, EFI_SIMPLE_NETWORK_MODE::HwAddressSize, EFI_SIMPLE_NETWORK_MODE::IfType, ll_protocol::init_addr, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_broadcast, ll_protocol::ll_header_len, ll_protocol::ll_proto, net_device::ll_protocol, EFI_SIMPLE_NETWORK_MODE::MacAddressChangeable, EFI_SIMPLE_NETWORK_MODE::MaxPacketSize, EFI_SIMPLE_NETWORK_MODE::MediaHeaderSize, EFI_SIMPLE_NETWORK_MODE::MediaPresent, EFI_SIMPLE_NETWORK_MODE::MediaPresentSupported, memcpy(), efi_snp_device::mode, net_device::mtu, efi_snp_device::netdev, netdev, netdev_link_ok(), ntohs, EFI_SIMPLE_NETWORK_MODE::PermanentAddress, EFI_SIMPLE_NETWORK_MODE::ReceiveFilterMask, and TRUE.
Referenced by efi_snp_probe().
|
static |
Flush transmit ring and receive queue.
snpdev | SNP device |
Definition at line 147 of file efi_snp.c.
References free_iob(), io_buffer::list, list_del, list_for_each_entry_safe, efi_snp_device::rx, tmp, efi_snp_device::tx_cons, and efi_snp_device::tx_prod.
Referenced by efi_snp_reset(), and efi_snp_shutdown().
|
static |
Poll net device and count received packets.
snpdev | SNP device |
Definition at line 167 of file efi_snp.c.
References EFI_SYSTEM_TABLE::BootServices, EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT, efi_systab, efi_snp_device::interrupts, io_buffer::list, list_add_tail, efi_snp_device::netdev, netdev_poll(), netdev_rx_dequeue(), efi_snp_device::rx, EFI_BOOT_SERVICES::SignalEvent, efi_snp_device::snp, and _EFI_SIMPLE_NETWORK_PROTOCOL::WaitForPacket.
Referenced by efi_snp_get_status(), efi_snp_receive(), and efi_snp_wait_for_packet().
|
static |
Change SNP state from "stopped" to "started".
snp | SNP interface |
efirc | EFI status code |
Definition at line 189 of file efi_snp.c.
References container_of, DBGC, efi_snp_claimed, efi_snp_set_state(), efi_snp_device::snp, and efi_snp_device::started.
Referenced by efi_undi_start().
|
static |
Change SNP state from "started" to "stopped".
snp | SNP interface |
efirc | EFI status code |
Definition at line 213 of file efi_snp.c.
References container_of, DBGC, EFI_NOT_READY, efi_snp_claimed, efi_snp_set_state(), efi_snp_device::snp, and efi_snp_device::started.
Referenced by efi_undi_stop().
|
static |
Open the network device.
snp | SNP interface |
extra_rx_bufsize | Extra RX buffer size, in bytes |
extra_tx_bufsize | Extra TX buffer size, in bytes |
efirc | EFI status code |
Definition at line 238 of file efi_snp.c.
References container_of, DBGC, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_set_state(), EFIRC, net_device::name, efi_snp_device::netdev, netdev_open(), rc, efi_snp_device::snp, and strerror().
Referenced by efi_undi_initialize().
|
static |
Reset the network device.
snp | SNP interface |
ext_verify | Extended verification required |
efirc | EFI status code |
Definition at line 285 of file efi_snp.c.
References container_of, DBGC, EAGAIN, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_flush(), efi_snp_set_state(), EFIRC, net_device::name, efi_snp_device::netdev, netdev_close(), netdev_open(), rc, efi_snp_device::snp, and strerror().
Referenced by efi_undi_reset().
|
static |
Shut down the network device.
snp | SNP interface |
efirc | EFI status code |
Definition at line 329 of file efi_snp.c.
References container_of, DBGC, EFI_NOT_READY, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_flush(), efi_snp_set_state(), efi_snp_device::netdev, netdev_close(), and efi_snp_device::snp.
Referenced by efi_undi_shutdown().
|
static |
Manage receive filters.
snp | SNP interface |
enable | Receive filters to enable |
disable | Receive filters to disable |
mcast_reset | Reset multicast filters |
mcast_count | Number of multicast filters |
mcast | Multicast filters |
efirc | EFI status code |
Definition at line 366 of file efi_snp.c.
References container_of, DBGC, DBGC2_HDA, ll_protocol::ll_addr_len, net_device::ll_protocol, efi_snp_device::netdev, and efi_snp_device::snp.
|
static |
Set station address.
snp | SNP interface |
reset | Reset to permanent address |
new | New station address |
efirc | EFI status code |
Definition at line 400 of file efi_snp.c.
References container_of, DBGC, EFI_NOT_READY, efi_snp_claimed, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_protocol, memcpy(), efi_snp_device::mode, efi_snp_device::netdev, netdev_is_open(), ll_protocol::ntoa, EFI_SIMPLE_NETWORK_MODE::PermanentAddress, and efi_snp_device::snp.
Referenced by efi_undi_station_address().
|
static |
Get (or reset) statistics.
snp | SNP interface |
reset | Reset statistics |
stats_len | Size of statistics table |
stats | Statistics table |
efirc | EFI status code |
Definition at line 437 of file efi_snp.c.
References net_device_stats::bad, container_of, DBGC, EFI_NOT_READY, efi_snp_claimed, net_device_stats::good, memcpy(), memset(), efi_snp_device::netdev, net_device::rx_stats, EFI_NETWORK_STATISTICS::RxDroppedFrames, EFI_NETWORK_STATISTICS::RxGoodFrames, EFI_NETWORK_STATISTICS::RxTotalFrames, efi_snp_device::snp, net_device::tx_stats, EFI_NETWORK_STATISTICS::TxDroppedFrames, EFI_NETWORK_STATISTICS::TxGoodFrames, and EFI_NETWORK_STATISTICS::TxTotalFrames.
|
static |
Convert multicast IP address to MAC address.
snp | SNP interface |
ipv6 | Address is IPv6 |
ip | IP address |
mac | MAC address |
efirc | EFI status code |
Definition at line 486 of file efi_snp.c.
References AF_INET, AF_INET6, container_of, DBGC, EFI_NOT_READY, efi_snp_claimed, EFIRC, inet_ntoa(), ip, net_device::ll_protocol, mac, ll_protocol::mc_hash, efi_snp_device::netdev, rc, efi_snp_device::snp, and strerror().
|
static |
Read or write non-volatile storage.
snp | SNP interface |
read | Operation is a read |
offset | Starting offset within NVRAM |
len | Length of data buffer |
data | Data buffer |
efirc | EFI status code |
Definition at line 524 of file efi_snp.c.
References container_of, data, DBGC, DBGC2_HDA, EFI_NOT_READY, efi_snp_claimed, EFI_UNSUPPORTED, len, offset, read, and efi_snp_device::snp.
|
static |
Read interrupt status and TX recycled buffer status.
snp | SNP interface |
interrupts | Interrupt status, or NULL |
txbuf | Recycled transmit buffer address, or NULL |
efirc | EFI status code |
Definition at line 551 of file efi_snp.c.
References container_of, DBGC2, EFI_NOT_READY, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, EFI_SNP_NUM_TX, efi_snp_poll(), efi_snp_device::interrupts, NULL, efi_snp_device::snp, efi_snp_device::tx, efi_snp_device::tx_cons, and efi_snp_device::tx_prod.
Referenced by efi_undi_get_status().
|
static |
Start packet transmission.
snp | SNP interface |
ll_header_len | Link-layer header length, if to be filled in |
len | Length of data buffer |
data | Data buffer |
ll_src | Link-layer source address, if specified |
ll_dest | Link-layer destination address, if specified |
net_proto | Network-layer protocol (in host order) |
efirc | EFI status code |
Definition at line 610 of file efi_snp.c.
References alloc_iob(), container_of, EFI_SIMPLE_NETWORK_MODE::CurrentAddress, data, DBGC, DBGC2, EAGAIN, efi_raise_tpl(), efi_restore_tpl(), EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT, efi_snp_claimed, EFI_SNP_NUM_TX, EFIRC, EINVAL, ENOBUFS, ENOMEM, free_iob(), htons, efi_snp_device::interrupts, iob_disown, iob_pull, iob_put, iob_reserve, IOB_ZLEN, len, ll_protocol::ll_header_len, net_device::ll_protocol, MAX_LL_HEADER_LEN, memcpy(), efi_snp_device::mode, efi_snp_device::netdev, netdev_tx(), ll_protocol::ntoa, ll_protocol::push, rc, efi_snp_device::snp, strerror(), efi_snp_device::tx, efi_snp_device::tx_cons, and efi_snp_device::tx_prod.
Referenced by efi_undi_transmit().
|
static |
Receive packet.
snp | SNP interface |
ll_header_len | Link-layer header length, if to be filled in |
len | Length of data buffer |
data | Data buffer |
ll_src | Link-layer source address, if specified |
ll_dest | Link-layer destination address, if specified |
net_proto | Network-layer protocol (in host order) |
efirc | EFI status code |
Definition at line 760 of file efi_snp.c.
References container_of, data, io_buffer::data, DBGC, DBGC2, EAGAIN, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_poll(), EFIRC, ERANGE, free_iob(), iob_len(), len, io_buffer::list, list_del, list_first_entry, ll_protocol::ll_addr_len, ll_protocol::ll_header_len, net_device::ll_protocol, memcpy(), efi_snp_device::netdev, ntohs, ll_protocol::pull, rc, efi_snp_device::rx, efi_snp_device::snp, and strerror().
Referenced by efi_undi_receive().
Poll event.
event | Event |
context | Event context |
Definition at line 846 of file efi_snp.c.
References DBGCP, efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_poll(), efi_snp_device::netdev, and netdev_is_open().
Referenced by efi_snp_probe().
|
static |
Get UNDI SNP device interface number.
snpdev | SNP device |
ifnum | UNDI interface number |
Definition at line 935 of file efi_snp.c.
References efi_snp_device::netdev, and net_device::scope_id.
Referenced by efi_snp_probe(), and efi_undi_snpdev().
|
static |
Identify UNDI SNP device.
ifnum | Interface number |
snpdev | SNP device, or NULL if not found |
Definition at line 950 of file efi_snp.c.
References efi_undi_ifnum(), efi_snp_device::list, list_for_each_entry, and NULL.
Referenced by efi_undi_issue().
|
static |
Convert EFI status code to UNDI status code.
efirc | EFI status code |
statcode | UNDI status code |
Definition at line 966 of file efi_snp.c.
References EFI_INVALID_PARAMETER, EFI_NOT_READY, EFI_OUT_OF_RESOURCES, EFI_PROTOCOL_ERROR, EFI_UNSUPPORTED, PXE_STATCODE_BUFFER_FULL, PXE_STATCODE_DEVICE_FAILURE, PXE_STATCODE_INVALID_CDB, PXE_STATCODE_INVALID_PARAMETER, PXE_STATCODE_NO_DATA, and PXE_STATCODE_UNSUPPORTED.
Referenced by efi_undi_issue().
|
static |
Get state.
snpdev | SNP device |
cdb | Command description block |
efirc | EFI status code |
Definition at line 986 of file efi_snp.c.
References DBGC, EfiSimpleNetworkInitialized, EfiSimpleNetworkStarted, efi_snp_device::mode, PXE_STATFLAGS_GET_STATE_INITIALIZED, PXE_STATFLAGS_GET_STATE_STARTED, PXE_STATFLAGS_GET_STATE_STOPPED, EFI_SIMPLE_NETWORK_MODE::State, and s_pxe_cdb::StatFlags.
Referenced by efi_undi_issue().
|
static |
Start.
snpdev | SNP device |
efirc | EFI status code |
Definition at line 1010 of file efi_snp.c.
References DBGC, efi_snp_start(), and efi_snp_device::snp.
Referenced by efi_undi_issue().
|
static |
Stop.
snpdev | SNP device |
efirc | EFI status code |
Definition at line 1028 of file efi_snp.c.
References DBGC, efi_snp_stop(), and efi_snp_device::snp.
Referenced by efi_undi_issue().
|
static |
Get initialisation information.
snpdev | SNP device |
cdb | Command description block |
db | Data block |
efirc | EFI status code |
Definition at line 1048 of file efi_snp.c.
References db, DBGC, ll_protocol::ll_addr_len, ll_protocol::ll_header_len, ll_protocol::ll_proto, net_device::ll_protocol, net_device::max_pkt_len, memset(), efi_snp_device::netdev, netdev, ntohs, PXE_STATFLAGS_CABLE_DETECT_SUPPORTED, PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED, and s_pxe_cdb::StatFlags.
Referenced by efi_undi_issue().
|
static |
Initialise.
snpdev | SNP device |
cdb | Command description block |
efirc | EFI status code |
Definition at line 1075 of file efi_snp.c.
References DBGC, efi_snp_initialize(), efi_snp_device::netdev, netdev, netdev_link_ok(), PXE_STATFLAGS_INITIALIZED_NO_MEDIA, efi_snp_device::snp, and s_pxe_cdb::StatFlags.
Referenced by efi_undi_issue().
|
static |
Reset.
snpdev | SNP device |
efirc | EFI status code |
Definition at line 1099 of file efi_snp.c.
References DBGC, efi_snp_reset(), and efi_snp_device::snp.
Referenced by efi_undi_issue().
|
static |
Shutdown.
snpdev | SNP device |
efirc | EFI status code |
Definition at line 1117 of file efi_snp.c.
References DBGC, efi_snp_shutdown(), and efi_snp_device::snp.
Referenced by efi_undi_issue().
|
static |
Get/set receive filters.
snpdev | SNP device |
cdb | Command description block |
efirc | EFI status code |
Definition at line 1136 of file efi_snp.c.
References DBGC, PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST, PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST, PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS, PXE_STATFLAGS_RECEIVE_FILTER_UNICAST, and s_pxe_cdb::StatFlags.
Referenced by efi_undi_issue().
|
static |
Get/set station address.
snpdev | SNP device |
cdb | Command description block |
cpb | Command parameter block |
efirc | EFI status code |
Definition at line 1158 of file efi_snp.c.
References db, DBGC, efi_snp_station_address(), net_device::hw_addr, ll_protocol::hw_addr_len, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_broadcast, net_device::ll_protocol, mac, memcpy(), memset(), efi_snp_device::netdev, netdev, NULL, s_pxe_cdb::OpFlags, PXE_OPFLAGS_STATION_ADDRESS_RESET, efi_snp_device::snp, and s_pxe_cpb_station_address::StationAddr.
Referenced by efi_undi_issue().
|
static |
Get interrupt status.
snpdev | SNP device |
cdb | Command description block |
db | Data block |
efirc | EFI status code |
Definition at line 1200 of file efi_snp.c.
References db, DBGC2, EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT, EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT, efi_snp_get_status(), iob_len(), io_buffer::list, list_first_entry, memset(), efi_snp_device::netdev, netdev_link_ok(), PXE_STATFLAGS_GET_STATUS_NO_MEDIA, PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN, PXE_STATFLAGS_GET_STATUS_RECEIVE, PXE_STATFLAGS_GET_STATUS_TRANSMIT, PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY, efi_snp_device::rx, efi_snp_device::snp, s_pxe_cdb::StatFlags, efi_snp_device::tx_cons, efi_snp_device::tx_prod, and VOID.
Referenced by efi_undi_issue().
|
static |
Fill header.
snpdev | SNP device |
cdb | Command description block |
cpb | Command parameter block |
efirc | EFI status code |
Definition at line 1254 of file efi_snp.c.
References data, dest, s_pxe_cpb_fill_header::DestAddr, s_pxe_cpb_fill_header_fragmented::DestAddr, EFIRC, PXE_CPB_ANY::fill_header, PXE_CPB_ANY::fill_header_fragmented, s_pxe_cpb_fill_header_fragmented::FragAddr, s_pxe_cpb_fill_header_fragmented::FragDesc, iob_populate(), iob_reserve, ll_protocol::ll_header_len, net_device::ll_protocol, s_pxe_cpb_fill_header::MediaHeader, efi_snp_device::netdev, netdev, s_pxe_cdb::OpFlags, s_pxe_cpb_fill_header::Protocol, s_pxe_cpb_fill_header_fragmented::Protocol, ll_protocol::push, PXE_OPFLAGS_FILL_HEADER_FRAGMENTED, rc, src, s_pxe_cpb_fill_header::SrcAddr, s_pxe_cpb_fill_header_fragmented::SrcAddr, and VOID.
Referenced by efi_undi_issue().
|
static |
Transmit.
snpdev | SNP device |
cpb | Command parameter block |
efirc | EFI status code |
Definition at line 1300 of file efi_snp.c.
References data, s_pxe_cpb_transmit::DataLen, DBGC2, efi_snp_transmit(), s_pxe_cpb_transmit::FrameAddr, NULL, efi_snp_device::snp, and VOID.
Referenced by efi_undi_issue().
|
static |
Receive.
snpdev | SNP device |
cpb | Command parameter block |
efirc | EFI status code |
Definition at line 1322 of file efi_snp.c.
References s_pxe_cpb_receive::BufferAddr, s_pxe_cpb_receive::BufferLen, data, db, DBGC2, dest, efi_snp_receive(), len, ll_protocol::ll_addr_len, ll_protocol::ll_header_len, net_device::ll_protocol, memcpy(), memset(), efi_snp_device::netdev, netdev, PXE_FRAME_TYPE_PROMISCUOUS, efi_snp_device::snp, src, and VOID.
Referenced by efi_undi_issue().
UNDI entry point.
Definition at line 1355 of file efi_snp.c.
References s_pxe_cdb::CPBaddr, db, s_pxe_cdb::DBaddr, DBGC, efi_snp_claimed, efi_undi_fill_header(), efi_undi_get_init_info(), efi_undi_get_state(), efi_undi_get_status(), efi_undi_initialize(), efi_undi_receive(), efi_undi_receive_filters(), efi_undi_reset(), efi_undi_shutdown(), efi_undi_snpdev(), efi_undi_start(), efi_undi_statcode(), efi_undi_station_address(), efi_undi_stop(), efi_undi_transmit(), EFI_UNSUPPORTED, s_pxe_cdb::IFnum, s_pxe_cdb::OpCode, PXE_OPCODE_FILL_HEADER, PXE_OPCODE_GET_INIT_INFO, PXE_OPCODE_GET_STATE, PXE_OPCODE_GET_STATUS, PXE_OPCODE_INITIALIZE, PXE_OPCODE_RECEIVE, PXE_OPCODE_RECEIVE_FILTERS, PXE_OPCODE_RESET, PXE_OPCODE_SHUTDOWN, PXE_OPCODE_START, PXE_OPCODE_STATION_ADDRESS, PXE_OPCODE_STOP, PXE_OPCODE_TRANSMIT, PXE_STATCODE_BUSY, PXE_STATCODE_INVALID_CDB, PXE_STATCODE_SUCCESS, PXE_STATFLAGS_COMMAND_COMPLETE, PXE_STATFLAGS_COMMAND_FAILED, PXE_STATFLAGS_STATUS_MASK, PXE_CPB_ANY::receive, s_pxe_cdb::StatCode, s_pxe_cdb::StatFlags, PXE_CPB_ANY::station_address, and PXE_CPB_ANY::transmit.
Referenced by efi_snp_probe().
|
static |
Create or modify VLAN device.
vcfg | VLAN configuration protocol |
tag | VLAN tag |
priority | Default VLAN priority |
efirc | EFI status code |
Definition at line 1506 of file efi_snp.c.
References container_of, DBGC, efi_raise_tpl(), efi_restore_tpl(), EFIRC, efi_snp_device::netdev, priority, rc, strerror(), tag, efi_snp_device::vcfg, and vlan_create().
|
static |
Find VLAN device(s)
vcfg | VLAN configuration protocol |
filter | VLAN tag, or NULL to find all VLANs |
count | Number of VLANs |
entries | List of VLANs |
efirc | EFI status code |
Definition at line 1540 of file efi_snp.c.
References EFI_BOOT_SERVICES::AllocatePool, assert(), EFI_SYSTEM_TABLE::BootServices, buffer, container_of, count, EEFI, efi_raise_tpl(), efi_restore_tpl(), efi_systab, EfiBootServicesData, EFIRC, filter, len, efi_snp_device::netdev, rc, tag, efi_snp_device::vcfg, vlan_find(), VLAN_PRIORITY, VLAN_TAG, VLAN_TAG_IS_VALID, vlan_tci(), and VOID.
|
static |
Remove VLAN device.
vcfg | VLAN configuration protocol |
tag | VLAN tag |
efirc | EFI status code |
Definition at line 1609 of file efi_snp.c.
References container_of, DBGC, efi_raise_tpl(), efi_restore_tpl(), EFIRC, ENOENT, efi_snp_device::netdev, rc, tag, efi_snp_device::vcfg, vlan_destroy(), and vlan_find().
|
static |
Look up driver name.
name2 | Component name protocol |
language | Language to use |
driver_name | Driver name to fill in |
efirc | EFI status code |
Definition at line 1665 of file efi_snp.c.
References container_of, efi_snp_device::driver_name, and efi_snp_device::name2.
Referenced by efi_snp_probe().
|
static |
Look up controller name.
name2 | Component name protocol |
device | Device |
child | Child device, or NULL |
language | Language to use |
driver_name | Device name to fill in |
efirc | EFI status code |
Definition at line 1685 of file efi_snp.c.
References container_of, efi_snp_device::controller_name, and efi_snp_device::name2.
Referenced by efi_snp_probe().
|
static |
Load file.
loadfile | Load file protocol |
path | File path |
booting | Loading as part of a boot attempt |
efirc | EFI status code |
Definition at line 1713 of file efi_snp.c.
References console_reset(), container_of, DBGC, efi_snp_claim(), efi_snp_release(), EFI_UNSUPPORTED, efi_watchdog_start(), efi_watchdog_stop(), EFIRC, ipxe(), efi_snp_device::load_file, efi_snp_device::netdev, netdev, and rc.
|
static |
Locate SNP device corresponding to network device.
netdev | Network device |
snp | SNP device, or NULL if not found |
Definition at line 1766 of file efi_snp.c.
References efi_snp_device::list, list_for_each_entry, efi_snp_device::netdev, netdev, and NULL.
Referenced by efi_snp_notify(), efi_snp_remove(), and last_opened_snpdev().
|
static |
Create SNP device.
netdev | Network device |
priv | Private data |
rc | Return status code |
Definition at line 1783 of file efi_snp.c.
References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, EFI_BOOT_SERVICES::CloseProtocol, efi_snp_device::controller_name, EFI_BOOT_SERVICES::CreateEvent, DBG, DBGC, net_device::dev, efi_device::device, efi_snp_device::driver_name, device::driver_name, EEFI, efi_child_add(), efi_child_del(), efi_component_name2_protocol_guid, efi_device_path_protocol_guid, efi_handle_name(), efi_image_handle, efi_load_file_protocol_guid, efi_netdev_path(), efi_nii31_protocol_guid, efi_nii_protocol_guid, efi_nullify_load_file(), efi_nullify_name2(), efi_nullify_nii(), efi_nullify_snp(), efi_nullify_vlan(), EFI_OPEN_PROTOCOL_BY_DRIVER, EFI_OPEN_PROTOCOL_EXCLUSIVE, efi_simple_network_protocol_guid, efi_snp_device_nii, efi_snp_device_snp, efi_snp_get_controller_name(), efi_snp_get_driver_name(), efi_snp_hii_install(), efi_snp_hii_uninstall(), efi_snp_load_file_protocol, efi_snp_set_mode(), efi_snp_undi, efi_snp_wait_for_packet(), efi_snprintf(), efi_systab, efi_undi_checksum(), efi_undi_ifnum(), efi_undi_issue(), efi_vlan, efi_vlan_config_protocol_guid, efi_snp_device::efidev, efidev_parent(), EfiSimpleNetworkStopped, ENOMEM, ENOTSUP, s_pxe_sw_undi::EntryPoint, EVT_NOTIFY_WAIT, free, s_pxe_sw_undi::Fudge, _EFI_COMPONENT_NAME2_PROTOCOL::GetControllerName, _EFI_COMPONENT_NAME2_PROTOCOL::GetDriverName, efi_snp_device::handle, _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL::Id, s_pxe_sw_undi::IFcnt, s_pxe_sw_undi::IFcntExt, _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL::IfNum, INIT_LIST_HEAD, EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces, efi_snp_device::list, list_add, list_del, ll_protocol::ll_addr_len, net_device::ll_protocol, efi_snp_device::load_file, memcpy(), efi_snp_device::mode, _EFI_SIMPLE_NETWORK_PROTOCOL::Mode, efi_snp_device::name, device::name, net_device::name, efi_snp_device::name2, efi_snp_device::netdev, netdev, netdev_addr(), netdev_get(), netdev_put(), efi_snp_device::nii, NULL, EFI_BOOT_SERVICES::OpenProtocol, efi_snp_device::package_list, efi_snp_device::path, product_short_name, rc, efi_snp_device::rx, efi_snp_device::snp, snprintf(), EFI_SIMPLE_NETWORK_MODE::State, strerror(), _EFI_COMPONENT_NAME2_PROTOCOL::SupportedLanguages, TPL_NOTIFY, EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces, efi_snp_device::vcfg, VLAN_TAG, vlan_tci(), _EFI_SIMPLE_NETWORK_PROTOCOL::WaitForPacket, and zalloc().
|
static |
Handle SNP device or link state change.
netdev | Network device |
priv | Private data |
Definition at line 2023 of file efi_snp.c.
References DBG, DBGC, efi_snp_demux(), efi_snp_set_state(), FALSE, EFI_SIMPLE_NETWORK_MODE::MediaPresent, efi_snp_device::mode, net_device::name, netdev, netdev_link_ok(), and TRUE.
|
static |
Destroy SNP device.
netdev | Network device |
priv | Private data |
Definition at line 2049 of file efi_snp.c.
References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, EFI_BOOT_SERVICES::CloseProtocol, DBG, DBGC, efi_device::device, EEFI, efi_child_del(), efi_component_name2_protocol_guid, efi_device_path_protocol_guid, efi_image_handle, efi_load_file_protocol_guid, efi_nii31_protocol_guid, efi_nii_protocol_guid, efi_nullify_load_file(), efi_nullify_name2(), efi_nullify_nii(), efi_nullify_snp(), efi_nullify_vlan(), efi_shutdown_in_progress, efi_simple_network_protocol_guid, efi_snp_demux(), efi_snp_hii_uninstall(), efi_systab, efi_vlan_config_protocol_guid, efi_snp_device::efidev, free, efi_snp_device::handle, efi_snp_device::list, list_del, efi_snp_device::load_file, net_device::name, efi_snp_device::name2, efi_snp_device::netdev, netdev, netdev_put(), efi_snp_device::nii, NULL, efi_snp_device::package_list, efi_snp_device::path, efi_snp_device::snp, strerror(), EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces, efi_snp_device::vcfg, and _EFI_SIMPLE_NETWORK_PROTOCOL::WaitForPacket.
struct efi_snp_device* find_snpdev | ( | EFI_HANDLE | handle | ) |
Find SNP device by EFI device handle.
handle | EFI device handle |
snpdev | SNP device, or NULL |
Definition at line 2118 of file efi_snp.c.
References handle, efi_snp_device::handle, efi_snp_device::list, list_for_each_entry, and NULL.
Referenced by snpnet_supported().
struct efi_snp_device* last_opened_snpdev | ( | void | ) |
Get most recently opened SNP device.
snpdev | Most recently opened SNP device, or NULL |
Definition at line 2133 of file efi_snp.c.
References efi_snp_demux(), last_opened_netdev(), netdev, and NULL.
Referenced by efi_image_exec().
void efi_snp_add_claim | ( | int | delta | ) |
Add to SNP claimed/released count.
delta | Claim count change |
Definition at line 2148 of file efi_snp.c.
References assert(), efi_raise_tpl(), efi_restore_tpl(), efi_snp_claimed, efi_snp_saved_tpl, efi_snp_set_state(), efi_snp_device::list, and list_for_each_entry.
Referenced by efi_snp_claim(), and efi_snp_release().
|
static |
Network devices are currently claimed for use by iPXE.
Definition at line 48 of file efi_snp.c.
Referenced by efi_snp_add_claim(), efi_snp_get_status(), efi_snp_initialize(), efi_snp_mcast_ip_to_mac(), efi_snp_nvdata(), efi_snp_receive(), efi_snp_reset(), efi_snp_set_state(), efi_snp_shutdown(), efi_snp_start(), efi_snp_station_address(), efi_snp_statistics(), efi_snp_stop(), efi_snp_transmit(), efi_snp_wait_for_packet(), and efi_undi_issue().
|
static |
TPL prior to network devices being claimed.
Definition at line 51 of file efi_snp.c.
Referenced by efi_snp_add_claim().
|
static |
SNP interface.
Definition at line 872 of file efi_snp.c.
Referenced by efi_snp_probe().
|
static |
UNDI interface.
Must be aligned on a 16-byte boundary, for no particularly good reason.
Definition at line 1459 of file efi_snp.c.
Referenced by efi_snp_probe().
|
static |
Network Identification Interface (NII)
Definition at line 1482 of file efi_snp.c.
Referenced by efi_snp_probe().
|
static |
VLAN configuration protocol.
Definition at line 1643 of file efi_snp.c.
Referenced by efi_snp_probe().
|
static |
Load file protocol.
Definition at line 1749 of file efi_snp.c.
Referenced by efi_snp_probe().
struct net_driver efi_snp_driver __net_driver |
SNP driver.