iPXE
|
Intel 10 Gigabit Ethernet virtual function network card driver. More...
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ipxe/io.h>
#include <ipxe/pci.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
#include "intelx.h"
#include "intelxvf.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | intelxvf_stats (struct intel_nic *intel) |
Dump statistics. More... | |
static void | intelxvf_reset (struct intel_nic *intel) |
Reset hardware. More... | |
static void | intelxvf_check_link (struct net_device *netdev) |
Check link state. More... | |
static int | intelxvf_mbox_version (struct intel_nic *intel, unsigned int version) |
Send negotiate API version message. More... | |
static int | intelxvf_mbox_queues (struct intel_nic *intel, int *vlan_thing) |
Get queue configuration. More... | |
static int | intelxvf_open (struct net_device *netdev) |
Open network device. More... | |
static void | intelxvf_close (struct net_device *netdev) |
Close network device. More... | |
static void | intelxvf_poll (struct net_device *netdev) |
Poll for completed and received packets. More... | |
static void | intelxvf_irq (struct net_device *netdev, int enable) |
Enable or disable interrupts. More... | |
static int | intelxvf_probe (struct pci_device *pci) |
Probe PCI device. More... | |
static void | intelxvf_remove (struct pci_device *pci) |
Remove PCI device. More... | |
Variables | |
static struct net_device_operations | intelxvf_operations |
Network device operations. More... | |
static struct pci_device_id | intelxvf_nics [] |
PCI device IDs. More... | |
struct pci_driver intelxvf_driver | __pci_driver |
PCI driver. More... | |
Intel 10 Gigabit Ethernet virtual function network card driver.
Definition in file intelxvf.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Dump statistics.
intel | Intel device |
Definition at line 55 of file intelxvf.c.
References DBGC, INTELXVF_GORCH, INTELXVF_GORCL, INTELXVF_GOTCH, INTELXVF_GOTCL, INTELXVF_GPRC, INTELXVF_GPTC, INTELXVF_MPRC, readl(), and intel_nic::regs.
|
static |
Reset hardware.
intel | Intel device |
Definition at line 79 of file intelxvf.c.
References INTELXVF_CTRL, INTELXVF_CTRL_RST, intel_nic::regs, and writel().
Referenced by intelxvf_close(), intelxvf_open(), intelxvf_probe(), and intelxvf_remove().
|
static |
Check link state.
netdev | Network device |
Definition at line 97 of file intelxvf.c.
References DBGC, INTELXVF_LINKS, INTELXVF_LINKS_UP, netdev, netdev_link_down(), netdev_link_up(), net_device::priv, readl(), and intel_nic::regs.
Referenced by intelxvf_open(), intelxvf_poll(), and intelxvf_probe().
|
static |
Send negotiate API version message.
intel | Intel device |
version | Requested version |
rc | Return status code |
Definition at line 127 of file intelxvf.c.
References DBGC, DBGC_HDA, EPERM, EPROTO, intelvf_mbox_msg(), INTELVF_MSG_ACK, INTELVF_MSG_TYPE_MASK, INTELXVF_MSG_TYPE_VERSION, memset(), msg(), rc, strerror(), and version.
Referenced by intelxvf_open().
|
static |
Get queue configuration.
intel | Intel device |
vlan_thing | VLAN hand-waving thing to fill in |
rc | Return status code |
Definition at line 167 of file intelxvf.c.
References DBGC, DBGC_HDA, EPERM, EPROTO, intelvf_mbox_msg(), INTELVF_MSG_ACK, INTELVF_MSG_TYPE_GET_QUEUES, INTELVF_MSG_TYPE_MASK, memset(), msg(), rc, and strerror().
Referenced by intelxvf_open().
|
static |
Open network device.
netdev | Network device |
rc | Return status code |
Definition at line 214 of file intelxvf.c.
References DBGC, intel_create_ring(), intel_destroy_ring(), intel_refill_rx(), intel_reset_ring(), INTEL_xDCTL, intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), INTELX_RXDCTL_VME, intelxvf_check_link(), INTELXVF_DCA_RXCTRL, INTELXVF_DCA_RXCTRL_MUST_BE_ZERO, INTELXVF_IVAR, INTELXVF_IVAR_RX0_DEFAULT, INTELXVF_IVAR_RX0_VALID, INTELXVF_IVAR_TX0_DEFAULT, INTELXVF_IVAR_TX0_VALID, INTELXVF_IVARM, INTELXVF_IVARM_MBOX_DEFAULT, INTELXVF_IVARM_MBOX_VALID, intelxvf_mbox_queues(), intelxvf_mbox_version(), INTELXVF_MSG_VERSION_1_1, INTELXVF_NUM_RINGS, INTELXVF_PSRTYPE, INTELXVF_RD, intelxvf_reset(), INTELXVF_SRRCTL, INTELXVF_SRRCTL_BHDRSIZE_DEFAULT, INTELXVF_SRRCTL_BHDRSIZE_MASK, INTELXVF_SRRCTL_BSIZE_DEFAULT, INTELXVF_SRRCTL_BSIZE_MASK, INTELXVF_SRRCTL_DESCTYPE_DEFAULT, INTELXVF_SRRCTL_DESCTYPE_MASK, INTELXVF_SRRCTL_DROP_EN, INTELXVF_TD, net_device::ll_addr, net_device::max_pkt_len, netdev, NULL, net_device::priv, rc, readl(), intel_nic::regs, intel_nic::rx, strerror(), intel_nic::tx, and writel().
|
static |
Close network device.
netdev | Network device |
Definition at line 336 of file intelxvf.c.
References intel_destroy_ring(), intel_empty_rx(), intelxvf_reset(), netdev, net_device::priv, intel_nic::rx, and intel_nic::tx.
|
static |
Poll for completed and received packets.
netdev | Network device |
Definition at line 357 of file intelxvf.c.
References DBGC, intel_poll_rx(), intel_poll_tx(), intel_refill_rx(), intelvf_mbox_poll(), intelxvf_check_link(), INTELXVF_EICR, INTELXVF_EIRQ_MBOX, INTELXVF_EIRQ_RX0, INTELXVF_EIRQ_TX0, netdev, netdev_rx_err(), NULL, net_device::priv, rc, readl(), and intel_nic::regs.
|
static |
Enable or disable interrupts.
netdev | Network device |
enable | Interrupts should be enabled |
Definition at line 399 of file intelxvf.c.
References INTELXVF_EIMC, INTELXVF_EIMS, INTELXVF_EIRQ_MBOX, INTELXVF_EIRQ_RX0, INTELXVF_EIRQ_TX0, netdev, net_device::priv, intel_nic::regs, and writel().
|
static |
Probe PCI device.
pci | PCI device |
rc | Return status code |
Definition at line 433 of file intelxvf.c.
References adjust_pci_device(), alloc_etherdev(), DBGC, pci_device::dev, net_device::dev, pci_device::dma, intel_nic::dma, net_device::dma, dma_set_mask_64bit(), ENODEV, ENOMEM, net_device::hw_addr, intel_describe_rx(), intel_describe_tx_adv(), intel_init_mbox(), intel_init_ring(), INTEL_NUM_RX_DESC, INTEL_NUM_TX_DESC, INTELVF_BAR_SIZE, intelvf_mbox_reset(), intelxvf_check_link(), INTELXVF_MBCTRL, INTELXVF_MBMEM, intelxvf_operations, INTELXVF_RD, intelxvf_reset(), INTELXVF_TD, iounmap(), intel_nic::mbox, pci_device::membase, memset(), netdev, netdev_init(), netdev_nullify(), netdev_put(), pci_ioremap(), pci_set_drvdata(), net_device::priv, rc, register_netdev(), intel_nic::regs, intel_nic::rx, strerror(), intel_nic::tx, and unregister_netdev().
|
static |
Remove PCI device.
pci | PCI device |
Definition at line 511 of file intelxvf.c.
References intelxvf_reset(), iounmap(), netdev, netdev_nullify(), netdev_put(), pci_get_drvdata(), net_device::priv, intel_nic::regs, and unregister_netdev().
|
static |
Network device operations.
Definition at line 412 of file intelxvf.c.
Referenced by intelxvf_probe().
|
static |
struct pci_driver intelxvf_driver __pci_driver |
PCI driver.
Definition at line 537 of file intelxvf.c.