iPXE
Data Structures | Defines | Functions | Variables
netdevice.h File Reference

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...

Defines

#define MAX_HW_ADDR_LEN   8
 Maximum length of a hardware address.
#define MAX_LL_ADDR_LEN   20
 Maximum length of a link-layer address.
#define MAX_LL_HEADER_LEN   64
 Maximum length of a link-layer header.
#define MAX_NET_ADDR_LEN   16
 Maximum length of a network-layer address.
#define MAX_NET_HEADER_LEN   40
 Maximum length of a network-layer header.
#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.
#define LL_MULTICAST   0x0001
 Packet is a multicast (including broadcast) packet.
#define LL_BROADCAST   0x0002
 Packet is a broadcast packet.
#define LL_NAME_ONLY   0x0001
 Local link-layer address functions only as a name.
#define NETDEV_MAX_UNIQUE_ERRORS   4
 Maximum number of unique errors that we will keep track of.
#define NET_DEVICE_CONFIGURATORS   __table ( struct net_device_configurator, "net_device_configurators" )
 Network device configurator table.
#define __net_device_configurator   __table_entry ( NET_DEVICE_CONFIGURATORS, 01 )
 Declare a network device configurator.
#define NETDEV_NAME_LEN   12
 Maximum length of a network device name.
#define NETDEV_OPEN   0x0001
 Network device is open.
#define NETDEV_IRQ_ENABLED   0x0002
 Network device interrupts are enabled.
#define NETDEV_RX_FROZEN   0x0004
 Network device receive queue processing is frozen.
#define NETDEV_IRQ_UNSUPPORTED   0x0008
 Network device interrupts are unsupported.
#define LL_PROTOCOLS   __table ( struct ll_protocol, "ll_protocols" )
 Link-layer protocol table.
#define __ll_protocol   __table_entry ( LL_PROTOCOLS, 01 )
 Declare a link-layer protocol.
#define NET_PROTOCOLS   __table ( struct net_protocol, "net_protocols" )
 Network-layer protocol table.
#define __net_protocol   __table_entry ( NET_PROTOCOLS, 01 )
 Declare a network-layer protocol.
#define NET_DRIVERS   __table ( struct net_driver, "net_drivers" )
 Network driver table.
#define __net_driver   __table_entry ( NET_DRIVERS, 01 )
 Declare a network driver.
#define for_each_netdev(netdev)   list_for_each_entry ( (netdev), &net_devices, list )
 Iterate over all network devices.

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.
static void netdev_nullify (struct net_device *netdev)
 Stop using a network device.
static const char * netdev_addr (struct net_device *netdev)
 Get printable network device link-layer address.
static int have_netdevs (void)
 There exist some network devices.
static struct net_devicenetdev_get (struct net_device *netdev)
 Get reference to network device.
static void netdev_put (struct net_device *netdev)
 Drop reference to network device.
static void * netdev_priv (struct net_device *netdev)
 Get driver private area for this network device.
static struct settingsnetdev_settings (struct net_device *netdev)
 Get per-netdevice configuration settings block.
static void netdev_settings_init (struct net_device *netdev)
 Initialise a per-netdevice configuration settings block.
static struct
net_device_configuration
netdev_configuration (struct net_device *netdev, struct net_device_configurator *configurator)
 Get network device configuration.
static int netdev_configurator_applies (struct net_device *netdev, struct net_device_configurator *configurator)
 Check if configurator applies to network device.
static int netdev_link_ok (struct net_device *netdev)
 Check link state of network device.
static int netdev_link_blocked (struct net_device *netdev)
 Check link block state of network device.
static int netdev_is_open (struct net_device *netdev)
 Check whether or not network device is open.
static int netdev_irq_supported (struct net_device *netdev)
 Check whether or not network device supports interrupts.
static int netdev_irq_enabled (struct net_device *netdev)
 Check whether or not network device interrupts are currently enabled.
static int netdev_rx_frozen (struct net_device *netdev)
 Check whether or not network device receive queue processing is frozen.
void netdev_rx_freeze (struct net_device *netdev)
 Freeze network device receive queue processing.
void netdev_rx_unfreeze (struct net_device *netdev)
 Unfreeze network device receive queue processing.
void netdev_link_err (struct net_device *netdev, int rc)
 Mark network device as having a specific link state.
void netdev_link_down (struct net_device *netdev)
 Mark network device as having link down.
void netdev_link_block (struct net_device *netdev, unsigned long timeout)
 Mark network device link as being blocked.
void netdev_link_unblock (struct net_device *netdev)
 Mark network device link as being unblocked.
int netdev_tx (struct net_device *netdev, struct io_buffer *iobuf)
 Transmit raw packet via network device.
void netdev_tx_defer (struct net_device *netdev, struct io_buffer *iobuf)
 Defer transmitted packet.
void netdev_tx_err (struct net_device *netdev, struct io_buffer *iobuf, int rc)
 Discard transmitted packet.
void netdev_tx_complete_err (struct net_device *netdev, struct io_buffer *iobuf, int rc)
 Complete network transmission.
void netdev_tx_complete_next_err (struct net_device *netdev, int rc)
 Complete network transmission.
void netdev_rx (struct net_device *netdev, struct io_buffer *iobuf)
 Add packet to receive queue.
void netdev_rx_err (struct net_device *netdev, struct io_buffer *iobuf, int rc)
 Discard received packet.
void netdev_poll (struct net_device *netdev)
 Poll for completed and received packets on network device.
struct io_buffernetdev_rx_dequeue (struct net_device *netdev)
 Remove packet from device's receive queue.
struct net_devicealloc_netdev (size_t priv_size)
 Allocate network device.
int register_netdev (struct net_device *netdev)
 Register network device.
int netdev_open (struct net_device *netdev)
 Open network device.
void netdev_close (struct net_device *netdev)
 Close network device.
void unregister_netdev (struct net_device *netdev)
 Unregister network device.
void netdev_irq (struct net_device *netdev, int enable)
 Enable or disable interrupts.
struct net_devicefind_netdev (const char *name)
 Get network device by name.
struct net_devicefind_netdev_by_index (unsigned int index)
 Get network device by index.
struct net_devicefind_netdev_by_location (unsigned int bus_type, unsigned int location)
 Get network device by PCI bus:dev.fn address.
struct net_devicefind_netdev_by_ll_addr (struct ll_protocol *ll_protocol, const void *ll_addr)
 Get network device by link-layer address.
struct net_devicelast_opened_netdev (void)
 Get most recently opened network device.
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.
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.
void net_poll (void)
 Poll the network stack.
struct net_device_configuratorfind_netdev_configurator (const char *name)
 Find network device configurator.
int netdev_configure (struct net_device *netdev, struct net_device_configurator *configurator)
 Start network device configuration.
int netdev_configure_all (struct net_device *netdev)
 Start network device configuration via all supported configurators.
int netdev_configuration_in_progress (struct net_device *netdev)
 Check if network device configuration is in progress.
int netdev_configuration_ok (struct net_device *netdev)
 Check if network device has at least one successful configuration.
static void netdev_tx_complete (struct net_device *netdev, struct io_buffer *iobuf)
 Complete network transmission.
static void netdev_tx_complete_next (struct net_device *netdev)
 Complete network transmission.
static void netdev_link_up (struct net_device *netdev)
 Mark network device as having link up.

Variables

struct list_head net_devices
 List of network devices.
struct net_device_operations null_netdev_operations
struct settings_operations netdev_settings_operations
 Network device configuration settings operations.

Detailed Description

Network device management.

Definition in file netdevice.h.


Define Documentation

#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.

Referenced by arp_tx_request(), ipv4_tx(), ipv6_tx(), and pxenv_undi_transmit().

#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.

Referenced by aoecmd_tx(), arp_tx_request(), efi_snp_transmit(), fcoe_alloc_iob(), fcoe_fip_tx_keepalive(), fcoe_fip_tx_solicitation(), fcoe_fip_tx_vlan(), loopback_test(), pxenv_undi_transmit(), and wpa_alloc_frame().

#define MAX_NET_ADDR_LEN   16

Maximum length of a network-layer address.

Definition at line 48 of file netdevice.h.

Referenced by arp_tx_request().

#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.

Maximum combined length of a link-layer and network-layer header.

Definition at line 58 of file netdevice.h.

Referenced by ndp_tx_ll_addr(), ping_alloc_iob(), udp_tx(), and udp_xfer_alloc_iob().

#define LL_MULTICAST   0x0001

Packet is a multicast (including broadcast) packet.

Definition at line 105 of file netdevice.h.

Referenced by eth_pull(), ipv4_rx(), ipv6_rx(), net80211_ll_pull(), and pxenv_undi_isr().

#define LL_BROADCAST   0x0002

Packet is a broadcast packet.

Definition at line 108 of file netdevice.h.

Referenced by eth_pull(), ipv4_rx(), ipv6_rx(), net80211_ll_pull(), pxenv_undi_isr(), and undinet_transmit().

#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.

Referenced by dhcp_create_packet().

#define NETDEV_MAX_UNIQUE_ERRORS   4

Maximum number of unique errors that we will keep track of.

Definition at line 284 of file netdevice.h.

#define NET_DEVICE_CONFIGURATORS   __table ( struct net_device_configurator, "net_device_configurators" )

Network device configurator table.

Definition at line 328 of file netdevice.h.

Referenced by alloc_netdev(), find_netdev_configurator(), netdev_close(), netdev_configuration(), netdev_configure_all(), and netdev_has_configuration_rc().

Declare a network device configurator.

Definition at line 332 of file netdevice.h.

#define NETDEV_NAME_LEN   12

Maximum length of a network device name.

Definition at line 336 of file netdevice.h.

Referenced by ipv6_sock_ntoa().

#define NETDEV_OPEN   0x0001

Network device is open.

Definition at line 432 of file netdevice.h.

Referenced by efx_hunt_irq(), netdev_close(), netdev_is_open(), and netdev_open().

#define NETDEV_IRQ_ENABLED   0x0002

Network device interrupts are enabled.

Definition at line 435 of file netdevice.h.

Referenced by netdev_irq(), and netdev_irq_enabled().

#define NETDEV_RX_FROZEN   0x0004

Network device receive queue processing is frozen.

Definition at line 438 of file netdevice.h.

Referenced by netdev_rx_freeze(), netdev_rx_frozen(), and netdev_rx_unfreeze().

#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 446 of file netdevice.h.

Referenced by hunt_probe(), net80211_register(), netdev_irq_supported(), and vlan_create().

#define LL_PROTOCOLS   __table ( struct ll_protocol, "ll_protocols" )

Link-layer protocol table.

Definition at line 449 of file netdevice.h.

Declare a link-layer protocol.

Definition at line 452 of file netdevice.h.

#define NET_PROTOCOLS   __table ( struct net_protocol, "net_protocols" )

Network-layer protocol table.

Definition at line 455 of file netdevice.h.

Referenced by net_rx().

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 458 of file netdevice.h.

#define NET_DRIVERS   __table ( struct net_driver, "net_drivers" )

Network driver table.

Definition at line 483 of file netdevice.h.

Referenced by netdev_notify(), register_netdev(), and unregister_netdev().

#define __net_driver   __table_entry ( NET_DRIVERS, 01 )

Declare a network driver.

Definition at line 486 of file netdevice.h.

#define for_each_netdev (   netdev)    list_for_each_entry ( (netdev), &net_devices, list )

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static void netdev_init ( struct net_device netdev,
struct net_device_operations op 
) [inline, static]
static void netdev_nullify ( struct net_device netdev) [inline, static]

Stop using a network device.

Parameters:
netdevNetwork device

Drivers should call this method immediately before the final call to netdev_put().

Definition at line 511 of file netdevice.h.

References null_netdev_operations, and net_device::op.

Referenced by a3c90x_remove(), atl1e_probe(), atl1e_remove(), axge_probe(), axge_remove(), b44_remove(), dm96xx_probe(), dm96xx_remove(), ecm_probe(), ecm_remove(), efab_remove(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), flexboot_nodnic_unregister_netdev(), forcedeth_probe(), forcedeth_remove(), free_rndis(), golan_remove_normal(), hermon_probe(), hermon_remove(), hunt_remove(), ifec_pci_probe(), ifec_pci_remove(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxvf_probe(), intelxvf_remove(), ipoib_probe(), ipoib_remove(), jme_probe(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_probe(), legacy_remove(), 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(), 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().

                                                                {
        netdev->op = &null_netdev_operations;
}
static const char* netdev_addr ( struct net_device netdev) [inline, static]

Get printable network device link-layer address.

Parameters:
netdevNetwork device
Return values:
nameLink-layer address

Definition at line 521 of file netdevice.h.

References net_device::ll_addr, net_device::ll_protocol, 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().

                                                                     {
        return netdev->ll_protocol->ntoa ( netdev->ll_addr );
}
static int have_netdevs ( void  ) [inline, static]

There exist some network devices.

Return values:
existenceExistence of network devices

Definition at line 533 of file netdevice.h.

References list_empty, and net_devices.

                                        {
        return ( ! list_empty ( &net_devices ) );
}
static struct net_device* netdev_get ( struct net_device netdev) [static, read]

Get reference to network device.

Parameters:
netdevNetwork device
Return values:
netdevNetwork device

Definition at line 544 of file netdevice.h.

References netdev, and ref_get.

Referenced by add_ipv4_miniroute(), aoedev_open(), efi_pxe_install(), efi_snp_probe(), fcoe_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().

                                         {
        ref_get ( &netdev->refcnt );
        return netdev;
}
static void netdev_put ( struct net_device netdev) [inline, static]

Drop reference to network device.

Parameters:
netdevNetwork device

Definition at line 555 of file netdevice.h.

References ref_put.

Referenced by a3c90x_probe(), a3c90x_remove(), aoedev_free(), atl1e_probe(), atl1e_remove(), axge_probe(), axge_remove(), b44_probe(), b44_remove(), 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(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), fcoe_close(), fcoe_probe(), flexboot_nodnic_register_netdev(), flexboot_nodnic_unregister_netdev(), forcedeth_probe(), forcedeth_remove(), free_rndis(), gdbudp_configure(), hermon_probe(), hermon_remove(), hunt_probe(), hunt_remove(), ifec_pci_probe(), ifec_pci_remove(), igbvf_probe(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxvf_probe(), intelxvf_remove(), ipoib_probe(), ipoib_remove(), ipv6_del_miniroute(), ipv6conf_free(), jme_probe(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_probe(), legacy_remove(), 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(), 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().

                                         {
        ref_put ( &netdev->refcnt );
}
static void* netdev_priv ( struct net_device netdev) [inline, static]

Get driver private area for this network device.

Parameters:
netdevNetwork device
Return values:
privDriver private area for this network device

Definition at line 566 of file netdevice.h.

Referenced by __mdio_read(), __mdio_write(), __tg3_set_rx_mode(), a3c90x_close(), a3c90x_hw_start(), a3c90x_irq(), a3c90x_open(), a3c90x_poll(), a3c90x_probe(), a3c90x_process_rx_packets(), a3c90x_process_tx_packets(), a3c90x_remove(), a3c90x_transmit(), atl1e_close(), atl1e_irq(), atl1e_mdio_read(), atl1e_mdio_write(), atl1e_open(), atl1e_poll(), atl1e_probe(), atl1e_remove(), atl1e_xmit_frame(), b44_close(), b44_irq(), b44_open(), b44_poll(), b44_probe(), b44_remove(), b44_set_rx_mode(), b44_transmit(), bcom_check_link(), efab_close(), efab_irq(), efab_open(), efab_poll(), efab_probe(), efab_remove(), efab_transmit(), efx_hunt_close(), efx_hunt_ev_init(), efx_hunt_irq(), efx_hunt_open(), efx_hunt_poll(), efx_hunt_rx_init(), efx_hunt_transmit(), efx_hunt_tx_init(), efx_probe(), efx_remove(), forcedeth_close(), forcedeth_irq(), forcedeth_link_status(), forcedeth_open(), forcedeth_poll(), forcedeth_probe(), forcedeth_transmit(), genesis_mac_init(), hunt_close(), hunt_open(), hunt_poll(), hunt_probe(), hunt_remove(), ifec_free(), igbvf_close(), igbvf_irq(), igbvf_open(), igbvf_poll(), igbvf_probe(), igbvf_process_rx_packets(), igbvf_process_tx_packets(), igbvf_remove(), igbvf_transmit(), jme_load_macaddr(), nv_process_rx_packets(), nv_process_tx_packets(), pcnet32_close(), pcnet32_irq(), pcnet32_open(), pcnet32_poll(), pcnet32_probe(), pcnet32_process_rx_packets(), pcnet32_process_tx_packets(), pcnet32_transmit(), phantom_close(), phantom_irq(), phantom_open(), phantom_poll(), phantom_poll_link_state(), phantom_probe(), phantom_refill_rx_ring(), phantom_remove(), phantom_transmit(), sis190_down(), sis190_free(), sis190_get_mac_addr_from_apc(), sis190_get_mac_addr_from_eeprom(), sis190_hw_start(), sis190_init_board(), sis190_init_ring(), sis190_init_rxfilter(), sis190_irq(), sis190_mii_probe(), sis190_mii_remove(), sis190_open(), sis190_poll(), sis190_probe(), sis190_set_rx_mode(), sis190_set_speed_auto(), sis190_transmit(), skge_devinit(), skge_down(), skge_free(), skge_net_irq(), skge_phyirq(), skge_poll(), skge_rx_done(), skge_rx_refill(), skge_tx_clean(), skge_tx_done(), skge_up(), skge_xmit_frame(), sky2_down(), sky2_init_netdev(), sky2_le_error(), sky2_net_irq(), sky2_phy_init(), sky2_phy_intr(), sky2_poll(), sky2_receive(), sky2_set_multicast(), sky2_status_intr(), sky2_tx_clean(), sky2_tx_done(), sky2_up(), sky2_xmit_frame(), snpnet_check_link(), snpnet_dump_mode(), snpnet_transmit(), tg3_close(), tg3_init_one(), tg3_irq(), tg3_open(), tg3_poll(), tg3_rx_complete(), tg3_transmit(), tg3_tx_complete(), vmxnet3_check_link(), vmxnet3_close(), vmxnet3_flush_rx(), vmxnet3_flush_tx(), vmxnet3_irq(), vmxnet3_open(), vmxnet3_poll_events(), vmxnet3_poll_rx(), vmxnet3_poll_tx(), vmxnet3_probe(), vmxnet3_refill_rx(), vmxnet3_remove(), vmxnet3_transmit(), vxge_close(), vxge_device_register(), vxge_irq(), vxge_open(), vxge_poll(), vxge_remove(), vxge_xmit(), xm_check_link(), xm_link_down(), yukon_init(), and yukon_mac_init().

                                          {
        return netdev->priv;
}
static struct settings* netdev_settings ( struct net_device netdev) [static, read]
static void netdev_settings_init ( struct net_device netdev) [inline, static]

Initialise a per-netdevice configuration settings block.

Parameters:
genericsGeneric settings block
refcntContaining object reference counter, or NULL
nameSettings block name

Definition at line 589 of file netdevice.h.

References generic_settings_init(), and netdev_settings_operations.

Referenced by alloc_netdev().

static struct net_device_configuration* netdev_configuration ( struct net_device netdev,
struct net_device_configurator configurator 
) [static, read]

Get network device configuration.

Parameters:
netdevNetwork device
configuratorNetwork device configurator
Return values:
configNetwork device configuration

Definition at line 602 of file netdevice.h.

References net_device::configs, NET_DEVICE_CONFIGURATORS, and table_index.

Referenced by ifconf_progress(), and netdev_configure().

                                                                      {

        return &netdev->configs[ table_index ( NET_DEVICE_CONFIGURATORS,
                                               configurator ) ];
}
static int netdev_configurator_applies ( struct net_device netdev,
struct net_device_configurator configurator 
) [inline, static]

Check if configurator applies to network device.

Parameters:
netdevNetwork device
configuratorNetwork device configurator
Return values:
appliesConfigurator applies to network device

Definition at line 617 of file netdevice.h.

References net_device_configurator::applies, and NULL.

Referenced by netdev_configure(), and netdev_configure_all().

                                                                             {
        return ( ( configurator->applies == NULL ) ||
                 configurator->applies ( netdev ) );
}
static int netdev_link_ok ( struct net_device netdev) [inline, static]
static int netdev_link_blocked ( struct net_device netdev) [inline, static]

Check link block state of network device.

Parameters:
netdevNetwork device
Return values:
link_blockedLink is blocked

Definition at line 641 of file netdevice.h.

Referenced by dhcp_discovery_expired(), ifstat(), netdev_link_block(), netdev_link_unblock(), and stp_rx().

                                                  {
        return ( timer_running ( &netdev->link_block ) );
}
static int netdev_is_open ( struct net_device netdev) [inline, static]
static int netdev_irq_supported ( struct net_device netdev) [inline, static]

Check whether or not network device supports interrupts.

Parameters:
netdevNetwork device
Return values:
irq_supportedNetwork device supports interrupts

Definition at line 663 of file netdevice.h.

References NETDEV_IRQ_UNSUPPORTED, and NULL.

Referenced by netdev_irq(), pxe_exec(), pxenv_undi_get_iface_info(), pxenv_undi_get_information(), and vlan_create().

                                                   {
        return ( ( netdev->op->irq != NULL ) &&
                 ! ( netdev->state & NETDEV_IRQ_UNSUPPORTED ) );
}
static int netdev_irq_enabled ( struct net_device netdev) [inline, static]

Check whether or not network device interrupts are currently enabled.

Parameters:
netdevNetwork device
Return values:
irq_enabledNetwork device interrupts are enabled

Definition at line 675 of file netdevice.h.

References NETDEV_IRQ_ENABLED.

Referenced by pxenv_undi_isr().

                                                 {
        return ( netdev->state & NETDEV_IRQ_ENABLED );
}
static int netdev_rx_frozen ( struct net_device netdev) [inline, static]

Check whether or not network device receive queue processing is frozen.

Parameters:
netdevNetwork device
Return values:
rx_frozenNetwork device receive queue processing is frozen

Definition at line 686 of file netdevice.h.

References NETDEV_RX_FROZEN.

Referenced by net_poll(), and pxenv_undi_transmit().

                                               {
        return ( netdev->state & NETDEV_RX_FROZEN );
}
void netdev_rx_freeze ( struct net_device netdev)

Freeze network device receive queue processing.

Parameters:
netdevNetwork device

Definition at line 134 of file netdevice.c.

References netdev_notify(), NETDEV_RX_FROZEN, and net_device::state.

Referenced by pxe_netdev_open(), and pxenv_undi_transmit().

                                                    {

        /* Mark receive queue processing as frozen */
        netdev->state |= NETDEV_RX_FROZEN;

        /* Notify drivers of change */
        netdev_notify ( netdev );
}
void netdev_rx_unfreeze ( struct net_device netdev)

Unfreeze network device receive queue processing.

Parameters:
netdevNetwork device

Definition at line 148 of file netdevice.c.

References netdev_notify(), NETDEV_RX_FROZEN, and net_device::state.

Referenced by pxe_netdev_close(), and pxe_set_netdev().

                                                      {

        /* Mark receive queue processing as not frozen */
        netdev->state &= ~NETDEV_RX_FROZEN;

        /* Notify drivers of change */
        netdev_notify ( netdev );
}
void netdev_link_err ( struct net_device netdev,
int  rc 
)

Mark network device as having a specific link state.

Parameters:
netdevNetwork device
rcLink status code

Definition at line 163 of file netdevice.c.

References DBGC, net_device::link_block, net_device::link_rc, net_device::name, netdev_notify(), rc, stop_timer(), and strerror().

Referenced by eoib_join_complete(), eoib_link_state_changed(), 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().

                                                           {

        /* Stop link block timer */
        stop_timer ( &netdev->link_block );

        /* Record link state */
        netdev->link_rc = rc;
        if ( netdev->link_rc == 0 ) {
                DBGC ( netdev, "NETDEV %s link is up\n", netdev->name );
        } else {
                DBGC ( netdev, "NETDEV %s link is down: %s\n",
                       netdev->name, strerror ( netdev->link_rc ) );
        }

        /* Notify drivers of link state change */
        netdev_notify ( netdev );
}
void netdev_link_down ( struct net_device netdev)
void netdev_link_block ( struct net_device netdev,
unsigned long  timeout 
)

Mark network device link as being blocked.

Parameters:
netdevNetwork device
timeoutTimeout (in ticks)

Definition at line 203 of file netdevice.c.

References DBGC, net_device::link_block, net_device::name, netdev_link_blocked(), and start_timer_fixed().

Referenced by stp_rx().

                                                                            {

        /* Start link block timer */
        if ( ! netdev_link_blocked ( netdev ) ) {
                DBGC ( netdev, "NETDEV %s link blocked for %ld ticks\n",
                       netdev->name, timeout );
        }
        start_timer_fixed ( &netdev->link_block, timeout );
}
void netdev_link_unblock ( struct net_device netdev)

Mark network device link as being unblocked.

Parameters:
netdevNetwork device

Definition at line 218 of file netdevice.c.

References DBGC, net_device::link_block, net_device::name, netdev_link_blocked(), and stop_timer().

Referenced by stp_rx().

                                                       {

        /* Stop link block timer */
        if ( netdev_link_blocked ( netdev ) )
                DBGC ( netdev, "NETDEV %s link unblocked\n", netdev->name );
        stop_timer ( &netdev->link_block );
}
int netdev_tx ( struct net_device netdev,
struct io_buffer iobuf 
)

Transmit raw packet via network device.

Parameters:
netdevNetwork device
iobufI/O buffer
Return values:
rcReturn status code

Transmits the packet via the specified network device. This function takes ownership of the I/O buffer.

Definition at line 290 of file netdevice.c.

References io_buffer::data, DBGC2, ENETUNREACH, iob_len(), io_buffer::list, list_add_tail, net_device::name, NETDEV_DISCARD_RATE, netdev_is_open(), netdev_tx_complete_err(), net_device::op, profile_start(), profile_stop(), rc, 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().

                                                                     {
        int rc;

        DBGC2 ( netdev, "NETDEV %s transmitting %p (%p+%zx)\n",
                netdev->name, iobuf, iobuf->data, iob_len ( iobuf ) );
        profile_start ( &net_tx_profiler );

        /* Enqueue packet */
        list_add_tail ( &iobuf->list, &netdev->tx_queue );

        /* Avoid calling transmit() on unopened network devices */
        if ( ! netdev_is_open ( netdev ) ) {
                rc = -ENETUNREACH;
                goto err;
        }

        /* Discard packet (for test purposes) if applicable */
        if ( ( rc = inject_fault ( NETDEV_DISCARD_RATE ) ) != 0 )
                goto err;

        /* Transmit packet */
        if ( ( rc = netdev->op->transmit ( netdev, iobuf ) ) != 0 )
                goto err;

        profile_stop ( &net_tx_profiler );
        return 0;

 err:
        netdev_tx_complete_err ( netdev, iobuf, rc );
        return rc;
}
void netdev_tx_defer ( struct net_device netdev,
struct io_buffer iobuf 
)

Defer transmitted packet.

Parameters:
netdevNetwork device
iobufI/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).

Definition at line 344 of file netdevice.c.

References ENOBUFS, io_buffer::list, list_add_tail, list_check_contains_entry, list_del, netdev_tx_err(), NULL, net_device::tx_deferred, and net_device::tx_queue.

Referenced by nii_transmit(), realtek_transmit(), rndis_tx_defer(), and snpnet_transmit().

                                                                            {

        /* Catch data corruption as early as possible */
        list_check_contains_entry ( iobuf, &netdev->tx_queue, list );

        /* Remove from transmit queue */
        list_del ( &iobuf->list );

        /* Add to deferred transmit queue */
        list_add_tail ( &iobuf->list, &netdev->tx_deferred );

        /* Record "out of space" statistic */
        netdev_tx_err ( netdev, NULL, -ENOBUFS );
}
void netdev_tx_err ( struct net_device netdev,
struct io_buffer iobuf,
int  rc 
)

Discard transmitted packet.

Parameters:
netdevNetwork device
iobufI/O buffer, or NULL
rcPacket status code

The packet is discarded and a TX error is recorded. This function takes ownership of the I/O buffer.

Definition at line 369 of file netdevice.c.

References DBGC, DBGC2, free_iob(), net_device::name, netdev_record_stat(), strerror(), and net_device::tx_stats.

Referenced by eoib_duplicate(), intel_poll(), neighbour_destroy(), net_tx(), netdev_tx_complete_err(), netdev_tx_defer(), rhine_poll(), rndis_tx_complete_err(), snpnet_poll_tx(), vmxnet3_poll_events(), and vmxnet3_poll_tx().

                                                       {

        /* Update statistics counter */
        netdev_record_stat ( &netdev->tx_stats, rc );
        if ( rc == 0 ) {
                DBGC2 ( netdev, "NETDEV %s transmission %p complete\n",
                        netdev->name, iobuf );
        } else {
                DBGC ( netdev, "NETDEV %s transmission %p failed: %s\n",
                       netdev->name, iobuf, strerror ( rc ) );
        }

        /* Discard packet */
        free_iob ( iobuf );
}
void netdev_tx_complete_err ( struct net_device netdev,
struct io_buffer iobuf,
int  rc 
)

Complete network transmission.

Parameters:
netdevNetwork device
iobufI/O buffer
rcPacket status code

The packet must currently be in the network device's TX queue.

Definition at line 395 of file netdevice.c.

References ECANCELED, io_buffer::list, list_check_contains_entry, list_del, list_first_entry, netdev_tx(), netdev_tx_err(), 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(), hermon_eth_complete_send(), ifec_tx_process(), ipoib_complete_send(), jme_free_tx_buffers(), jme_tx_clean(), 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().

                                                                {

        /* Catch data corruption as early as possible */
        list_check_contains_entry ( iobuf, &netdev->tx_queue, list );

        /* Dequeue and free I/O buffer */
        list_del ( &iobuf->list );
        netdev_tx_err ( netdev, iobuf, rc );

        /* Handle pending transmit queue */
        while ( ( iobuf = list_first_entry ( &netdev->tx_deferred,
                                             struct io_buffer, list ) ) ) {

                /* Remove from pending transmit queue */
                list_del ( &iobuf->list );

                /* When any transmit completion fails, cancel all
                 * pending transmissions.
                 */
                if ( rc != 0 ) {
                        netdev_tx_err ( netdev, iobuf, -ECANCELED );
                        continue;
                }

                /* Otherwise, attempt to transmit the first pending packet */
                netdev_tx ( netdev, iobuf );
                break;
        }
}
void netdev_tx_complete_next_err ( struct net_device netdev,
int  rc 
)

Complete network transmission.

Parameters:
netdevNetwork device
rcPacket status code

Completes the oldest outstanding packet in the TX queue.

Definition at line 434 of file netdevice.c.

References io_buffer::list, list_first_entry, netdev_tx_complete_err(), NULL, 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().

                                                                       {
        struct io_buffer *iobuf;

        if ( ( iobuf = list_first_entry ( &netdev->tx_queue, struct io_buffer,
                                          list ) ) != NULL ) {
                netdev_tx_complete_err ( netdev, iobuf, rc );
        }
}
void netdev_rx ( struct net_device netdev,
struct io_buffer iobuf 
)

Add packet to receive queue.

Parameters:
netdevNetwork device
iobufI/O buffer, or NULL

The packet is added to the network device's RX queue. This function takes ownership of the I/O buffer.

Definition at line 470 of file netdevice.c.

References io_buffer::data, DBGC2, iob_len(), io_buffer::list, list_add_tail, net_device::name, 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(), axge_in_complete(), b44_process_rx_packets(), dm96xx_in_complete(), ecm_in_complete(), efab_receive(), efx_hunt_receive(), eoib_complete_recv(), exanic_poll_rx(), flexboot_nodnic_eth_complete_recv(), hermon_eth_complete_recv(), ifec_rx_process(), igbvf_process_rx_packets(), intel_poll_rx(), ipoib_complete_recv(), jme_alloc_and_feed_iob(), legacy_poll(), 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(), 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_rx(), vmxnet3_poll_rx(), and vxge_hw_vpath_poll_rx().

                                                                      {
        int rc;

        DBGC2 ( netdev, "NETDEV %s received %p (%p+%zx)\n",
                netdev->name, iobuf, iobuf->data, iob_len ( iobuf ) );

        /* Discard packet (for test purposes) if applicable */
        if ( ( rc = inject_fault ( NETDEV_DISCARD_RATE ) ) != 0 ) {
                netdev_rx_err ( netdev, iobuf, rc );
                return;
        }

        /* Enqueue packet */
        list_add_tail ( &iobuf->list, &netdev->rx_queue );

        /* Update statistics counter */
        netdev_record_stat ( &netdev->rx_stats, 0 );
}
void netdev_rx_err ( struct net_device netdev,
struct io_buffer iobuf,
int  rc 
)

Discard received packet.

Parameters:
netdevNetwork device
iobufI/O buffer, or NULL
rcPacket 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.

Definition at line 501 of file netdevice.c.

References DBGC, free_iob(), net_device::name, netdev_record_stat(), 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(), 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(), hermon_eth_complete_recv(), ifec_rx_process(), igbvf_process_rx_packets(), intel_poll(), intel_poll_rx(), intelx_poll(), intelxvf_poll(), ipoib_complete_recv(), jme_process_receive(), 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(), 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(), vmxnet3_flush_rx(), vmxnet3_poll_events(), vmxnet3_poll_rx(), and vxge_hw_vpath_poll_rx().

                                                       {

        DBGC ( netdev, "NETDEV %s failed to receive %p: %s\n",
               netdev->name, iobuf, strerror ( rc ) );

        /* Discard packet */
        free_iob ( iobuf );

        /* Update statistics counter */
        netdev_record_stat ( &netdev->rx_stats, rc );
}
void netdev_poll ( struct net_device netdev)

Poll for completed and received packets on network device.

Parameters:
netdevNetwork 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 523 of file netdevice.c.

References netdev_is_open(), net_device::op, and net_device_operations::poll.

Referenced by efi_snp_poll(), gdbudp_recv(), iflinkwait(), net_poll(), and vlan_poll().

                                               {

        if ( netdev_is_open ( netdev ) )
                netdev->op->poll ( netdev );
}
struct io_buffer* netdev_rx_dequeue ( struct net_device netdev) [read]

Remove packet from device's receive queue.

Parameters:
netdevNetwork device
Return values:
iobufI/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 538 of file netdevice.c.

References io_buffer::list, list_del, list_first_entry, NULL, and net_device::rx_queue.

Referenced by efi_snp_poll(), gdbudp_recv(), net_poll(), netdev_rx_flush(), and pxenv_undi_isr().

                                                                   {
        struct io_buffer *iobuf;

        iobuf = list_first_entry ( &netdev->rx_queue, struct io_buffer, list );
        if ( ! iobuf )
                return NULL;

        list_del ( &iobuf->list );
        return iobuf;
}
struct net_device* alloc_netdev ( size_t  priv_len) [read]

Allocate network device.

Parameters:
priv_lenLength of private data area (net_device::priv)
Return values:
netdevNetwork device, or NULL

Allocates space for a network device and its private data area.

Definition at line 622 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_link_block_expired(), netdev_settings_init(), net_device::priv, net_device_configuration::rc, ref_init, net_device::refcnt, net_device::rx_queue, table_num_entries, net_device::tx_deferred, net_device::tx_queue, and zalloc().

Referenced by alloc_etherdev(), alloc_ipoibdev(), net80211_alloc(), and nii_start().

                                                     {
        struct net_device *netdev;
        struct net_device_configurator *configurator;
        struct net_device_configuration *config;
        unsigned int num_configs;
        size_t confs_len;
        size_t total_len;

        num_configs = table_num_entries ( NET_DEVICE_CONFIGURATORS );
        confs_len = ( num_configs * sizeof ( netdev->configs[0] ) );
        total_len = ( sizeof ( *netdev ) + confs_len + priv_len );
        netdev = zalloc ( total_len );
        if ( netdev ) {
                ref_init ( &netdev->refcnt, free_netdev );
                netdev->link_rc = -EUNKNOWN_LINK_STATUS;
                timer_init ( &netdev->link_block, netdev_link_block_expired,
                             &netdev->refcnt );
                INIT_LIST_HEAD ( &netdev->tx_queue );
                INIT_LIST_HEAD ( &netdev->tx_deferred );
                INIT_LIST_HEAD ( &netdev->rx_queue );
                netdev_settings_init ( netdev );
                config = netdev->configs;
                for_each_table_entry ( configurator, NET_DEVICE_CONFIGURATORS ){
                        config->netdev = netdev;
                        config->configurator = configurator;
                        config->rc = -EUNUSED_CONFIG;
                        intf_init ( &config->job, &netdev_config_desc,
                                    &netdev->refcnt );
                        config++;
                }
                netdev->priv = ( ( ( void * ) netdev ) + sizeof ( *netdev ) +
                                 confs_len );
        }
        return netdev;
}
int register_netdev ( struct net_device netdev)

Register network device.

Parameters:
netdevNetwork device
Return values:
rcReturn status code

Gives the network device a name and adds it to the list of network devices.

Definition at line 667 of file netdevice.c.

References clear_settings(), DBGC, net_device::dev, EEXIST, find_netdev(), find_netdev_by_ll_addr(), for_each_table_entry, for_each_table_entry_continue_reverse, net_device::hw_addr, net_device::index, 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_DRIVERS, netdev_addr(), netdev_get(), netdev_has_ll_addr(), netdev_index, netdev_put(), netdev_settings(), NULL, net_driver::probe, rand(), rc, register_settings(), net_driver::remove, snprintf(), srand(), strerror(), and unregister_settings().

Referenced by a3c90x_probe(), atl1e_probe(), axge_probe(), b44_probe(), dm96xx_probe(), ecm_probe(), efab_probe(), eoib_create(), exanic_probe_port(), flexboot_nodnic_register_netdev(), forcedeth_probe(), hermon_register_netdev(), hunt_probe(), ifec_pci_probe(), igbvf_probe(), intel_probe(), intelx_probe(), intelxvf_probe(), ipoib_probe(), jme_probe(), lan78xx_probe(), legacy_probe(), myri10ge_pci_probe(), myson_probe(), natsemi_probe(), ncm_probe(), net80211_register(), netfront_probe(), nii_start(), pcnet32_probe(), phantom_probe(), pnic_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().

                                                  {
        struct ll_protocol *ll_protocol = netdev->ll_protocol;
        struct net_driver *driver;
        struct net_device *duplicate;
        uint32_t seed;
        int rc;

        /* Set initial link-layer address, if not already set */
        if ( ! netdev_has_ll_addr ( netdev ) ) {
                ll_protocol->init_addr ( netdev->hw_addr, netdev->ll_addr );
        }

        /* Set MTU, if not already set */
        if ( ! netdev->mtu ) {
                netdev->mtu = ( netdev->max_pkt_len -
                                ll_protocol->ll_header_len );
        }

        /* Reject network devices that are already available via a
         * different hardware device.
         */
        duplicate = find_netdev_by_ll_addr ( ll_protocol, netdev->ll_addr );
        if ( duplicate && ( duplicate->dev != netdev->dev ) ) {
                DBGC ( netdev, "NETDEV rejecting duplicate (phys %s) of %s "
                       "(phys %s)\n", netdev->dev->name, duplicate->name,
                       duplicate->dev->name );
                rc = -EEXIST;
                goto err_duplicate;
        }

        /* Reject named network devices that already exist */
        if ( netdev->name[0] && ( duplicate = find_netdev ( netdev->name ) ) ) {
                DBGC ( netdev, "NETDEV rejecting duplicate name %s\n",
                       duplicate->name );
                rc = -EEXIST;
                goto err_duplicate;
        }

        /* Record device index and create device name */
        if ( netdev->name[0] == '\0' ) {
                snprintf ( netdev->name, sizeof ( netdev->name ), "net%d",
                           netdev_index );
        }
        netdev->index = ++netdev_index;

        /* Use least significant bits of the link-layer address to
         * improve the randomness of the (non-cryptographic) random
         * number generator.
         */
        memcpy ( &seed, ( netdev->ll_addr + ll_protocol->ll_addr_len
                          - sizeof ( seed ) ), sizeof ( seed ) );
        srand ( rand() ^ seed );

        /* Add to device list */
        netdev_get ( netdev );
        list_add_tail ( &netdev->list, &net_devices );
        DBGC ( netdev, "NETDEV %s registered (phys %s hwaddr %s)\n",
               netdev->name, netdev->dev->name,
               netdev_addr ( netdev ) );

        /* Register per-netdev configuration settings */
        if ( ( rc = register_settings ( netdev_settings ( netdev ),
                                        NULL, netdev->name ) ) != 0 ) {
                DBGC ( netdev, "NETDEV %s could not register settings: %s\n",
                       netdev->name, strerror ( rc ) );
                goto err_register_settings;
        }

        /* Probe device */
        for_each_table_entry ( driver, NET_DRIVERS ) {
                if ( driver->probe && ( rc = driver->probe ( netdev ) ) != 0 ) {
                        DBGC ( netdev, "NETDEV %s could not add %s device: "
                               "%s\n", netdev->name, driver->name,
                               strerror ( rc ) );
                        goto err_probe;
                }
        }

        return 0;

 err_probe:
        for_each_table_entry_continue_reverse ( driver, NET_DRIVERS ) {
                if ( driver->remove )
                        driver->remove ( netdev );
        }
        clear_settings ( netdev_settings ( netdev ) );
        unregister_settings ( netdev_settings ( netdev ) );
 err_register_settings:
        list_del ( &netdev->list );
        netdev_put ( netdev );
 err_duplicate:
        return rc;
}
int netdev_open ( struct net_device netdev)

Open network device.

Parameters:
netdevNetwork device
Return values:
rcReturn status code

Definition at line 767 of file netdevice.c.

References DBGC, list_add, net_device::name, netdev_notify(), NETDEV_OPEN, net_device::op, net_device_operations::open, net_device::open_list, rc, and net_device::state.

Referenced by apply_netdev_settings(), 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().

                                              {
        int rc;

        /* Do nothing if device is already open */
        if ( netdev->state & NETDEV_OPEN )
                return 0;

        DBGC ( netdev, "NETDEV %s opening\n", netdev->name );

        /* Mark as opened */
        netdev->state |= NETDEV_OPEN;

        /* Open the device */
        if ( ( rc = netdev->op->open ( netdev ) ) != 0 )
                goto err;

        /* Add to head of open devices list */
        list_add ( &netdev->open_list, &open_net_devices );

        /* Notify drivers of device state change */
        netdev_notify ( netdev );

        return 0;

 err:
        netdev->state &= ~NETDEV_OPEN;
        return rc;
}
void netdev_close ( struct net_device netdev)

Close network device.

Parameters:
netdevNetwork device

Definition at line 801 of file netdevice.c.

References net_device_operations::close, net_device::configs, DBGC, ECANCELED, intf_close(), net_device_configuration::job, list_del, net_device::name, NET_DEVICE_CONFIGURATORS, netdev_notify(), NETDEV_OPEN, netdev_rx_flush(), netdev_tx_flush(), net_device::op, net_device::open_list, net_device::state, and table_num_entries.

Referenced by apply_netdev_settings(), efi_snp_reset(), efi_snp_shutdown(), ifclose(), ifconf_payload(), iwlist(), netvsc_reset(), pxe_netdev_close(), unregister_netdev(), vlan_close(), vlan_sync(), and xve_close().

                                                {
        unsigned int num_configs;
        unsigned int i;

        /* Do nothing if device is already closed */
        if ( ! ( netdev->state & NETDEV_OPEN ) )
                return;

        DBGC ( netdev, "NETDEV %s closing\n", netdev->name );

        /* Terminate any ongoing configurations.  Use intf_close()
         * rather than intf_restart() to allow the cancellation to be
         * reported back to us if a configuration is actually in
         * progress.
         */
        num_configs = table_num_entries ( NET_DEVICE_CONFIGURATORS );
        for ( i = 0 ; i < num_configs ; i++ )
                intf_close ( &netdev->configs[i].job, -ECANCELED );

        /* Remove from open devices list */
        list_del ( &netdev->open_list );

        /* Mark as closed */
        netdev->state &= ~NETDEV_OPEN;

        /* Notify drivers of device state change */
        netdev_notify ( netdev );

        /* Close the device */
        netdev->op->close ( netdev );

        /* Flush TX and RX queues */
        netdev_tx_flush ( netdev );
        netdev_rx_flush ( netdev );
}
void unregister_netdev ( struct net_device netdev)

Unregister network device.

Parameters:
netdevNetwork device

Removes the network device from the list of network devices.

Definition at line 844 of file netdevice.c.

References clear_settings(), DBGC, for_each_table_entry_reverse, net_device::list, list_del, list_empty, net_device::name, NET_DRIVERS, netdev_close(), netdev_index, netdev_put(), netdev_settings(), net_driver::remove, and unregister_settings().

Referenced by a3c90x_remove(), atl1e_remove(), axge_probe(), axge_remove(), b44_remove(), dm96xx_probe(), dm96xx_remove(), ecm_probe(), ecm_remove(), efab_probe(), efab_remove(), eoib_create(), eoib_destroy(), exanic_probe_port(), exanic_remove_port(), flexboot_nodnic_unregister_netdev(), forcedeth_remove(), hermon_register_netdev(), hermon_unregister_netdev(), hunt_remove(), ifec_pci_remove(), igbvf_remove(), intel_probe(), intel_remove(), intelx_probe(), intelx_remove(), intelxvf_probe(), intelxvf_remove(), ipoib_probe(), ipoib_remove(), jme_remove(), lan78xx_probe(), lan78xx_remove(), legacy_remove(), 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(), 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().

                                                     {
        struct net_driver *driver;

        /* Ensure device is closed */
        netdev_close ( netdev );

        /* Remove device */
        for_each_table_entry_reverse ( driver, NET_DRIVERS ) {
                if ( driver->remove )
                        driver->remove ( netdev );
        }

        /* Unregister per-netdev configuration settings */
        clear_settings ( netdev_settings ( netdev ) );
        unregister_settings ( netdev_settings ( netdev ) );

        /* Remove from device list */
        DBGC ( netdev, "NETDEV %s unregistered\n", netdev->name );
        list_del ( &netdev->list );
        netdev_put ( netdev );

        /* Reset network device index if no devices remain */
        if ( list_empty ( &net_devices ) )
                netdev_index = 0;
}
void netdev_irq ( struct net_device netdev,
int  enable 
)

Enable or disable interrupts.

Parameters:
netdevNetwork device
enableInterrupts should be enabled

Definition at line 875 of file netdevice.c.

References net_device_operations::irq, 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().

                                                          {

        /* Do nothing if device does not support interrupts */
        if ( ! netdev_irq_supported ( netdev ) )
                return;

        /* Enable or disable device interrupts */
        netdev->op->irq ( netdev, enable );

        /* Record interrupt enabled state */
        netdev->state &= ~NETDEV_IRQ_ENABLED;
        if ( enable )
                netdev->state |= NETDEV_IRQ_ENABLED;
}
struct net_device* find_netdev ( const char *  name) [read]

Get network device by name.

Parameters:
nameNetwork device name
Return values:
netdevNetwork device, or NULL

Definition at line 896 of file netdevice.c.

References last_opened_netdev(), net_device::list, list_for_each_entry, net_device::name, netdev, NULL, and strcmp().

Referenced by gdbudp_configure(), ipv6_sock_aton(), parse_netdev(), and register_netdev().

                                                     {
        struct net_device *netdev;

        /* Allow "netX" shortcut */
        if ( strcmp ( name, "netX" ) == 0 )
                return last_opened_netdev();

        /* Identify network device by name */
        list_for_each_entry ( netdev, &net_devices, list ) {
                if ( strcmp ( netdev->name, name ) == 0 )
                        return netdev;
        }

        return NULL;
}
struct net_device* find_netdev_by_index ( unsigned int  index) [read]

Get network device by index.

Parameters:
indexNetwork device index
Return values:
netdevNetwork device, or NULL

Definition at line 918 of file netdevice.c.

References net_device::index, net_device::list, list_for_each_entry, netdev, and NULL.

Referenced by ipv6_sock_ntoa().

                                                                {
        struct net_device *netdev;

        /* Identify network device by index */
        list_for_each_entry ( netdev, &net_devices, list ) {
                if ( netdev->index == index )
                        return netdev;
        }

        return NULL;
}
struct net_device* find_netdev_by_location ( unsigned int  bus_type,
unsigned int  location 
) [read]

Get network device by PCI bus:dev.fn address.

Parameters:
bus_typeBus type
locationBus location
Return values:
netdevNetwork device, or NULL

Definition at line 937 of file netdevice.c.

References device_description::bus_type, device::desc, net_device::dev, net_device::list, list_for_each_entry, device_description::location, netdev, and NULL.

Referenced by pxenv_start_undi().

                                                                      {
        struct net_device *netdev;

        list_for_each_entry ( netdev, &net_devices, list ) {
                if ( ( netdev->dev->desc.bus_type == bus_type ) &&
                     ( netdev->dev->desc.location == location ) )
                        return netdev;
        }

        return NULL;    
}
struct net_device* find_netdev_by_ll_addr ( struct ll_protocol ll_protocol,
const void *  ll_addr 
) [read]

Get network device by link-layer address.

Parameters:
ll_protocolLink-layer protocol
ll_addrLink-layer address
Return values:
netdevNetwork device, or NULL

Definition at line 957 of file netdevice.c.

References net_device::list, list_for_each_entry, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_protocol, memcmp(), netdev, and NULL.

Referenced by register_netdev().

                                                                   {
        struct net_device *netdev;

        list_for_each_entry ( netdev, &net_devices, list ) {
                if ( ( netdev->ll_protocol == ll_protocol ) &&
                     ( memcmp ( netdev->ll_addr, ll_addr,
                                ll_protocol->ll_addr_len ) == 0 ) )
                        return netdev;
        }

        return NULL;
}
struct net_device* last_opened_netdev ( void  ) [read]

Get most recently opened network device.

Return values:
netdevMost recently opened network device, or NULL

Definition at line 976 of file netdevice.c.

References assert, list_first_entry, netdev, netdev_is_open(), NULL, and net_device::open_list.

Referenced by aoe_open(), find_netdev(), ipv6_sock_aton(), last_opened_snpdev(), nbi_prepare_dhcp(), netdev_redirect(), and pxe_exec().

                                                {
        struct net_device *netdev;

        netdev = list_first_entry ( &open_net_devices, struct net_device,
                                    open_list );
        if ( ! netdev )
                return NULL;

        assert ( netdev_is_open ( netdev ) );
        return netdev;
}
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.

Parameters:
iobufI/O buffer
netdevNetwork device
net_protocolNetwork-layer protocol
ll_destDestination link-layer address
ll_sourceSource link-layer address
Return values:
rcReturn 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 1002 of file netdevice.c.

References net_device::ll_protocol, net_protocol::net_proto, netdev_tx(), netdev_tx_err(), ll_protocol::push, and rc.

Referenced by aoecmd_tx(), arp_rx(), arp_tx_request(), 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().

                                     {
        struct ll_protocol *ll_protocol = netdev->ll_protocol;
        int rc;

        /* Add link-layer header */
        if ( ( rc = ll_protocol->push ( netdev, iobuf, ll_dest, ll_source,
                                        net_protocol->net_proto ) ) != 0 ) {
                /* Record error for diagnosis */
                netdev_tx_err ( netdev, iobuf, rc );
                return rc;
        }

        /* Transmit packet */
        return netdev_tx ( netdev, iobuf );
}
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.

Parameters:
iobufI/O buffer
netdevNetwork device
net_protoNetwork-layer protocol, in network-byte order
ll_destDestination link-layer address
ll_sourceSource link-layer address
flagsPacket flags
Return values:
rcReturn status code

Definition at line 1031 of file netdevice.c.

References DBGC, ENOTSUP, for_each_table_entry, free_iob(), net_device::name, net_protocol::net_proto, NET_PROTOCOLS, ntohs, and net_protocol::rx.

Referenced by net_poll().

                                  {
        struct net_protocol *net_protocol;

        /* Hand off to network-layer protocol, if any */
        for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
                if ( net_protocol->net_proto == net_proto )
                        return net_protocol->rx ( iobuf, netdev, ll_dest,
                                                  ll_source, flags );
        }

        DBGC ( netdev, "NETDEV %s unknown network protocol %04x\n",
               netdev->name, ntohs ( net_proto ) );
        free_iob ( iobuf );
        return -ENOTSUP;
}
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 1055 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_proto, 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 *netdev;
        struct io_buffer *iobuf;
        struct ll_protocol *ll_protocol;
        const void *ll_dest;
        const void *ll_source;
        uint16_t net_proto;
        unsigned int flags;
        int rc;

        /* Poll and process each network device */
        list_for_each_entry ( netdev, &net_devices, list ) {

                /* Poll for new packets */
                profile_start ( &net_poll_profiler );
                netdev_poll ( netdev );
                profile_stop ( &net_poll_profiler );

                /* Leave received packets on the queue if receive
                 * queue processing is currently frozen.  This will
                 * happen when the raw packets are to be manually
                 * dequeued using netdev_rx_dequeue(), rather than
                 * processed via the usual networking stack.
                 */
                if ( netdev_rx_frozen ( netdev ) )
                        continue;

                /* Process all received packets */
                while ( ( iobuf = netdev_rx_dequeue ( netdev ) ) ) {

                        DBGC2 ( netdev, "NETDEV %s processing %p (%p+%zx)\n",
                                netdev->name, iobuf, iobuf->data,
                                iob_len ( iobuf ) );
                        profile_start ( &net_rx_profiler );

                        /* Remove link-layer header */
                        ll_protocol = netdev->ll_protocol;
                        if ( ( rc = ll_protocol->pull ( netdev, iobuf,
                                                        &ll_dest, &ll_source,
                                                        &net_proto,
                                                        &flags ) ) != 0 ) {
                                free_iob ( iobuf );
                                continue;
                        }

                        /* Hand packet to network layer */
                        if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
                                             net_proto, ll_dest,
                                             ll_source, flags ) ) != 0 ) {
                                /* Record error for diagnosis */
                                netdev_rx_err ( netdev, NULL, rc );
                        }
                        profile_stop ( &net_rx_profiler );
                }
        }
}
struct net_device_configurator* find_netdev_configurator ( const char *  name) [read]

Find network device configurator.

Parameters:
nameName
Return values:
configuratorNetwork device configurator, or NULL

Definition at line 1185 of file netdevice.c.

References for_each_table_entry, net_device_configurator::name, NET_DEVICE_CONFIGURATORS, NULL, and strcmp().

Referenced by parse_netdev_configurator().

                                                                               {
        struct net_device_configurator *configurator;

        for_each_table_entry ( configurator, NET_DEVICE_CONFIGURATORS ) {
                if ( strcmp ( configurator->name, name ) == 0 )
                        return configurator;
        }
        return NULL;
}
int netdev_configure ( struct net_device netdev,
struct net_device_configurator configurator 
)

Start network device configuration.

Parameters:
netdevNetwork device
configuratorNetwork device configurator
Return values:
rcReturn status code

Definition at line 1202 of file netdevice.c.

References DBGC, ECANCELED, EINPROGRESS_CONFIG, ENOTSUP, intf_restart(), net_device_configuration::job, net_device_configurator::name, net_device::name, netdev_configuration(), netdev_configurator_applies(), net_device_configuration::rc, rc, net_device_configurator::start, and strerror().

Referenced by ifconf(), and netdev_configure_all().

                                                                      {
        struct net_device_configuration *config =
                netdev_configuration ( netdev, configurator );
        int rc;

        /* Check applicability of configurator */
        if ( ! netdev_configurator_applies ( netdev, configurator ) ) {
                DBGC ( netdev, "NETDEV %s does not support configuration via "
                       "%s\n", netdev->name, configurator->name );
                return -ENOTSUP;
        }

        /* Terminate any ongoing configuration */
        intf_restart ( &config->job, -ECANCELED );

        /* Mark configuration as being in progress */
        config->rc = -EINPROGRESS_CONFIG;

        DBGC ( netdev, "NETDEV %s starting configuration via %s\n",
               netdev->name, configurator->name );

        /* Start configuration */
        if ( ( rc = configurator->start ( &config->job, netdev ) ) != 0 ) {
                DBGC ( netdev, "NETDEV %s could not start configuration via "
                       "%s: %s\n", netdev->name, configurator->name,
                       strerror ( rc ) );
                config->rc = rc;
                return rc;
        }

        return 0;
}
int netdev_configure_all ( struct net_device netdev)

Start network device configuration via all supported configurators.

Parameters:
netdevNetwork device
Return values:
rcReturn status code

Definition at line 1242 of file netdevice.c.

References for_each_table_entry, NET_DEVICE_CONFIGURATORS, netdev_configurator_applies(), netdev_configure(), and rc.

Referenced by efi_pxe_dhcp(), and ifconf().

                                                       {
        struct net_device_configurator *configurator;
        int rc;

        /* Start configuration for each configurator */
        for_each_table_entry ( configurator, NET_DEVICE_CONFIGURATORS ) {

                /* Skip any inapplicable configurators */
                if ( ! netdev_configurator_applies ( netdev, configurator ) )
                        continue;

                /* Start configuration */
                if ( ( rc = netdev_configure ( netdev, configurator ) ) != 0 )
                        return rc;
        }

        return 0;
}
int netdev_configuration_in_progress ( struct net_device netdev)

Check if network device configuration is in progress.

Parameters:
netdevNetwork device
Return values:
is_in_progressNetwork device configuration is in progress

Definition at line 1286 of file netdevice.c.

References EINPROGRESS_CONFIG, 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.

Parameters:
netdevNetwork device
configuratorConfigurator
Return values:
rcReturn status code

Definition at line 1298 of file netdevice.c.

References netdev_has_configuration_rc().

Referenced by efi_pxe_dhcp(), and ifconf_progress().

                                                          {

        return netdev_has_configuration_rc ( netdev, 0 );
}
static void netdev_tx_complete ( struct net_device netdev,
struct io_buffer iobuf 
) [inline, static]
static void netdev_tx_complete_next ( struct net_device netdev) [inline, static]

Complete network transmission.

Parameters:
netdevNetwork device

Completes the oldest outstanding packet in the TX queue.

Definition at line 758 of file netdevice.h.

References netdev_tx_complete_next_err().

Referenced by exanic_poll_tx(), intel_poll_tx(), myson_poll_tx(), natsemi_poll_tx(), realtek_poll_tx(), rhine_poll_tx(), txnic_complete_sqe(), and velocity_poll_tx().

                                                                         {
        netdev_tx_complete_next_err ( netdev, 0 );
}
static void netdev_link_up ( struct net_device netdev) [inline, static]

Variable Documentation

List of network devices.

Definition at line 53 of file netdevice.c.

Referenced by have_netdevs().

Definition at line 59 of file nullnet.c.

Referenced by netdev_nullify().

Network device configuration settings operations.

Definition at line 358 of file netdev_settings.c.

Referenced by netdev_settings_init().