iPXE
|
Network device management. More...
#include <stdint.h>
#include <ipxe/list.h>
#include <ipxe/tables.h>
#include <ipxe/refcnt.h>
#include <ipxe/settings.h>
#include <ipxe/interface.h>
#include <ipxe/retry.h>
Go to the source code of this file.
Data Structures | |
struct | net_protocol |
A network-layer protocol. More... | |
struct | ll_protocol |
A link-layer protocol. More... | |
struct | net_device_operations |
Network device operations. More... | |
struct | net_device_error |
Network device error. More... | |
struct | net_device_stats |
Network device statistics. More... | |
struct | net_device_configuration |
A network device configuration. More... | |
struct | net_device_configurator |
A network device configurator. More... | |
struct | net_device |
A network device. More... | |
struct | net_driver |
A network upper-layer driver. More... | |
Macros | |
#define | MAX_HW_ADDR_LEN 8 |
Maximum length of a hardware address. More... | |
#define | MAX_LL_ADDR_LEN 20 |
Maximum length of a link-layer address. More... | |
#define | MAX_LL_HEADER_LEN 64 |
Maximum length of a link-layer header. More... | |
#define | MAX_NET_ADDR_LEN 16 |
Maximum length of a network-layer address. More... | |
#define | MAX_NET_HEADER_LEN 40 |
Maximum length of a network-layer header. More... | |
#define | MAX_LL_NET_HEADER_LEN ( MAX_LL_HEADER_LEN + MAX_NET_HEADER_LEN ) |
Maximum combined length of a link-layer and network-layer header. More... | |
#define | LL_MULTICAST 0x0001 |
Packet is a multicast (including broadcast) packet. More... | |
#define | LL_BROADCAST 0x0002 |
Packet is a broadcast packet. More... | |
#define | LL_NAME_ONLY 0x0001 |
Local link-layer address functions only as a name. More... | |
#define | NETDEV_MAX_UNIQUE_ERRORS 4 |
Maximum number of unique errors that we will keep track of. More... | |
#define | NET_DEVICE_CONFIGURATORS __table ( struct net_device_configurator, "net_device_configurators" ) |
Network device configurator table. More... | |
#define | __net_device_configurator __table_entry ( NET_DEVICE_CONFIGURATORS, 01 ) |
Declare a network device configurator. More... | |
#define | NETDEV_NAME_LEN 12 |
Maximum length of a network device name. More... | |
#define | NETDEV_OPEN 0x0001 |
Network device is open. More... | |
#define | NETDEV_IRQ_ENABLED 0x0002 |
Network device interrupts are enabled. More... | |
#define | NETDEV_RX_FROZEN 0x0004 |
Network device receive queue processing is frozen. More... | |
#define | NETDEV_IRQ_UNSUPPORTED 0x0008 |
Network device interrupts are unsupported. More... | |
#define | NETDEV_TX_IN_PROGRESS 0x0010 |
Network device transmission is in progress. More... | |
#define | NETDEV_POLL_IN_PROGRESS 0x0020 |
Network device poll is in progress. More... | |
#define | LL_PROTOCOLS __table ( struct ll_protocol, "ll_protocols" ) |
Link-layer protocol table. More... | |
#define | __ll_protocol __table_entry ( LL_PROTOCOLS, 01 ) |
Declare a link-layer protocol. More... | |
#define | NET_PROTOCOLS __table ( struct net_protocol, "net_protocols" ) |
Network-layer protocol table. More... | |
#define | __net_protocol __table_entry ( NET_PROTOCOLS, 01 ) |
Declare a network-layer protocol. More... | |
#define | NET_DRIVERS __table ( struct net_driver, "net_drivers" ) |
Network driver table. More... | |
#define | __net_driver __table_entry ( NET_DRIVERS, 01 ) |
Declare a network driver. More... | |
#define | for_each_netdev(netdev) list_for_each_entry ( (netdev), &net_devices, list ) |
Iterate over all network devices. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | netdev_init (struct net_device *netdev, struct net_device_operations *op) |
Initialise a network device. More... | |
static void | netdev_nullify (struct net_device *netdev) |
Stop using a network device. More... | |
static const char * | netdev_addr (struct net_device *netdev) |
Get printable network device link-layer address. More... | |
static int | have_netdevs (void) |
There exist some network devices. More... | |
static struct net_device * | netdev_get (struct net_device *netdev) |
Get reference to network device. More... | |
static void | netdev_put (struct net_device *netdev) |
Drop reference to network device. More... | |
static struct settings * | netdev_settings (struct net_device *netdev) |
Get per-netdevice configuration settings block. More... | |
static void | netdev_settings_init (struct net_device *netdev) |
Initialise a per-netdevice configuration settings block. More... | |
static struct net_device_configuration * | netdev_configuration (struct net_device *netdev, struct net_device_configurator *configurator) |
Get network device configuration. More... | |
static int | netdev_configurator_applies (struct net_device *netdev, struct net_device_configurator *configurator) |
Check if configurator applies to network device. More... | |
static int | netdev_link_ok (struct net_device *netdev) |
Check link state of network device. More... | |
static int | netdev_link_blocked (struct net_device *netdev) |
Check link block state of network device. More... | |
static int | netdev_is_open (struct net_device *netdev) |
Check whether or not network device is open. More... | |
static int | netdev_irq_supported (struct net_device *netdev) |
Check whether or not network device supports interrupts. More... | |
static int | netdev_irq_enabled (struct net_device *netdev) |
Check whether or not network device interrupts are currently enabled. More... | |
static int | netdev_rx_frozen (struct net_device *netdev) |
Check whether or not network device receive queue processing is frozen. More... | |
void * | netdev_priv (struct net_device *netdev, struct net_driver *driver) |
Get network device driver private data. More... | |
void | netdev_rx_freeze (struct net_device *netdev) |
Freeze network device receive queue processing. More... | |
void | netdev_rx_unfreeze (struct net_device *netdev) |
Unfreeze network device receive queue processing. More... | |
void | netdev_link_err (struct net_device *netdev, int rc) |
Mark network device as having a specific link state. More... | |
void | netdev_link_down (struct net_device *netdev) |
Mark network device as having link down. More... | |
void | netdev_link_block (struct net_device *netdev, unsigned long timeout) |
Mark network device link as being blocked. More... | |
void | netdev_link_unblock (struct net_device *netdev) |
Mark network device link as being unblocked. More... | |
int | netdev_tx (struct net_device *netdev, struct io_buffer *iobuf) |
Transmit raw packet via network device. More... | |
void | netdev_tx_defer (struct net_device *netdev, struct io_buffer *iobuf) |
Defer transmitted packet. More... | |
void | netdev_tx_err (struct net_device *netdev, struct io_buffer *iobuf, int rc) |
Discard transmitted packet. More... | |
void | netdev_tx_complete_err (struct net_device *netdev, struct io_buffer *iobuf, int rc) |
Complete network transmission. More... | |
void | netdev_tx_complete_next_err (struct net_device *netdev, int rc) |
Complete network transmission. More... | |
void | netdev_rx (struct net_device *netdev, struct io_buffer *iobuf) |
Add packet to receive queue. More... | |
void | netdev_rx_err (struct net_device *netdev, struct io_buffer *iobuf, int rc) |
Discard received packet. More... | |
void | netdev_poll (struct net_device *netdev) |
Poll for completed and received packets on network device. More... | |
struct io_buffer * | netdev_rx_dequeue (struct net_device *netdev) |
Remove packet from device's receive queue. More... | |
struct net_device * | alloc_netdev (size_t priv_size) |
Allocate network device. More... | |
int | register_netdev (struct net_device *netdev) |
Register network device. More... | |
int | netdev_open (struct net_device *netdev) |
Open network device. More... | |
void | netdev_close (struct net_device *netdev) |
Close network device. More... | |
void | unregister_netdev (struct net_device *netdev) |
Unregister network device. More... | |
void | netdev_irq (struct net_device *netdev, int enable) |
Enable or disable interrupts. More... | |
struct net_device * | find_netdev (const char *name) |
Get network device by name. More... | |
struct net_device * | find_netdev_by_scope_id (unsigned int scope_id) |
Get network device by scope ID. More... | |
struct net_device * | find_netdev_by_location (unsigned int bus_type, unsigned int location) |
Get network device by PCI bus:dev.fn address. More... | |
struct net_device * | last_opened_netdev (void) |
Get most recently opened network device. More... | |
int | net_tx (struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source) |
Transmit network-layer packet. More... | |
int | net_rx (struct io_buffer *iobuf, struct net_device *netdev, uint16_t net_proto, const void *ll_dest, const void *ll_source, unsigned int flags) |
Process received network-layer packet. More... | |
void | net_poll (void) |
Poll the network stack. More... | |
struct net_device_configurator * | find_netdev_configurator (const char *name) |
Find network device configurator. More... | |
int | netdev_configure (struct net_device *netdev, struct net_device_configurator *configurator) |
Start network device configuration. More... | |
int | netdev_configure_all (struct net_device *netdev) |
Start network device configuration via all supported configurators. More... | |
int | netdev_configuration_in_progress (struct net_device *netdev) |
Check if network device configuration is in progress. More... | |
int | netdev_configuration_ok (struct net_device *netdev) |
Check if network device has at least one successful configuration. More... | |
static void | netdev_tx_complete (struct net_device *netdev, struct io_buffer *iobuf) |
Complete network transmission. More... | |
static void | netdev_tx_complete_next (struct net_device *netdev) |
Complete network transmission. More... | |
static void | netdev_link_up (struct net_device *netdev) |
Mark network device as having link up. More... | |
Variables | |
struct list_head | net_devices |
List of network devices. More... | |
struct net_device_operations | null_netdev_operations |
struct settings_operations | netdev_settings_operations |
Network device configuration settings operations. More... | |
Network device management.
Definition in file netdevice.h.
#define MAX_HW_ADDR_LEN 8 |
Maximum length of a hardware address.
The longest currently-supported link-layer address is for IPoIB.
Definition at line 30 of file netdevice.h.
#define MAX_LL_ADDR_LEN 20 |
Maximum length of a link-layer address.
The longest currently-supported link-layer address is for IPoIB.
Definition at line 36 of file netdevice.h.
#define MAX_LL_HEADER_LEN 64 |
Maximum length of a link-layer header.
The longest currently-supported link-layer header is for RNDIS: an 8-byte RNDIS header, a 32-byte RNDIS packet message header, a 14-byte Ethernet header and a possible 4-byte VLAN header. Round up to 64 bytes.
Definition at line 45 of file netdevice.h.
#define MAX_NET_ADDR_LEN 16 |
Maximum length of a network-layer address.
Definition at line 48 of file netdevice.h.
#define MAX_NET_HEADER_LEN 40 |
Maximum length of a network-layer header.
The longest currently-supported network-layer header is for IPv6 at 40 bytes.
Definition at line 55 of file netdevice.h.
#define MAX_LL_NET_HEADER_LEN ( MAX_LL_HEADER_LEN + MAX_NET_HEADER_LEN ) |
Maximum combined length of a link-layer and network-layer header.
Definition at line 58 of file netdevice.h.
#define LL_MULTICAST 0x0001 |
Packet is a multicast (including broadcast) packet.
Definition at line 105 of file netdevice.h.
#define LL_BROADCAST 0x0002 |
Packet is a broadcast packet.
Definition at line 108 of file netdevice.h.
#define LL_NAME_ONLY 0x0001 |
Local link-layer address functions only as a name.
This flag indicates that the local link-layer address cannot directly be used as a destination address by a remote node.
Definition at line 210 of file netdevice.h.
#define NETDEV_MAX_UNIQUE_ERRORS 4 |
Maximum number of unique errors that we will keep track of.
Definition at line 288 of file netdevice.h.
#define NET_DEVICE_CONFIGURATORS __table ( struct net_device_configurator, "net_device_configurators" ) |
Network device configurator table.
Definition at line 332 of file netdevice.h.
#define __net_device_configurator __table_entry ( NET_DEVICE_CONFIGURATORS, 01 ) |
Declare a network device configurator.
Definition at line 336 of file netdevice.h.
#define NETDEV_NAME_LEN 12 |
Maximum length of a network device name.
Definition at line 340 of file netdevice.h.
#define NETDEV_OPEN 0x0001 |
Network device is open.
Definition at line 438 of file netdevice.h.
#define NETDEV_IRQ_ENABLED 0x0002 |
Network device interrupts are enabled.
Definition at line 441 of file netdevice.h.
#define NETDEV_RX_FROZEN 0x0004 |
Network device receive queue processing is frozen.
Definition at line 444 of file netdevice.h.
#define NETDEV_IRQ_UNSUPPORTED 0x0008 |
Network device interrupts are unsupported.
This flag can be used by a network device to indicate that interrupts are not supported despite the presence of an irq() method.
Definition at line 452 of file netdevice.h.
#define NETDEV_TX_IN_PROGRESS 0x0010 |
Network device transmission is in progress.
Definition at line 455 of file netdevice.h.
#define NETDEV_POLL_IN_PROGRESS 0x0020 |
Network device poll is in progress.
Definition at line 458 of file netdevice.h.
#define LL_PROTOCOLS __table ( struct ll_protocol, "ll_protocols" ) |
Link-layer protocol table.
Definition at line 461 of file netdevice.h.
#define __ll_protocol __table_entry ( LL_PROTOCOLS, 01 ) |
Declare a link-layer protocol.
Definition at line 464 of file netdevice.h.
#define NET_PROTOCOLS __table ( struct net_protocol, "net_protocols" ) |
Network-layer protocol table.
Definition at line 467 of file netdevice.h.
struct net_protocol vlan_protocol __net_protocol __table_entry ( NET_PROTOCOLS, 01 ) |
Declare a network-layer protocol.
VLAN protocol.
FIP protocol.
FCoE protocol.
Slow protocol.
ARP network protocol.
AoE protocol.
Definition at line 470 of file netdevice.h.
#define NET_DRIVERS __table ( struct net_driver, "net_drivers" ) |
Network driver table.
Definition at line 500 of file netdevice.h.
struct net_driver lldp_driver __net_driver __table_entry ( NET_DRIVERS, 01 ) |
Declare a network driver.
LLDP driver.
FCoE driver.
EAPoL driver.
Definition at line 503 of file netdevice.h.
#define for_each_netdev | ( | netdev | ) | list_for_each_entry ( (netdev), &net_devices, list ) |
Iterate over all network devices.
Definition at line 543 of file netdevice.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise a network device.
netdev | Network device |
op | Network device operations |
Definition at line 515 of file netdevice.h.
References netdev, op, and net_device::op.
Referenced by a3c90x_probe(), alloc_rndis(), atl1e_init_netdev(), atl_probe(), axge_probe(), b44_probe(), bnxt_init_one(), dm96xx_probe(), ecm_probe(), efab_probe(), ena_probe(), eoib_create(), exanic_probe_port(), flexboot_nodnic_register_netdev(), forcedeth_probe(), gve_probe(), hermon_probe(), hunt_probe(), ice_probe(), icplus_probe(), ifec_pci_probe(), igbvf_probe(), intel_probe(), intelx_probe(), intelxl_probe(), intelxlvf_probe(), intelxvf_probe(), iphone_probe(), ipoib_probe(), jme_probe(), lan78xx_probe(), legacy_probe(), mnpnet_start(), myri10ge_pci_probe(), myson_probe(), natsemi_probe(), ncm_probe(), net80211_alloc(), netfront_probe(), nii_start(), pcnet32_probe(), phantom_probe(), pnic_probe(), rdc_probe(), realtek_probe(), rhine_probe(), sis190_probe(), skeleton_probe(), skge_probe(), sky2_probe(), smsc75xx_probe(), smsc95xx_probe(), snpnet_start(), tg3_init_one(), txnic_lmac_probe(), undinet_probe(), velocity_probe(), virtnet_probe_legacy(), virtnet_probe_modern(), vlan_create(), vmxnet3_probe(), and vxge_device_register().
|
inlinestatic |
Stop using a network device.
netdev | Network device |
Drivers should call this method immediately before the final call to netdev_put().
Definition at line 528 of file netdevice.h.
References netdev, null_netdev_operations, and net_device::op.
Referenced by a3c90x_remove(), atl1e_probe(), atl1e_remove(), atl_probe(), atl_remove(), axge_probe(), axge_remove(), b44_remove(), bnxt_init_one(), bnxt_remove_one(), dm96xx_probe(), dm96xx_remove(), ecm_probe(), ecm_remove(), efab_remove(), ena_probe(), ena_remove(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), flexboot_nodnic_unregister_netdev(), forcedeth_probe(), forcedeth_remove(), free_rndis(), golan_remove_normal(), gve_probe(), gve_remove(), hermon_probe(), hermon_remove(), hunt_remove(), ice_probe(), ice_remove(), icplus_probe(), icplus_remove(), ifec_pci_probe(), ifec_pci_remove(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxl_probe(), intelxl_remove(), intelxlvf_probe(), intelxlvf_remove(), intelxvf_probe(), intelxvf_remove(), iphone_probe(), iphone_remove(), ipoib_probe(), ipoib_remove(), jme_probe(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_probe(), legacy_remove(), mnpnet_start(), mnpnet_stop(), myri10ge_pci_probe(), myri10ge_pci_remove(), myson_probe(), myson_remove(), natsemi_probe(), natsemi_remove(), ncm_probe(), ncm_remove(), net80211_free(), netfront_probe(), netfront_remove(), nii_start(), nii_stop(), pcnet32_remove(), phantom_probe(), phantom_remove(), pnic_probe(), pnic_remove(), rdc_probe(), rdc_remove(), realtek_probe(), realtek_remove(), rhine_probe(), rhine_remove(), sis190_remove(), skeleton_probe(), skeleton_remove(), skge_probe(), skge_remove(), sky2_probe(), sky2_remove(), smsc75xx_probe(), smsc75xx_remove(), smsc95xx_probe(), smsc95xx_remove(), snpnet_start(), snpnet_stop(), tg3_remove_one(), txnic_alloc(), txnic_free(), undinet_probe(), undinet_remove(), velocity_probe(), velocity_remove(), virtnet_probe_legacy(), virtnet_probe_modern(), virtnet_remove(), vlan_create(), vlan_destroy(), vmxnet3_probe(), vmxnet3_remove(), and vxge_device_unregister().
|
inlinestatic |
Get printable network device link-layer address.
netdev | Network device |
name | Link-layer address |
Definition at line 538 of file netdevice.h.
References net_device::ll_addr, net_device::ll_protocol, netdev, and ll_protocol::ntoa.
Referenced by efi_snp_hii_package_list(), efi_snp_probe(), ifstat(), register_netdev(), rtl818x_probe(), skge_show_addr(), and sky2_show_addr().
|
inlinestatic |
There exist some network devices.
existence | Existence of network devices |
Definition at line 550 of file netdevice.h.
References list_empty, and net_devices.
|
inlinestatic |
Get reference to network device.
netdev | Network device |
netdev | Network device |
Definition at line 561 of file netdevice.h.
References netdev, ref_get, and net_device::refcnt.
Referenced by add_ipv4_miniroute(), aoedev_open(), efi_pxe_install(), efi_snp_probe(), gdbudp_configure(), ipv6_add_miniroute(), neighbour_create(), pxe_exec(), pxe_set_netdev(), register_netdev(), start_dhcp(), start_dhcpv6(), start_ipv6conf(), start_pxebs(), and vlan_create().
|
inlinestatic |
Drop reference to network device.
netdev | Network device |
Definition at line 572 of file netdevice.h.
References netdev, ref_put, and net_device::refcnt.
Referenced by a3c90x_probe(), a3c90x_remove(), aoedev_free(), atl1e_probe(), atl1e_remove(), atl_probe(), atl_remove(), axge_probe(), axge_remove(), b44_probe(), b44_remove(), bnxt_init_one(), bnxt_remove_one(), del_ipv4_miniroute(), dhcp_free(), dhcpv6_free(), dm96xx_probe(), dm96xx_remove(), ecm_probe(), ecm_remove(), efab_probe(), efab_remove(), efi_pxe_free(), efi_snp_probe(), efi_snp_remove(), ena_probe(), ena_remove(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), flexboot_nodnic_register_netdev(), flexboot_nodnic_unregister_netdev(), forcedeth_probe(), forcedeth_remove(), free_rndis(), gdbudp_configure(), gve_probe(), gve_remove(), hermon_probe(), hermon_remove(), hunt_probe(), hunt_remove(), ice_probe(), ice_remove(), icplus_probe(), icplus_remove(), ifec_pci_probe(), ifec_pci_remove(), igbvf_probe(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxl_probe(), intelxl_remove(), intelxlvf_probe(), intelxlvf_remove(), intelxvf_probe(), intelxvf_remove(), iphone_probe(), iphone_remove(), ipoib_probe(), ipoib_remove(), ipv6_del_miniroute(), ipv6conf_free(), jme_probe(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_probe(), legacy_remove(), mnpnet_start(), mnpnet_stop(), myri10ge_pci_probe(), myri10ge_pci_remove(), myson_probe(), myson_remove(), natsemi_probe(), natsemi_remove(), ncm_probe(), ncm_remove(), neighbour_free(), net80211_free(), netfront_probe(), netfront_remove(), nii_start(), nii_stop(), pcnet32_probe(), pcnet32_remove(), phantom_probe(), phantom_remove(), pnic_probe(), pnic_remove(), pxe_exec(), pxe_set_netdev(), rdc_probe(), rdc_remove(), realtek_probe(), realtek_remove(), register_netdev(), rhine_probe(), rhine_remove(), sis190_remove(), skeleton_probe(), skeleton_remove(), skge_probe(), skge_remove(), sky2_probe(), sky2_remove(), smsc75xx_probe(), smsc75xx_remove(), smsc95xx_probe(), smsc95xx_remove(), snpnet_start(), snpnet_stop(), tg3_init_one(), tg3_remove_one(), txnic_alloc(), txnic_free(), undinet_probe(), undinet_remove(), unregister_netdev(), velocity_probe(), velocity_remove(), virtnet_probe_legacy(), virtnet_probe_modern(), virtnet_remove(), vlan_create(), vlan_destroy(), vmxnet3_probe(), vmxnet3_remove(), vxge_device_register(), and vxge_device_unregister().
|
inlinestatic |
Get per-netdevice configuration settings block.
netdev | Network device |
settings | Settings block |
Definition at line 583 of file netdevice.h.
References netdev, generic_settings::settings, and net_device::settings.
Referenced by apply_netdev_settings(), cachedhcp_apply(), cachedhcp_recycle(), create_fakedhcpack(), create_fakepxebsack(), dhcp_create_request(), dhcp_request_rx(), dhcpv6_rx(), eap_rx_identity(), eap_rx_md5(), eap_rx_mschapv2_request(), efab_probe(), efi_path_net_probe(), efi_pxe_install(), efi_pxe_ip(), efi_snp_hii_settings(), free_netdev(), gdbudp_configure(), guestinfo_net_probe(), hermon_register_netdev(), ibft_fill_nic(), ipv4_settings(), ipv6_create_all_routes(), ipv6_register_settings(), lldp_probe(), myri10ge_nv_init(), ndp_register_settings(), net80211_autoassociate(), net80211_check_settings_update(), netdev_redirect(), phantom_probe(), realtek_probe(), register_netdev(), start_pxebs(), trivial_change_key(), trivial_init(), unregister_netdev(), and wpa_psk_start().
|
inlinestatic |
Initialise a per-netdevice configuration settings block.
generics | Generic settings block |
refcnt | Containing object reference counter, or NULL |
name | Settings block name |
Definition at line 595 of file netdevice.h.
References generic_settings_init(), netdev, netdev_settings_operations, settings::op, net_device::refcnt, generic_settings::settings, and net_device::settings.
Referenced by alloc_netdev().
|
inlinestatic |
Get network device configuration.
netdev | Network device |
configurator | Network device configurator |
config | Network device configuration |
Definition at line 608 of file netdevice.h.
References net_device::configs, net_device_configuration::configurator, NET_DEVICE_CONFIGURATORS, netdev, and table_index.
Referenced by ifconf_progress(), and netdev_configure().
|
inlinestatic |
Check if configurator applies to network device.
netdev | Network device |
configurator | Network device configurator |
applies | Configurator applies to network device |
Definition at line 623 of file netdevice.h.
References net_device_configurator::applies, net_device_configuration::configurator, netdev, and NULL.
Referenced by netdev_configure(), and netdev_configure_all().
|
inlinestatic |
Check link state of network device.
netdev | Network device |
link_up | Link is up |
Definition at line 636 of file netdevice.h.
References net_device::link_rc, and netdev.
Referenced by __tg3_set_coalesce(), atl1e_check_link(), atl1e_clean_rx_irq(), atl1e_poll(), atl1e_xmit_frame(), axge_intr_complete(), bcom_check_link(), dm96xx_link_nsr(), eapol_notify(), ecm_intr_complete(), efi_snp_notify(), efi_snp_set_mode(), efi_undi_get_status(), efi_undi_initialize(), exanic_expired(), fcoe_notify(), fcoe_reset(), flexboot_nodnic_poll_eq(), forcedeth_poll(), gve_poll(), gve_transmit(), iflinkwait(), ifstat(), jme_link_change(), nii_poll_link(), sis190_poll(), smscusb_mii_check_link(), snpnet_check_link(), tg3_link_report(), tg3_setup_copper_phy(), tg3_setup_phy(), vxge_xmit(), xm_check_link(), and xm_link_down().
|
inlinestatic |
Check link block state of network device.
netdev | Network device |
link_blocked | Link is blocked |
Definition at line 647 of file netdevice.h.
References net_device::link_block, and netdev.
Referenced by dhcp_discovery_expired(), eth_slow_lacp_rx(), ifstat(), ipv6conf_expired(), netdev_link_block(), netdev_link_unblock(), and stp_rx().
|
inlinestatic |
Check whether or not network device is open.
netdev | Network device |
is_open | Network device is open |
Definition at line 658 of file netdevice.h.
References netdev, NETDEV_OPEN, and net_device::state.
Referenced by aoedev_ata_command(), apply_netdev_settings(), eapol_notify(), efi_snp_set_state(), efi_snp_station_address(), efi_snp_wait_for_packet(), fcoe_notify(), fcoe_reset(), flexboot_nodnic_poll_eq(), ifstat(), iphone_expired(), ipv4_route(), ipv6_route(), iwlist(), last_opened_netdev(), neighbour_flush(), net80211_change_channel(), net80211_check_settings_update(), net80211_prepare_assoc(), net80211_prepare_probe(), net80211_probe_start(), net80211_set_rate_idx(), netdev_poll(), netdev_tx(), netvsc_reset(), peerdisc_socket_tx(), pxenv_udp_open(), pxenv_undi_set_station_address(), route_ipv4_print(), route_ipv6_print(), startpxe_payload(), vlan_sync(), xsmp_tx_xve_params(), xve_close(), and xve_open().
|
inlinestatic |
Check whether or not network device supports interrupts.
netdev | Network device |
irq_supported | Network device supports interrupts |
Definition at line 669 of file netdevice.h.
References net_device_operations::irq, netdev, NETDEV_IRQ_UNSUPPORTED, NULL, net_device::op, and net_device::state.
Referenced by netdev_irq(), pxe_exec(), pxenv_undi_get_iface_info(), pxenv_undi_get_information(), and vlan_create().
|
inlinestatic |
Check whether or not network device interrupts are currently enabled.
netdev | Network device |
irq_enabled | Network device interrupts are enabled |
Definition at line 681 of file netdevice.h.
References netdev, NETDEV_IRQ_ENABLED, and net_device::state.
Referenced by pxenv_undi_isr().
|
inlinestatic |
Check whether or not network device receive queue processing is frozen.
netdev | Network device |
rx_frozen | Network device receive queue processing is frozen |
Definition at line 692 of file netdevice.h.
References netdev, NETDEV_RX_FROZEN, and net_device::state.
Referenced by net_poll(), and pxenv_undi_transmit().
void* netdev_priv | ( | struct net_device * | netdev, |
struct net_driver * | driver | ||
) |
Get network device driver private data.
netdev | Network device |
driver | Upper-layer driver, or NULL for device driver |
priv | Driver private data |
Definition at line 152 of file netdevice.c.
References netdev, and netdev_priv_offset().
Referenced by alloc_netdev(), eapol_rx(), fcoe_fip_rx(), fcoe_rx(), lldp_rx(), netdev_notify(), register_netdev(), and unregister_netdev().
void netdev_rx_freeze | ( | struct net_device * | netdev | ) |
Freeze network device receive queue processing.
netdev | Network device |
Definition at line 178 of file netdevice.c.
References netdev, netdev_notify(), NETDEV_RX_FROZEN, and net_device::state.
Referenced by pxe_netdev_open(), and pxenv_undi_transmit().
void netdev_rx_unfreeze | ( | struct net_device * | netdev | ) |
Unfreeze network device receive queue processing.
netdev | Network device |
Definition at line 192 of file netdevice.c.
References netdev, netdev_notify(), NETDEV_RX_FROZEN, and net_device::state.
Referenced by pxe_netdev_close(), and pxe_set_netdev().
void netdev_link_err | ( | struct net_device * | netdev, |
int | rc | ||
) |
Mark network device as having a specific link state.
netdev | Network device |
rc | Link status code |
Definition at line 207 of file netdevice.c.
References DBGC, net_device::link_block, net_device::link_rc, net_device::name, netdev, netdev_notify(), rc, stop_timer(), and strerror().
Referenced by eoib_join_complete(), eoib_link_state_changed(), gve_startup(), iphone_check_link(), ipoib_join_complete(), ipoib_link_state_changed(), net80211_deauthenticate(), net80211_set_state(), net80211_step_associate(), netdev_link_down(), netdev_link_up(), netfront_close(), rhine_check_link(), skeleton_check_link(), and vlan_sync().
void netdev_link_down | ( | struct net_device * | netdev | ) |
Mark network device as having link down.
netdev | Network device |
Definition at line 230 of file netdevice.c.
References ENOTCONN_LINK_DOWN, EUNKNOWN_LINK_STATUS, net_device::link_rc, netdev, and netdev_link_err().
Referenced by __vxge_hw_vpath_alarm_process(), atl1e_check_link(), atl1e_down(), atl_check_link(), atl_probe(), axge_check_link(), bnxt_set_link(), dm96xx_link_nsr(), ecm_intr_complete(), exanic_check_link(), flexboot_nodnic_state_change_netdev(), forcedeth_link_status(), gve_restart(), hermon_state_change_netdev(), hunt_check_link(), hunt_open(), ice_admin_link(), icplus_check_link(), intel_check_link(), intelx_check_link(), intelxl_admin_link(), intelxlvf_admin_link(), intelxvf_check_link(), jme_check_link(), jme_close(), jme_link_change(), mii_check_link(), myri10ge_interrupt_handler(), natsemi_check_link(), ncm_intr_complete(), net80211_netdev_close(), net80211_set_state(), netfront_close(), netfront_probe(), nii_poll_link(), phantom_poll_link_state(), realtek_check_link(), rhine_check_link(), rndis_rx_query_oid(), rndis_rx_status(), sis190_phy_task(), skge_down(), skge_link_down(), sky2_link_down(), sky2_up(), snpnet_check_link(), tg3_phy_reset(), tg3_setup_copper_phy(), tg3_setup_fiber_mii_phy(), tg3_test_and_report_link_chg(), txnic_lmac_update_link(), velocity_check_link(), vmxnet3_check_link(), vxge_close(), and vxge_open().
void netdev_link_block | ( | struct net_device * | netdev, |
unsigned long | timeout | ||
) |
Mark network device link as being blocked.
netdev | Network device |
timeout | Timeout (in ticks) |
Definition at line 247 of file netdevice.c.
References DBGC, net_device::link_block, net_device::name, netdev, netdev_link_blocked(), start_timer_fixed(), and timeout().
Referenced by eap_rx_identity(), eth_slow_lacp_rx(), and stp_rx().
void netdev_link_unblock | ( | struct net_device * | netdev | ) |
Mark network device link as being unblocked.
netdev | Network device |
Definition at line 262 of file netdevice.c.
References DBGC, net_device::link_block, net_device::name, netdev, netdev_link_blocked(), and stop_timer().
Referenced by eap_rx_success(), eth_slow_lacp_rx(), and stp_rx().
int netdev_tx | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf | ||
) |
Transmit raw packet via network device.
netdev | Network device |
iobuf | I/O buffer |
rc | Return status code |
Transmits the packet via the specified network device. This function takes ownership of the I/O buffer.
Definition at line 334 of file netdevice.c.
References io_buffer::data, DBGC2, net_device::dma, dma_mapped(), EBUSY, ENETUNREACH, iob_len(), iob_map_tx(), io_buffer::list, list_add_tail, io_buffer::map, net_device::name, netdev, NETDEV_DISCARD_RATE, netdev_is_open(), netdev_tx_complete_err(), NETDEV_TX_IN_PROGRESS, net_device::op, profile_start(), profile_stop(), rc, net_device::state, net_device_operations::transmit, and net_device::tx_queue.
Referenced by efi_snp_transmit(), gdbudp_recv(), gdbudp_send(), net80211_handle_auth(), net80211_netdev_transmit(), net80211_tx_mgmt(), net_tx(), netdev_tx_complete_err(), and pxenv_undi_transmit().
void netdev_tx_defer | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf | ||
) |
Defer transmitted packet.
netdev | Network device |
iobuf | I/O buffer |
Drivers may call netdev_tx_defer() if there is insufficient space in the transmit descriptor ring. Any packets deferred in this way will be automatically retransmitted as soon as space becomes available (i.e. as soon as the driver calls netdev_tx_complete()).
The packet must currently be in the network device's TX queue.
Drivers utilising netdev_tx_defer() must ensure that space in the transmit descriptor ring is freed up before calling netdev_tx_complete(). For example, if the ring is modelled using a producer counter and a consumer counter, then the consumer counter must be incremented before the call to netdev_tx_complete(). Failure to do this will cause the retransmitted packet to be immediately redeferred (which will result in out-of-order transmissions and other nastiness).
I/O buffers that have been mapped for DMA will remain mapped while present in the deferred transmit queue.
Definition at line 412 of file netdevice.c.
References ENOBUFS, io_buffer::list, list_add_tail, list_check_contains_entry, list_del, netdev, netdev_tx_err(), NULL, net_device::tx_deferred, and net_device::tx_queue.
Referenced by gve_transmit(), mnpnet_transmit(), nii_transmit(), realtek_transmit(), rndis_tx_defer(), and snpnet_transmit().
void netdev_tx_err | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf, | ||
int | rc | ||
) |
Discard transmitted packet.
netdev | Network device |
iobuf | I/O buffer, or NULL |
rc | Packet status code |
The packet is discarded and a TX error is recorded. This function takes ownership of the I/O buffer.
The I/O buffer will be automatically unmapped for DMA, if applicable.
Definition at line 440 of file netdevice.c.
References DBGC, DBGC2, dma_mapped(), free_iob(), iob_unmap(), io_buffer::map, net_device::name, netdev, netdev_record_stat(), rc, strerror(), and net_device::tx_stats.
Referenced by eoib_duplicate(), intel_poll(), neighbour_destroy(), net_tx(), netdev_tx_complete_err(), netdev_tx_defer(), rdc_poll(), rhine_poll(), rndis_tx_complete_err(), snpnet_poll_tx(), vmxnet3_poll_events(), and vmxnet3_poll_tx().
void netdev_tx_complete_err | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf, | ||
int | rc | ||
) |
Complete network transmission.
netdev | Network device |
iobuf | I/O buffer |
rc | Packet status code |
The packet must currently be in the network device's TX queue.
Definition at line 470 of file netdevice.c.
References ECANCELED, io_buffer::list, list_check_contains_entry, list_del, list_first_entry, netdev, netdev_tx(), netdev_tx_err(), rc, net_device::tx_deferred, and net_device::tx_queue.
Referenced by axge_out_complete(), dm96xx_out_complete(), ecm_out_complete(), eoib_complete_send(), flexboot_nodnic_eth_complete_send(), gve_start(), hermon_eth_complete_send(), ifec_tx_process(), iphone_out_complete(), ipoib_complete_send(), jme_free_tx_buffers(), jme_tx_clean(), mnpnet_close(), mnpnet_poll_tx(), ncm_out_complete(), net80211_tx_complete(), netdev_tx(), netdev_tx_complete(), netdev_tx_complete_next_err(), netfront_poll_tx(), nii_close(), phantom_close(), rndis_tx_complete_err(), sis190_process_tx(), smscusb_out_complete(), snpnet_close(), vmxnet3_flush_tx(), and vxge_xmit_compl().
void netdev_tx_complete_next_err | ( | struct net_device * | netdev, |
int | rc | ||
) |
Complete network transmission.
netdev | Network device |
rc | Packet status code |
Completes the oldest outstanding packet in the TX queue.
Definition at line 509 of file netdevice.c.
References io_buffer::list, list_first_entry, netdev, netdev_tx_complete_err(), NULL, rc, and net_device::tx_queue.
Referenced by myson_poll_tx(), natsemi_poll_tx(), netdev_tx_complete_next(), netdev_tx_flush(), rhine_poll_tx(), txnic_complete_sqe(), and velocity_poll_tx().
void netdev_rx | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf | ||
) |
Add packet to receive queue.
netdev | Network device |
iobuf | I/O buffer |
The packet is added to the network device's RX queue. This function takes ownership of the I/O buffer.
The I/O buffer will be automatically unmapped for DMA, if applicable.
Definition at line 548 of file netdevice.c.
References io_buffer::data, DBGC2, dma_mapped(), iob_len(), iob_unmap(), io_buffer::list, list_add_tail, io_buffer::map, net_device::name, netdev, NETDEV_DISCARD_RATE, netdev_record_stat(), netdev_rx_err(), rc, net_device::rx_queue, and net_device::rx_stats.
Referenced by a3c90x_process_rx_packets(), atl1e_clean_rx_irq(), atl_poll_rx(), axge_in_complete(), b44_process_rx_packets(), bnxt_rx_process(), dm96xx_in_complete(), ecm_in_complete(), efab_receive(), efx_hunt_receive(), ena_poll_rx(), eoib_complete_recv(), exanic_poll_rx(), flexboot_nodnic_eth_complete_recv(), gve_poll_rx(), icplus_poll_rx(), ifec_rx_process(), igbvf_process_rx_packets(), intel_poll_rx(), iphone_in_complete(), ipoib_complete_recv(), jme_alloc_and_feed_iob(), legacy_poll(), mnpnet_poll_rx(), myri10ge_net_poll(), myson_poll_rx(), natsemi_poll_rx(), ncm_in_complete(), net80211_rx(), netfront_poll_rx(), nii_poll_rx(), nv_process_rx_packets(), pcnet32_process_rx_packets(), phantom_poll(), pnic_poll(), rdc_poll_rx(), realtek_legacy_poll_rx(), realtek_poll_rx(), rhine_poll_rx(), rndis_rx_data(), sis190_process_rx(), skge_rx_done(), sky2_status_intr(), smsc75xx_in_complete(), smsc95xx_in_complete(), snpnet_poll_rx(), tg3_rx_complete(), txnic_complete_rqe(), undinet_poll(), velocity_poll_rx(), virtnet_process_rx_packets(), vlan_netdev_rx(), vlan_rx(), vmxnet3_poll_rx(), and vxge_hw_vpath_poll_rx().
void netdev_rx_err | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf, | ||
int | rc | ||
) |
Discard received packet.
netdev | Network device |
iobuf | I/O buffer, or NULL |
rc | Packet status code |
The packet is discarded and an RX error is recorded. This function takes ownership of the I/O buffer. iobuf
may be NULL if, for example, the net device wishes to report an error due to being unable to allocate an I/O buffer.
The I/O buffer will be automatically unmapped for DMA, if applicable.
Definition at line 586 of file netdevice.c.
References DBGC, dma_mapped(), free_iob(), iob_unmap(), io_buffer::map, net_device::name, netdev, netdev_record_stat(), rc, net_device::rx_stats, and strerror().
Referenced by a3c90x_process_rx_packets(), atl1e_clean_rx_irq(), axge_in_complete(), axge_intr_complete(), axge_poll(), b44_process_rx_packets(), bnxt_rx_process(), dm96xx_in_complete(), dm96xx_intr_complete(), dm96xx_poll(), ecm_in_complete(), ecm_intr_complete(), ecm_poll(), efx_hunt_receive(), eoib_complete_recv(), exanic_close(), exanic_poll_rx(), flexboot_nodnic_eth_complete_recv(), gve_poll_rx(), icplus_poll_rx(), ifec_rx_process(), igbvf_process_rx_packets(), intel_poll(), intel_poll_rx(), intelx_poll(), intelxvf_poll(), iphone_in_complete(), iphone_poll(), ipoib_complete_recv(), jme_process_receive(), mnpnet_poll_rx(), myson_poll_rx(), myson_refill_rx(), natsemi_poll_rx(), natsemi_refill_rx(), ncm_in_complete(), ncm_intr_complete(), ncm_poll(), net80211_rx(), net80211_rx_err(), net_poll(), netdev_rx(), netdev_rx_flush(), netfront_poll_rx(), netfront_refill_rx(), nii_poll_rx(), nv_process_rx_packets(), pcnet32_process_rx_packets(), phantom_refill_rx_ring(), pnic_poll(), rdc_poll_rx(), realtek_legacy_poll_rx(), realtek_poll_rx(), rhine_poll(), rhine_poll_rx(), rndis_rx(), rndis_rx_data(), rndis_rx_err(), rndis_rx_message(), rndis_rx_status(), skge_rx_done(), sky2_receive(), sky2_status_intr(), smsc75xx_in_complete(), smsc75xx_poll(), smsc95xx_in_complete(), smsc95xx_poll(), smscusb_intr_complete(), snpnet_poll_rx(), snpnet_poll_tx(), tg3_rx_complete(), txnic_complete_rqe(), undinet_poll(), velocity_poll_rx(), vlan_netdev_rx(), vlan_netdev_rx_err(), vmxnet3_flush_rx(), vmxnet3_poll_events(), vmxnet3_poll_rx(), and vxge_hw_vpath_poll_rx().
void netdev_poll | ( | struct net_device * | netdev | ) |
Poll for completed and received packets on network device.
netdev | Network device |
Polls the network device for completed transmissions and received packets. Any received packets will be added to the RX packet queue via netdev_rx().
Definition at line 612 of file netdevice.c.
References netdev, netdev_is_open(), NETDEV_POLL_IN_PROGRESS, net_device::op, net_device_operations::poll, and net_device::state.
Referenced by efi_snp_poll(), gdbudp_recv(), iflinkwait(), net_poll(), and vlan_poll().
struct io_buffer* netdev_rx_dequeue | ( | struct net_device * | netdev | ) |
Remove packet from device's receive queue.
netdev | Network device |
iobuf | I/O buffer, or NULL |
Removes the first packet from the device's RX queue and returns it. Ownership of the packet is transferred to the caller.
Definition at line 637 of file netdevice.c.
References io_buffer::list, list_del, list_first_entry, netdev, NULL, and net_device::rx_queue.
Referenced by efi_snp_poll(), gdbudp_recv(), net_poll(), netdev_rx_flush(), and pxenv_undi_isr().
struct net_device* alloc_netdev | ( | size_t | priv_len | ) |
Allocate network device.
priv_len | Length of private data area (net_device::priv) |
netdev | Network device, or NULL |
Allocates space for a network device and its private data area.
Definition at line 721 of file netdevice.c.
References net_device::configs, net_device_configuration::configurator, EUNKNOWN_LINK_STATUS, EUNUSED_CONFIG, for_each_table_entry, free_netdev(), INIT_LIST_HEAD, intf_init(), net_device_configuration::job, net_device::link_block, net_device::link_rc, NET_DEVICE_CONFIGURATORS, netdev, net_device_configuration::netdev, netdev_config_desc, netdev_link_block_expired(), netdev_priv(), netdev_priv_offset(), netdev_settings_init(), NULL, net_device::priv, net_device_configuration::rc, ref_init, net_device::refcnt, net_device::rx_queue, net_device::tx_deferred, net_device::tx_queue, and zalloc().
Referenced by alloc_etherdev(), alloc_ipoibdev(), net80211_alloc(), and nii_start().
int register_netdev | ( | struct net_device * | netdev | ) |
Register network device.
netdev | Network device |
rc | Return status code |
Gives the network device a name and adds it to the list of network devices.
Definition at line 759 of file netdevice.c.
References clear_settings(), DBGC, net_device::dev, EEXIST, find_netdev(), find_netdev_by_scope_id(), for_each_table_entry, for_each_table_entry_continue_reverse, net_device::hw_addr, ll_protocol::init_addr, net_device::list, list_add_tail, list_del, net_device::ll_addr, ll_protocol::ll_addr_len, ll_protocol::ll_header_len, net_device::ll_protocol, net_device::max_pkt_len, memcpy(), net_device::mtu, device::name, net_device::name, net_driver::name, net_devices, NET_DRIVERS, netdev, netdev_addr(), netdev_get(), netdev_has_ll_addr(), netdev_priv(), netdev_put(), netdev_settings(), NULL, priv, net_driver::probe, rand(), rc, register_settings(), net_driver::remove, net_device::scope_id, snprintf(), srand(), strerror(), and unregister_settings().
Referenced by a3c90x_probe(), atl1e_probe(), atl_probe(), axge_probe(), b44_probe(), bnxt_init_one(), dm96xx_probe(), ecm_probe(), efab_probe(), ena_probe(), eoib_create(), exanic_probe_port(), flexboot_nodnic_register_netdev(), forcedeth_probe(), gve_probe(), hermon_register_netdev(), hunt_probe(), ice_probe(), icplus_probe(), ifec_pci_probe(), igbvf_probe(), intel_probe(), intelx_probe(), intelxl_probe(), intelxlvf_probe(), intelxvf_probe(), iphone_probe(), ipoib_probe(), jme_probe(), lan78xx_probe(), legacy_probe(), mnpnet_start(), myri10ge_pci_probe(), myson_probe(), natsemi_probe(), ncm_probe(), net80211_register(), netfront_probe(), nii_start(), pcnet32_probe(), phantom_probe(), pnic_probe(), rdc_probe(), realtek_probe(), register_rndis(), rhine_probe(), sis190_probe(), skeleton_probe(), skge_probe(), sky2_probe(), smsc75xx_probe(), smsc95xx_probe(), snpnet_start(), tg3_init_one(), txnic_lmac_probe(), undinet_probe(), velocity_probe(), virtnet_probe_legacy(), virtnet_probe_modern(), vlan_create(), vmxnet3_probe(), and vxge_device_register().
int netdev_open | ( | struct net_device * | netdev | ) |
Open network device.
netdev | Network device |
rc | Return status code |
Definition at line 861 of file netdevice.c.
References DBGC, list_add, net_device::name, netdev, netdev_notify(), NETDEV_OPEN, net_device::op, net_device_operations::open, net_device::open_list, open_net_devices, rc, and net_device::state.
Referenced by apply_netdev_settings(), efi_autoexec_network(), efi_snp_initialize(), efi_snp_reset(), gdbudp_ensure_netdev_open(), ifopen(), iwlist(), netvsc_reset(), pxe_exec(), pxe_netdev_open(), pxenv_udp_open(), vlan_open(), vlan_sync(), and xve_open().
void netdev_close | ( | struct net_device * | netdev | ) |
Close network device.
netdev | Network device |
Definition at line 895 of file netdevice.c.
References net_device_operations::close, net_device::configs, DBGC, ECANCELED, intf_close(), net_device_configuration::job, net_device::link_block, list_del, net_device::name, NET_DEVICE_CONFIGURATORS, netdev, netdev_notify(), NETDEV_OPEN, netdev_rx_flush(), netdev_tx_flush(), net_device::op, net_device::open_list, net_device::state, stop_timer(), and table_num_entries.
Referenced by apply_netdev_settings(), efi_snp_reset(), efi_snp_shutdown(), ifclose(), ifconf_payload(), iflinkwait_payload(), iwlist(), netvsc_reset(), pxe_netdev_close(), unregister_netdev(), vlan_close(), vlan_sync(), and xve_close().
void unregister_netdev | ( | struct net_device * | netdev | ) |
Unregister network device.
netdev | Network device |
Removes the network device from the list of network devices.
Definition at line 941 of file netdevice.c.
References clear_settings(), DBGC, for_each_table_entry_reverse, net_device::list, list_del, net_device::name, NET_DRIVERS, netdev, netdev_close(), netdev_priv(), netdev_put(), netdev_settings(), priv, net_driver::remove, and unregister_settings().
Referenced by a3c90x_remove(), atl1e_remove(), atl_remove(), axge_probe(), axge_remove(), b44_remove(), bnxt_remove_one(), dm96xx_probe(), dm96xx_remove(), ecm_probe(), ecm_remove(), efab_probe(), efab_remove(), ena_probe(), ena_remove(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), flexboot_nodnic_unregister_netdev(), forcedeth_remove(), gve_probe(), gve_remove(), hermon_register_netdev(), hermon_unregister_netdev(), hunt_remove(), ice_probe(), ice_remove(), icplus_probe(), icplus_remove(), ifec_pci_remove(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxl_probe(), intelxl_remove(), intelxlvf_probe(), intelxlvf_remove(), intelxvf_probe(), intelxvf_remove(), iphone_probe(), iphone_remove(), ipoib_probe(), ipoib_remove(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_remove(), mnpnet_start(), mnpnet_stop(), myri10ge_pci_probe(), myri10ge_pci_remove(), myson_probe(), myson_remove(), natsemi_probe(), natsemi_remove(), ncm_probe(), ncm_remove(), net80211_unregister(), netfront_probe(), netfront_remove(), nii_start(), nii_stop(), pcnet32_remove(), phantom_probe(), phantom_remove(), pnic_remove(), rdc_probe(), rdc_remove(), realtek_probe(), realtek_remove(), register_rndis(), rhine_remove(), sis190_remove(), skeleton_probe(), skeleton_remove(), skge_remove(), sky2_remove(), smsc75xx_probe(), smsc75xx_remove(), smsc95xx_probe(), smsc95xx_remove(), snpnet_start(), snpnet_stop(), tg3_remove_one(), txnic_lmac_probe(), txnic_lmac_remove(), undinet_remove(), unregister_rndis(), velocity_remove(), virtnet_probe_legacy(), virtnet_probe_modern(), virtnet_remove(), vlan_create(), vlan_destroy(), vmxnet3_probe(), vmxnet3_remove(), and vxge_device_unregister().
void netdev_irq | ( | struct net_device * | netdev, |
int | enable | ||
) |
Enable or disable interrupts.
netdev | Network device |
enable | Interrupts should be enabled |
Definition at line 970 of file netdevice.c.
References net_device_operations::irq, netdev, NETDEV_IRQ_ENABLED, netdev_irq_supported(), net_device::op, and net_device::state.
Referenced by pxe_netdev_close(), pxe_netdev_open(), pxenv_undi_isr(), pxenv_undi_transmit(), virtnet_open_legacy(), virtnet_open_modern(), and vlan_irq().
struct net_device* find_netdev | ( | const char * | name | ) |
Get network device by name.
name | Network device name |
netdev | Network device, or NULL |
Definition at line 988 of file netdevice.c.
References last_opened_netdev(), net_device::list, list_for_each_entry, net_device::name, name, net_devices, netdev, NULL, and strcmp().
Referenced by gdbudp_configure(), ipv6_sock_aton(), netdev_redirect(), parse_netdev(), and register_netdev().
struct net_device* find_netdev_by_scope_id | ( | unsigned int | scope_id | ) |
Get network device by scope ID.
index | Network device index |
netdev | Network device, or NULL |
Definition at line 1010 of file netdevice.c.
References net_device::list, list_for_each_entry, net_devices, netdev, NULL, and net_device::scope_id.
Referenced by ipv6_sock_ntoa(), and register_netdev().
struct net_device* find_netdev_by_location | ( | unsigned int | bus_type, |
unsigned int | location | ||
) |
Get network device by PCI bus:dev.fn address.
bus_type | Bus type |
location | Bus location |
netdev | Network device, or NULL |
Definition at line 1029 of file netdevice.c.
References device_description::bus_type, device::desc, net_device::dev, net_device::list, list_for_each_entry, device_description::location, net_devices, netdev, and NULL.
Referenced by pxenv_start_undi().
struct net_device* last_opened_netdev | ( | void | ) |
Get most recently opened network device.
netdev | Most recently opened network device, or NULL |
Definition at line 1047 of file netdevice.c.
References assert(), list_first_entry, netdev, netdev_is_open(), NULL, net_device::open_list, and open_net_devices.
Referenced by aoe_open(), find_netdev(), ipv6_sock_aton(), last_opened_snpdev(), nbi_prepare_dhcp(), and pxe_exec().
int net_tx | ( | struct io_buffer * | iobuf, |
struct net_device * | netdev, | ||
struct net_protocol * | net_protocol, | ||
const void * | ll_dest, | ||
const void * | ll_source | ||
) |
Transmit network-layer packet.
iobuf | I/O buffer |
netdev | Network device |
net_protocol | Network-layer protocol |
ll_dest | Destination link-layer address |
ll_source | Source link-layer address |
rc | Return status code |
Prepends link-layer headers to the I/O buffer and transmits the packet via the specified network device. This function takes ownership of the I/O buffer.
Definition at line 1073 of file netdevice.c.
References net_device::ll_protocol, net_protocol::net_proto, netdev, netdev_tx(), netdev_tx_err(), ll_protocol::push, and rc.
Referenced by aoecmd_tx(), arp_rx(), arp_tx_request(), eapol_tx(), eth_slow_lacp_rx(), eth_slow_marker_rx(), fcoe_deliver(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), ipv4_tx(), ipv6_tx(), loopback_test(), neighbour_discovered(), neighbour_tx(), vlan_transmit(), and wpa_send_eapol().
int net_rx | ( | struct io_buffer * | iobuf, |
struct net_device * | netdev, | ||
uint16_t | net_proto, | ||
const void * | ll_dest, | ||
const void * | ll_source, | ||
unsigned int | flags | ||
) |
Process received network-layer packet.
iobuf | I/O buffer |
netdev | Network device |
net_proto | Network-layer protocol, in network-byte order |
ll_dest | Destination link-layer address |
ll_source | Source link-layer address |
flags | Packet flags |
rc | Return status code |
Definition at line 1102 of file netdevice.c.
References DBGC, ENOTSUP, flags, for_each_table_entry, free_iob(), net_device::name, net_protocol::net_proto, NET_PROTOCOLS, netdev, ntohs, and net_protocol::rx.
Referenced by net_poll().
void net_poll | ( | void | ) |
Poll the network stack.
This polls all interfaces for received packets, and processes packets from the RX queue.
Definition at line 1126 of file netdevice.c.
References io_buffer::data, DBGC2, flags, free_iob(), iob_disown, iob_len(), list_for_each_entry, net_device::ll_protocol, net_device::name, net_devices, net_rx(), netdev, netdev_poll(), netdev_rx_dequeue(), netdev_rx_err(), netdev_rx_frozen(), NULL, profile_start(), profile_stop(), ll_protocol::pull, and rc.
Referenced by loopback_wait(), net_step(), and pxenv_undi_isr().
struct net_device_configurator* find_netdev_configurator | ( | const char * | name | ) |
Find network device configurator.
name | Name |
configurator | Network device configurator, or NULL |
Definition at line 1278 of file netdevice.c.
References for_each_table_entry, net_device_configurator::name, name, NET_DEVICE_CONFIGURATORS, NULL, and strcmp().
Referenced by parse_netdev_configurator().
int netdev_configure | ( | struct net_device * | netdev, |
struct net_device_configurator * | configurator | ||
) |
Start network device configuration.
netdev | Network device |
configurator | Network device configurator |
rc | Return status code |
Definition at line 1295 of file netdevice.c.
References net_device_configuration::configurator, DBGC, ECANCELED, EINPROGRESS_CONFIG, ENOTSUP, intf_restart(), net_device_configuration::job, net_device_configurator::name, net_device::name, netdev, netdev_configuration(), netdev_configurator_applies(), net_device_configuration::rc, rc, net_device_configurator::start, and strerror().
Referenced by ifconf(), and netdev_configure_all().
int netdev_configure_all | ( | struct net_device * | netdev | ) |
Start network device configuration via all supported configurators.
netdev | Network device |
rc | Return status code |
Definition at line 1335 of file netdevice.c.
References for_each_table_entry, NET_DEVICE_CONFIGURATORS, netdev, netdev_configurator_applies(), netdev_configure(), and rc.
Referenced by efi_pxe_dhcp(), and ifconf().
int netdev_configuration_in_progress | ( | struct net_device * | netdev | ) |
Check if network device configuration is in progress.
netdev | Network device |
is_in_progress | Network device configuration is in progress |
Definition at line 1379 of file netdevice.c.
References EINPROGRESS_CONFIG, netdev, and netdev_has_configuration_rc().
Referenced by efi_pxe_dhcp(), and ifconf_progress().
int netdev_configuration_ok | ( | struct net_device * | netdev | ) |
Check if network device has at least one successful configuration.
netdev | Network device |
configurator | Configurator |
rc | Return status code |
Definition at line 1391 of file netdevice.c.
References netdev, and netdev_has_configuration_rc().
Referenced by efi_pxe_dhcp(), and ifconf_progress().
|
inlinestatic |
Complete network transmission.
netdev | Network device |
iobuf | I/O buffer |
The packet must currently be in the network device's TX queue.
Definition at line 752 of file netdevice.h.
References netdev, and netdev_tx_complete_err().
Referenced by a3c90x_process_tx_packets(), atl1e_clean_tx_irq(), atl1e_clean_tx_ring(), b44_tx_complete(), bnxt_tx_complete(), efab_free_resources(), efab_transmit_done(), efx_hunt_close(), efx_hunt_transmit_done(), ena_poll_tx(), gve_poll_tx(), ifec_tx_process(), igbvf_process_tx_packets(), jme_tx_clean(), legacy_transmit(), myri10ge_interrupt_handler(), net80211_netdev_transmit(), netfront_poll_tx(), nii_poll_tx(), nv_process_tx_packets(), pcnet32_process_tx_packets(), phantom_poll(), pnic_transmit(), sis190_process_tx(), skge_tx_done(), sky2_tx_complete(), snpnet_poll_tx(), tg3_tx_complete(), undinet_transmit(), virtnet_process_tx_packets(), vmxnet3_poll_tx(), and vxge_xmit_compl().
|
inlinestatic |
Complete network transmission.
netdev | Network device |
Completes the oldest outstanding packet in the TX queue.
Definition at line 764 of file netdevice.h.
References netdev, and netdev_tx_complete_next_err().
Referenced by atl_poll_tx(), exanic_poll_tx(), icplus_poll_tx(), intel_poll_tx(), intelxl_poll_tx(), myson_poll_tx(), natsemi_poll_tx(), rdc_poll_tx(), realtek_poll_tx(), rhine_poll_tx(), txnic_complete_sqe(), and velocity_poll_tx().
|
inlinestatic |
Mark network device as having link up.
netdev | Network device |
Definition at line 774 of file netdevice.h.
References netdev, and netdev_link_err().
Referenced by __vxge_hw_vpath_alarm_process(), a3c90x_probe(), atl1e_check_link(), atl_check_link(), axge_check_link(), b44_probe(), bnxt_set_link(), dm96xx_link_nsr(), ecm_intr_complete(), efab_init_mac(), efab_probe(), ena_probe(), exanic_check_link(), flexboot_nodnic_state_change_netdev(), forcedeth_link_status(), gve_startup(), hermon_state_change_netdev(), hunt_check_link(), ice_admin_link(), icplus_check_link(), ifec_pci_probe(), igbvf_probe(), intel_check_link(), intelx_check_link(), intelxl_admin_link(), intelxlvf_admin_link(), intelxvf_check_link(), jme_check_link(), legacy_probe(), mii_check_link(), mnpnet_start(), myri10ge_interrupt_handler(), myson_probe(), natsemi_check_link(), ncm_intr_complete(), net80211_step_associate(), netfront_open(), nii_poll_link(), nii_start(), pcnet32_probe(), phantom_poll_link_state(), pnic_probe(), realtek_check_link(), rhine_check_link(), rndis_rx_query_oid(), rndis_rx_status(), sis190_phy_task(), skge_link_up(), sky2_link_up(), snpnet_check_link(), snpnet_start(), tg3_setup_copper_phy(), tg3_test_and_report_link_chg(), txnic_lmac_update_link(), undinet_probe(), velocity_check_link(), virtnet_probe_legacy(), virtnet_probe_modern(), vmxnet3_check_link(), and vxge_open().
struct list_head net_devices |
List of network devices.
Definition at line 53 of file netdevice.c.
Referenced by find_netdev(), find_netdev_by_location(), find_netdev_by_scope_id(), have_netdevs(), net_poll(), and register_netdev().
struct net_device_operations null_netdev_operations |
Definition at line 59 of file nullnet.c.
Referenced by netdev_nullify().
struct settings_operations netdev_settings_operations |
Network device configuration settings operations.
Definition at line 380 of file netdev_settings.c.
Referenced by netdev_settings_init().