iPXE
|
Intel 10 Gigabit Ethernet network card driver. More...
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
#include <ipxe/if_ether.h>
#include <ipxe/iobuf.h>
#include <ipxe/pci.h>
#include "intelx.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | intelx_try_fetch_mac (struct intel_nic *intel, unsigned int ral0, uint8_t *hw_addr) |
Try to fetch initial MAC address. More... | |
static int | intelx_fetch_mac (struct intel_nic *intel, uint8_t *hw_addr) |
Fetch initial MAC address. More... | |
static int | intelx_reset (struct intel_nic *intel) |
Reset hardware. More... | |
static void | intelx_check_link (struct net_device *netdev) |
Check link state. More... | |
static int | intelx_open (struct net_device *netdev) |
Open network device. More... | |
static void | intelx_close (struct net_device *netdev) |
Close network device. More... | |
static void | intelx_poll (struct net_device *netdev) |
Poll for completed and received packets. More... | |
static void | intelx_irq (struct net_device *netdev, int enable) |
Enable or disable interrupts. More... | |
static int | intelx_probe (struct pci_device *pci) |
Probe PCI device. More... | |
static void | intelx_remove (struct pci_device *pci) |
Remove PCI device. More... | |
Variables | |
static struct net_device_operations | intelx_operations |
Network device operations. More... | |
static struct pci_device_id | intelx_nics [] |
PCI device IDs. More... | |
struct pci_driver intelx_driver | __pci_driver |
PCI driver. More... | |
Intel 10 Gigabit Ethernet network card driver.
Definition in file intelx.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Try to fetch initial MAC address.
intel | Intel device |
ral0 | RAL0 register address |
hw_addr | Hardware address to fill in |
rc | Return status code |
Definition at line 59 of file intelx.c.
References cpu_to_le32, DBGC, ENOENT, ETH_ALEN, eth_ntoa(), INTELX_RAH0, INTELX_RAL0, is_valid_ether_addr(), mac, memcpy(), readl(), and intel_nic::regs.
Referenced by intelx_fetch_mac().
Fetch initial MAC address.
intel | Intel device |
hw_addr | Hardware address to fill in |
rc | Return status code |
Definition at line 86 of file intelx.c.
References DBGC, ENOENT, INTELX_RAL0, INTELX_RAL0_ALT, intelx_try_fetch_mac(), and rc.
Referenced by intelx_probe().
|
static |
Reset hardware.
intel | Intel device |
rc | Return status code |
Definition at line 118 of file intelx.c.
References ctrl, DBGC, INTELX_CTRL, INTELX_CTRL_LRST, INTELX_CTRL_RST, INTELX_RESET_DELAY_MS, mdelay(), readl(), intel_nic::regs, and writel().
Referenced by intelx_close(), intelx_probe(), and intelx_remove().
|
static |
Check link state.
netdev | Network device |
Definition at line 143 of file intelx.c.
References DBGC, INTELX_LINKS, INTELX_LINKS_UP, netdev, netdev_link_down(), netdev_link_up(), net_device::priv, readl(), and intel_nic::regs.
Referenced by intelx_open(), intelx_poll(), and intelx_probe().
|
static |
Open network device.
netdev | Network device |
rc | Return status code |
Definition at line 172 of file intelx.c.
References intel_create_ring(), intel_destroy_ring(), intel_refill_rx(), intelx_check_link(), INTELX_DCA_RXCTRL, INTELX_DCA_RXCTRL_MUST_BE_ZERO, INTELX_DMATXCTL, INTELX_DMATXCTL_TE, INTELX_FCTRL, INTELX_FCTRL_BAM, INTELX_FCTRL_MPE, INTELX_FCTRL_UPE, INTELX_HLREG0, INTELX_HLREG0_JUMBOEN, INTELX_IVAR, INTELX_IVAR_RX0_DEFAULT, INTELX_IVAR_RX0_VALID, INTELX_IVAR_TX0_DEFAULT, INTELX_IVAR_TX0_VALID, INTELX_MAXFRS, INTELX_MAXFRS_MFS_DEFAULT, INTELX_MAXFRS_MFS_MASK, INTELX_RAH0, INTELX_RAH0_ALT, INTELX_RAH0_AV, INTELX_RAL0, INTELX_RAL0_ALT, INTELX_RDRXCTL, INTELX_RDRXCTL_SECRC, INTELX_RXCTRL, INTELX_RXCTRL_RXEN, INTELX_SRRCTL, INTELX_SRRCTL_BSIZE_DEFAULT, INTELX_SRRCTL_BSIZE_MASK, le32_to_cpu, net_device::ll_addr, mac, memcpy(), memset(), netdev, net_device::priv, rc, readl(), intel_nic::regs, intel_nic::rx, intel_nic::tx, and writel().
|
static |
Close network device.
netdev | Network device |
Definition at line 278 of file intelx.c.
References intel_destroy_ring(), intel_empty_rx(), INTELX_DMATXCTL, INTELX_DMATXCTL_TE, intelx_reset(), INTELX_RXCTRL, INTELX_RXCTRL_RXEN, netdev, net_device::priv, readl(), intel_nic::regs, intel_nic::rx, intel_nic::tx, and writel().
|
static |
Poll for completed and received packets.
netdev | Network device |
Definition at line 311 of file intelx.c.
References ENOBUFS, intel_poll_rx(), intel_poll_tx(), intel_refill_rx(), intelx_check_link(), INTELX_EICR, INTELX_EIRQ_LSC, INTELX_EIRQ_RX0, INTELX_EIRQ_RXO, INTELX_EIRQ_TX0, netdev, netdev_rx_err(), NULL, net_device::priv, readl(), and intel_nic::regs.
|
static |
Enable or disable interrupts.
netdev | Network device |
enable | Interrupts should be enabled |
Definition at line 346 of file intelx.c.
References INTELX_EIMC, INTELX_EIMS, INTELX_EIRQ_LSC, INTELX_EIRQ_RX0, INTELX_EIRQ_RXO, INTELX_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 381 of file intelx.c.
References adjust_pci_device(), alloc_etherdev(), pci_device::busdevfn, 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_BAR_SIZE, intel_describe_rx(), intel_describe_tx(), intel_init_ring(), INTEL_NUM_RX_DESC, INTEL_NUM_TX_DESC, intelx_check_link(), intelx_fetch_mac(), intelx_operations, INTELX_RD, intelx_reset(), INTELX_TD, iounmap(), pci_device::membase, memset(), netdev, netdev_init(), netdev_nullify(), netdev_put(), PCI_FUNC, pci_ioremap(), pci_set_drvdata(), intel_nic::port, net_device::priv, rc, register_netdev(), intel_nic::regs, intel_nic::rx, intel_nic::tx, and unregister_netdev().
|
static |
Remove PCI device.
pci | PCI device |
Definition at line 453 of file intelx.c.
References intelx_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 360 of file intelx.c.
Referenced by intelx_probe().
|
static |
PCI device IDs.
struct pci_driver intelx_driver __pci_driver |
PCI driver.