iPXE
|
Intel 40 Gigabit Ethernet network card driver. More...
#include <stdint.h>
#include <string.h>
#include <stdio.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/vlan.h>
#include <ipxe/iobuf.h>
#include <ipxe/pci.h>
#include <ipxe/version.h>
#include "intelxl.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | intelxl_msix_enable (struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector) |
Enable MSI-X dummy interrupt. More... | |
void | intelxl_msix_disable (struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector) |
Disable MSI-X dummy interrupt. More... | |
static int | intelxl_alloc_admin (struct intelxl_nic *intelxl, struct intelxl_admin *admin) |
Allocate admin queue. More... | |
static void | intelxl_enable_admin (struct intelxl_nic *intelxl, struct intelxl_admin *admin) |
Enable admin queue. More... | |
static void | intelxl_disable_admin (struct intelxl_nic *intelxl, struct intelxl_admin *admin) |
Disable admin queue. More... | |
static void | intelxl_free_admin (struct intelxl_nic *intelxl __unused, struct intelxl_admin *admin) |
Free admin queue. More... | |
struct intelxl_admin_descriptor * | intelxl_admin_command_descriptor (struct intelxl_nic *intelxl) |
Get next admin command queue descriptor. More... | |
union intelxl_admin_buffer * | intelxl_admin_command_buffer (struct intelxl_nic *intelxl) |
Get next admin command queue data buffer. More... | |
static void | intelxl_admin_event_init (struct intelxl_nic *intelxl, unsigned int index) |
Initialise admin event queue descriptor. More... | |
int | intelxl_admin_command (struct intelxl_nic *intelxl) |
Issue admin queue command. More... | |
static int | intelxl_admin_version (struct intelxl_nic *intelxl) |
Get firmware version. More... | |
static int | intelxl_admin_driver (struct intelxl_nic *intelxl) |
Report driver version. More... | |
static int | intelxl_admin_shutdown (struct intelxl_nic *intelxl) |
Shutdown admin queues. More... | |
static int | intelxl_admin_mac_read (struct net_device *netdev) |
Get MAC address. More... | |
static int | intelxl_admin_mac_write (struct net_device *netdev) |
Set MAC address. More... | |
int | intelxl_admin_clear_pxe (struct intelxl_nic *intelxl) |
Clear PXE mode. More... | |
static int | intelxl_admin_switch (struct intelxl_nic *intelxl) |
Get switch configuration. More... | |
static int | intelxl_admin_vsi (struct intelxl_nic *intelxl) |
Get VSI parameters. More... | |
static int | intelxl_admin_promisc (struct intelxl_nic *intelxl) |
Set VSI promiscuous modes. More... | |
int | intelxl_admin_mac_config (struct intelxl_nic *intelxl) |
Set MAC configuration. More... | |
static int | intelxl_admin_autoneg (struct intelxl_nic *intelxl) |
Restart autonegotiation. More... | |
static int | intelxl_admin_link (struct net_device *netdev) |
Get link status. More... | |
static void | intelxl_admin_event (struct net_device *netdev, struct intelxl_admin_descriptor *evt, union intelxl_admin_buffer *buf __unused) |
Handle admin event. More... | |
static void | intelxl_refill_admin (struct intelxl_nic *intelxl) |
Refill admin event queue. More... | |
void | intelxl_poll_admin (struct net_device *netdev) |
Poll admin event queue. More... | |
int | intelxl_open_admin (struct intelxl_nic *intelxl) |
Open admin queues. More... | |
void | intelxl_reopen_admin (struct intelxl_nic *intelxl) |
Reopen admin queues (after virtual function reset) More... | |
void | intelxl_close_admin (struct intelxl_nic *intelxl) |
Close admin queues. More... | |
int | intelxl_alloc_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring) |
Allocate descriptor ring. More... | |
void | intelxl_free_ring (struct intelxl_nic *intelxl __unused, struct intelxl_ring *ring) |
Free descriptor ring. More... | |
static void | intelxl_context_dump (struct intelxl_nic *intelxl, uint32_t op, size_t len) |
Dump queue context (for debugging) More... | |
static int | intelxl_context_line (struct intelxl_nic *intelxl, struct intelxl_context_line *line, unsigned int index, uint32_t op) |
Program queue context line. More... | |
static int | intelxl_context (struct intelxl_nic *intelxl, struct intelxl_context_line *line, size_t len, uint32_t op) |
Program queue context. More... | |
static int | intelxl_context_tx (struct intelxl_nic *intelxl, physaddr_t address) |
Program transmit queue context. More... | |
static int | intelxl_context_rx (struct intelxl_nic *intelxl, physaddr_t address) |
Program receive queue context. More... | |
static int | intelxl_enable_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring) |
Enable descriptor ring. More... | |
static int | intelxl_disable_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring) |
Disable descriptor ring. More... | |
int | intelxl_create_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring) |
Create descriptor ring. More... | |
void | intelxl_destroy_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring) |
Destroy descriptor ring. More... | |
static void | intelxl_refill_rx (struct intelxl_nic *intelxl) |
Refill receive descriptor ring. More... | |
void | intelxl_empty_rx (struct intelxl_nic *intelxl) |
Discard unused receive I/O buffers. More... | |
static int | intelxl_open (struct net_device *netdev) |
Open network device. More... | |
static void | intelxl_close (struct net_device *netdev) |
Close network device. More... | |
int | intelxl_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
Transmit packet. More... | |
static void | intelxl_poll_tx (struct net_device *netdev) |
Poll for completed packets. More... | |
static void | intelxl_poll_rx (struct net_device *netdev) |
Poll for received packets. More... | |
void | intelxl_poll (struct net_device *netdev) |
Poll for completed and received packets. More... | |
static int | intelxl_probe (struct pci_device *pci) |
Probe PCI device. More... | |
static void | intelxl_remove (struct pci_device *pci) |
Remove PCI device. More... | |
Variables | |
const struct intelxl_admin_offsets | intelxl_admin_offsets |
Admin queue register offsets. More... | |
static struct net_device_operations | intelxl_operations |
Network device operations. More... | |
static struct pci_device_id | intelxl_nics [] |
PCI device IDs. More... | |
struct pci_driver intelxl_driver | __pci_driver |
PCI driver. More... | |
Intel 40 Gigabit Ethernet network card driver.
Definition in file intelxl.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int intelxl_msix_enable | ( | struct intelxl_nic * | intelxl, |
struct pci_device * | pci, | ||
unsigned int | vector | ||
) |
Enable MSI-X dummy interrupt.
intelxl | Intel device |
pci | PCI device |
vector | MSI-X vector |
rc | Return status code |
Definition at line 62 of file intelxl.c.
References intelxl_msix::cap, DBGC, dma(), intelxl_nic::dma, DMA_RX, dma_unmap(), intelxl_msix::map, intelxl_msix::msg, intelxl_nic::msix, pci_msix_disable(), pci_msix_enable(), pci_msix_map(), pci_msix_unmask(), rc, strerror(), vector, and virt_to_phys().
Referenced by ice_probe(), intelxl_probe(), and intelxlvf_probe().
void intelxl_msix_disable | ( | struct intelxl_nic * | intelxl, |
struct pci_device * | pci, | ||
unsigned int | vector | ||
) |
Disable MSI-X dummy interrupt.
intelxl | Intel device |
pci | PCI device |
vector | MSI-X vector |
Definition at line 105 of file intelxl.c.
References intelxl_msix::cap, dma_unmap(), intelxl_msix::map, intelxl_nic::msix, pci_msix_disable(), pci_msix_mask(), and vector.
Referenced by ice_probe(), ice_remove(), intelxl_probe(), intelxl_remove(), intelxlvf_probe(), and intelxlvf_remove().
|
static |
Allocate admin queue.
intelxl | Intel device |
admin | Admin queue |
rc | Return status code |
Definition at line 141 of file intelxl.c.
References intelxl_admin::buf, intelxl_nic::command, DBGC, intelxl_admin::desc, intelxl_nic::dma, dma_alloc(), ENOMEM, INTELXL_ADMIN_NUM_DESC, INTELXL_ALIGN, len, intelxl_admin::map, and virt_to_phys().
Referenced by intelxl_open_admin().
|
static |
Enable admin queue.
intelxl | Intel device |
admin | Admin queue |
Definition at line 169 of file intelxl.c.
References address, intelxl_admin::base, intelxl_admin::desc, dma(), intelxl_admin::index, INTELXL_ADMIN_LEN_ENABLE, INTELXL_ADMIN_LEN_LEN, INTELXL_ADMIN_NUM_DESC, len, intelxl_admin::map, memset(), regs, intelxl_admin::regs, intelxl_nic::regs, and writel().
Referenced by intelxl_reopen_admin().
|
static |
Disable admin queue.
intelxl | Intel device |
admin | Admin queue |
Definition at line 208 of file intelxl.c.
References intelxl_admin::base, regs, intelxl_admin::regs, intelxl_nic::regs, and writel().
Referenced by intelxl_close_admin(), and intelxl_open_admin().
|
static |
Free admin queue.
intelxl | Intel device |
admin | Admin queue |
Definition at line 223 of file intelxl.c.
References intelxl_admin::buf, intelxl_admin::desc, dma_free(), INTELXL_ADMIN_NUM_DESC, len, and intelxl_admin::map.
Referenced by intelxl_close_admin(), and intelxl_open_admin().
struct intelxl_admin_descriptor* intelxl_admin_command_descriptor | ( | struct intelxl_nic * | intelxl | ) |
Get next admin command queue descriptor.
intelxl | Intel device |
cmd | Command descriptor |
Definition at line 239 of file intelxl.c.
References cmd, intelxl_nic::command, intelxl_admin::desc, intelxl_admin::index, INTELXL_ADMIN_NUM_DESC, and memset().
Referenced by ice_admin_command_descriptor(), intelxl_admin_autoneg(), intelxl_admin_clear_pxe(), intelxl_admin_driver(), intelxl_admin_link(), intelxl_admin_mac_config(), intelxl_admin_mac_read(), intelxl_admin_mac_write(), intelxl_admin_promisc(), intelxl_admin_shutdown(), intelxl_admin_switch(), intelxl_admin_version(), intelxl_admin_vsi(), and intelxlvf_admin_command_descriptor().
union intelxl_admin_buffer* intelxl_admin_command_buffer | ( | struct intelxl_nic * | intelxl | ) |
Get next admin command queue data buffer.
intelxl | Intel device |
buf | Data buffer |
Definition at line 256 of file intelxl.c.
References intelxl_admin::buf, intelxl_nic::command, intelxl_admin::index, INTELXL_ADMIN_NUM_DESC, and memset().
Referenced by ice_admin_command_buffer(), intelxl_admin_driver(), intelxl_admin_mac_read(), intelxl_admin_switch(), intelxl_admin_vsi(), and intelxlvf_admin_command_buffer().
|
static |
Initialise admin event queue descriptor.
intelxl | Intel device |
index | Event queue index |
Definition at line 272 of file intelxl.c.
References address, intelxl_admin::buf, intelxl_admin_params::buffer, cpu_to_le16, cpu_to_le32, intelxl_admin::desc, dma(), intelxl_nic::event, intelxl_admin_descriptor::flags, intelxl_admin_buffer_params::high, index, INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_NUM_DESC, intelxl_admin_descriptor::len, intelxl_admin_buffer_params::low, intelxl_admin::map, and intelxl_admin_descriptor::params.
Referenced by intelxl_poll_admin(), and intelxl_reopen_admin().
int intelxl_admin_command | ( | struct intelxl_nic * | intelxl | ) |
Issue admin queue command.
intelxl | Intel device |
rc | Return status code |
Definition at line 295 of file intelxl.c.
References address, assert(), intelxl_admin::base, intelxl_admin::buf, cmd, intelxl_nic::command, cpu_to_le16, cpu_to_le32, DBGC, DBGC2, DBGC2_HDA, DBGC_HDA, intelxl_admin::desc, dma(), EIO, EPROTO, ETIMEDOUT, index, intelxl_admin::index, INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_FL_CMP, INTELXL_ADMIN_FL_DD, INTELXL_ADMIN_FL_ERR, INTELXL_ADMIN_FL_RD, INTELXL_ADMIN_MAX_WAIT_MS, INTELXL_ADMIN_NUM_DESC, le16_to_cpu, le32_to_cpu, intelxl_admin::map, mdelay(), rc, regs, intelxl_admin::regs, intelxl_nic::regs, virt_to_phys(), wmb(), and writel().
Referenced by ice_admin_add_txq(), ice_admin_autoneg(), ice_admin_disable_txq(), ice_admin_link(), ice_admin_mac_read(), ice_admin_mac_write(), ice_admin_rules(), ice_admin_schedule(), ice_admin_switch(), ice_admin_version(), intelxl_admin_autoneg(), intelxl_admin_clear_pxe(), intelxl_admin_driver(), intelxl_admin_link(), intelxl_admin_mac_config(), intelxl_admin_mac_read(), intelxl_admin_mac_write(), intelxl_admin_promisc(), intelxl_admin_shutdown(), intelxl_admin_switch(), intelxl_admin_version(), intelxl_admin_vsi(), intelxlvf_admin_command(), intelxlvf_admin_request_qps(), and intelxlvf_reset_admin().
|
static |
Get firmware version.
intelxl | Intel device |
rc | Return status code |
Definition at line 405 of file intelxl.c.
References intelxl_admin_version_params::api, cmd, cpu_to_le16, DBGC, ENOTSUP, INTELXL_ADMIN_API_MAJOR, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_VERSION, le16_to_cpu, rc, and version.
|
static |
Report driver version.
intelxl | Intel device |
rc | Return status code |
Definition at line 441 of file intelxl.c.
References cmd, cpu_to_le16, intelxl_admin_buffer::driver, intelxl_admin_command(), intelxl_admin_command_buffer(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_DRIVER, INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_FL_RD, intelxl_admin_driver_buffer::name, product_major_version, product_minor_version, product_name, product_short_name, rc, and snprintf().
Referenced by intelxl_probe().
|
static |
Shutdown admin queues.
intelxl | Intel device |
rc | Return status code |
Definition at line 472 of file intelxl.c.
References cmd, cpu_to_le16, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_SHUTDOWN, INTELXL_ADMIN_SHUTDOWN_UNLOADING, rc, and shutdown().
Referenced by intelxl_close_admin().
|
static |
Get MAC address.
netdev | Network device |
rc | Return status code |
Definition at line 496 of file intelxl.c.
References cmd, cpu_to_le16, DBGC, ENOENT, ETH_ALEN, eth_ntoa(), net_device::hw_addr, intelxl_admin_command(), intelxl_admin_command_buffer(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_MAC_READ, INTELXL_ADMIN_MAC_READ_VALID_LAN, is_valid_ether_addr(), mac, intelxl_admin_buffer::mac_read, memcpy(), netdev, intelxl_admin_mac_read_buffer::pf, net_device::priv, rc, and read.
Referenced by intelxl_probe().
|
static |
Set MAC address.
netdev | Network device |
rc | Return status code |
Definition at line 544 of file intelxl.c.
References __attribute__, bswap_16, bswap_32, cmd, cpu_to_le16, ETH_ALEN, intelxl_admin_mac_write_params::high, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_MAC_WRITE, net_device::ll_addr, intelxl_admin_mac_write_params::low, mac, memcpy(), netdev, net_device::priv, raw, rc, and write.
Referenced by intelxl_open().
int intelxl_admin_clear_pxe | ( | struct intelxl_nic * | intelxl | ) |
Clear PXE mode.
intelxl | Intel device |
rc | Return status code |
Definition at line 578 of file intelxl.c.
References cmd, cpu_to_le16, DBGC, INTELXL_ADMIN_CLEAR_PXE, INTELXL_ADMIN_CLEAR_PXE_MAGIC, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_EEXIST, intelxl_admin_clear_pxe_params::magic, and rc.
Referenced by ice_probe(), and intelxl_probe().
|
static |
Get switch configuration.
intelxl | Intel device |
rc | Return status code |
Definition at line 610 of file intelxl.c.
References intelxl_admin_switch_buffer::cfg, cmd, intelxl_admin_switch_config::connection, cpu_to_le16, DBGC, DBGC2, DBGC2_HDA, intelxl_admin_switch_config::downlink, ENOENT, intelxl_admin_command(), intelxl_admin_command_buffer(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_SWITCH, INTELXL_ADMIN_SWITCH_TYPE_VSI, le16_to_cpu, next, rc, intelxl_admin_switch_config::seid, intelxl_admin_buffer::sw, intelxl_admin_switch_config::type, intelxl_admin_switch_config::uplink, and intelxl_nic::vsi.
Referenced by intelxl_probe().
|
static |
Get VSI parameters.
intelxl | Intel device |
rc | Return status code |
Definition at line 664 of file intelxl.c.
References cmd, cpu_to_le16, DBGC, intelxl_admin_command(), intelxl_admin_command_buffer(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_VSI, le16_to_cpu, intelxl_admin_vsi_buffer::qset, intelxl_nic::qset, intelxl_admin_vsi_buffer::queue, intelxl_nic::queue, rc, intelxl_admin_vsi_params::vsi, intelxl_admin_buffer::vsi, and intelxl_nic::vsi.
Referenced by intelxl_probe().
|
static |
Set VSI promiscuous modes.
intelxl | Intel device |
rc | Return status code |
Definition at line 698 of file intelxl.c.
References cmd, cpu_to_le16, flags, intelxl_admin_promisc_params::flags, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_PROMISC, INTELXL_ADMIN_PROMISC_FL_BROADCAST, INTELXL_ADMIN_PROMISC_FL_MULTICAST, INTELXL_ADMIN_PROMISC_FL_UNICAST, INTELXL_ADMIN_PROMISC_FL_VLAN, rc, intelxl_admin_promisc_params::valid, intelxl_admin_promisc_params::vsi, and intelxl_nic::vsi.
Referenced by intelxl_probe().
int intelxl_admin_mac_config | ( | struct intelxl_nic * | intelxl | ) |
Set MAC configuration.
intelxl | Intel device |
rc | Return status code |
Definition at line 729 of file intelxl.c.
References cmd, cpu_to_le16, intelxl_admin_mac_config_params::flags, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_MAC_CONFIG, INTELXL_ADMIN_MAC_CONFIG_FL_CRC, intelxl_admin_mac_config_params::mfs, intelxl_nic::mfs, and rc.
Referenced by ice_open(), and intelxl_open().
|
static |
Restart autonegotiation.
intelxl | Intel device |
rc | Return status code |
Definition at line 754 of file intelxl.c.
References cmd, cpu_to_le16, intelxl_admin_autoneg_params::flags, INTELXL_ADMIN_AUTONEG, INTELXL_ADMIN_AUTONEG_FL_ENABLE, INTELXL_ADMIN_AUTONEG_FL_RESTART, intelxl_admin_command(), intelxl_admin_command_descriptor(), and rc.
Referenced by intelxl_open().
|
static |
Get link status.
netdev | Network device |
rc | Return status code |
Definition at line 779 of file intelxl.c.
References cmd, cpu_to_le16, DBGC, intelxl_admin_command(), intelxl_admin_command_descriptor(), INTELXL_ADMIN_LINK, INTELXL_ADMIN_LINK_NOTIFY, INTELXL_ADMIN_LINK_UP, link, netdev, netdev_link_down(), netdev_link_up(), net_device::priv, and rc.
Referenced by intelxl_admin_event(), intelxl_open(), and intelxl_probe().
|
static |
Handle admin event.
netdev | Network device |
evt | Event descriptor |
buf | Data buffer |
Definition at line 814 of file intelxl.c.
References cpu_to_le16, DBGC, INTELXL_ADMIN_LINK, intelxl_admin_link(), le16_to_cpu, netdev, intelxl_admin_descriptor::opcode, and net_device::priv.
Referenced by intelxl_probe().
|
static |
Refill admin event queue.
intelxl | Intel device |
Definition at line 835 of file intelxl.c.
References intelxl_admin::base, intelxl_nic::event, intelxl_admin::index, INTELXL_ADMIN_NUM_DESC, regs, intelxl_admin::regs, intelxl_nic::regs, intelxl_admin_offsets::tail, wmb(), and writel().
Referenced by intelxl_poll_admin(), and intelxl_reopen_admin().
void intelxl_poll_admin | ( | struct net_device * | netdev | ) |
Poll admin event queue.
netdev | Network device |
Definition at line 853 of file intelxl.c.
References intelxl_admin::buf, cpu_to_le16, DBGC2, DBGC2_HDA, intelxl_admin::desc, intelxl_nic::event, intelxl_admin_descriptor::flags, intelxl_nic::handle, intelxl_admin::index, intelxl_admin_event_init(), INTELXL_ADMIN_FL_BUF, INTELXL_ADMIN_FL_DD, INTELXL_ADMIN_NUM_DESC, intelxl_refill_admin(), le16_to_cpu, intelxl_admin_descriptor::len, netdev, net_device::priv, and virt_to_phys().
Referenced by intelxl_poll(), and intelxlvf_admin_command().
int intelxl_open_admin | ( | struct intelxl_nic * | intelxl | ) |
Open admin queues.
intelxl | Intel device |
rc | Return status code |
Definition at line 894 of file intelxl.c.
References intelxl_nic::command, intelxl_nic::event, intelxl_alloc_admin(), intelxl_disable_admin(), intelxl_free_admin(), intelxl_reopen_admin(), and rc.
Referenced by ice_probe(), intelxl_probe(), and intelxlvf_probe().
void intelxl_reopen_admin | ( | struct intelxl_nic * | intelxl | ) |
Reopen admin queues (after virtual function reset)
intelxl | Intel device |
Definition at line 924 of file intelxl.c.
References intelxl_nic::command, intelxl_nic::event, intelxl_admin_event_init(), INTELXL_ADMIN_NUM_DESC, intelxl_enable_admin(), and intelxl_refill_admin().
Referenced by intelxl_open_admin(), and intelxlvf_reset_wait().
void intelxl_close_admin | ( | struct intelxl_nic * | intelxl | ) |
Close admin queues.
intelxl | Intel device |
Definition at line 946 of file intelxl.c.
References intelxl_nic::command, intelxl_nic::event, intelxl_admin_shutdown(), intelxl_disable_admin(), and intelxl_free_admin().
Referenced by ice_probe(), ice_remove(), intelxl_probe(), intelxl_remove(), intelxlvf_probe(), and intelxlvf_remove().
int intelxl_alloc_ring | ( | struct intelxl_nic * | intelxl, |
struct intelxl_ring * | ring | ||
) |
Allocate descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
rc | Return status code |
Definition at line 974 of file intelxl.c.
References intelxl_ring::cons, DBGC, intelxl_ring::desc, intelxl_nic::dma, dma_alloc(), dma_free(), ENOMEM, INTELXL_ALIGN, intelxl_ring::len, intelxl_ring::map, memset(), intelxl_ring::prod, intelxl_ring::raw, rc, intelxl_nic::regs, intelxl_ring::tail, virt_to_phys(), and writel().
Referenced by ice_create_tx(), intelxl_create_ring(), and intelxlvf_open().
void intelxl_free_ring | ( | struct intelxl_nic *intelxl | __unused, |
struct intelxl_ring * | ring | ||
) |
Free descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
Definition at line 1013 of file intelxl.c.
References intelxl_ring::desc, dma_free(), intelxl_ring::len, intelxl_ring::map, NULL, and intelxl_ring::raw.
Referenced by ice_create_tx(), ice_destroy_tx(), intelxl_create_ring(), intelxl_destroy_ring(), intelxlvf_close(), and intelxlvf_open().
|
static |
Dump queue context (for debugging)
intelxl | Intel device |
op | Context operation |
len | Size of context |
Definition at line 1029 of file intelxl.c.
References intelxl_nic::base, DBG_EXTRA, DBGC2, DBGC2_HDA, index, INTELXL_CTX_MAX_WAIT_MS, INTELXL_PFCM_LANCTXCTL, INTELXL_PFCM_LANCTXCTL_OP_CODE_READ, INTELXL_PFCM_LANCTXCTL_QUEUE_NUM, INTELXL_PFCM_LANCTXCTL_SUB_LINE, INTELXL_PFCM_LANCTXDATA, INTELXL_PFCM_LANCTXSTAT, INTELXL_PFCM_LANCTXSTAT_DONE, len, mdelay(), op, queue, intelxl_nic::queue, intelxl_context_line::raw, readl(), intelxl_nic::regs, and writel().
Referenced by intelxl_close().
|
static |
Program queue context line.
intelxl | Intel device |
line | Queue context line |
index | Line number |
op | Context operation |
rc | Return status code |
Definition at line 1087 of file intelxl.c.
References intelxl_nic::base, DBGC, ETIMEDOUT, index, INTELXL_CTX_MAX_WAIT_MS, INTELXL_PFCM_LANCTXCTL, INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE, INTELXL_PFCM_LANCTXCTL_QUEUE_NUM, INTELXL_PFCM_LANCTXCTL_SUB_LINE, INTELXL_PFCM_LANCTXDATA, INTELXL_PFCM_LANCTXSTAT, INTELXL_PFCM_LANCTXSTAT_DONE, le32_to_cpu, mdelay(), op, queue, intelxl_nic::queue, intelxl_context_line::raw, readl(), intelxl_nic::regs, and writel().
|
static |
Program queue context.
intelxl | Intel device |
line | Queue context lines |
len | Size of context |
op | Context operation |
rc | Return status code |
Definition at line 1135 of file intelxl.c.
References DBGC2, DBGC2_HDA, index, len, op, and rc.
Referenced by intelxl_context_rx(), and intelxl_context_tx().
|
static |
Program transmit queue context.
intelxl | Intel device |
address | Descriptor ring base address |
rc | Return status code |
Definition at line 1162 of file intelxl.c.
References address, cpu_to_le16, cpu_to_le64, ctx, intelxl_context(), INTELXL_CTX_TX_BASE, INTELXL_CTX_TX_COUNT, INTELXL_CTX_TX_FL_NEW, INTELXL_CTX_TX_QSET, INTELXL_PFCM_LANCTXCTL_TYPE_TX, INTELXL_TX_NUM_DESC, memset(), intelxl_nic::qset, rc, and tx.
|
static |
Program receive queue context.
intelxl | Intel device |
address | Descriptor ring base address |
rc | Return status code |
Definition at line 1193 of file intelxl.c.
References address, cpu_to_le16, cpu_to_le64, ctx, intelxl_context(), INTELXL_CTX_RX_BASE_COUNT, INTELXL_CTX_RX_FL_CRCSTRIP, INTELXL_CTX_RX_FL_DSIZE, INTELXL_CTX_RX_LEN, INTELXL_CTX_RX_MFS, INTELXL_PFCM_LANCTXCTL_TYPE_RX, INTELXL_RX_NUM_DESC, memset(), intelxl_nic::mfs, rc, and rx.
|
static |
Enable descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
rc | Return status code |
Definition at line 1225 of file intelxl.c.
References DBGC, EIO, INTELXL_QUEUE_ENABLE_DELAY_US, INTELXL_QXX_ENA, INTELXL_QXX_ENA_REQ, INTELXL_QXX_ENA_STAT, readl(), intelxl_ring::reg, intelxl_nic::regs, intelxl_ring::tail, udelay(), and writel().
Referenced by intelxl_create_ring().
|
static |
Disable descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
rc | Return status code |
Definition at line 1250 of file intelxl.c.
References DBGC, ETIMEDOUT, INTELXL_QUEUE_DISABLE_MAX_WAIT_MS, INTELXL_QXX_ENA, INTELXL_QXX_ENA_STAT, mdelay(), readl(), intelxl_ring::reg, intelxl_nic::regs, intelxl_ring::tail, and writel().
Referenced by intelxl_create_ring(), and intelxl_destroy_ring().
int intelxl_create_ring | ( | struct intelxl_nic * | intelxl, |
struct intelxl_ring * | ring | ||
) |
Create descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
rc | Return status code |
Definition at line 1283 of file intelxl.c.
References address, intelxl_ring::context, intelxl_ring::desc, dma(), intelxl_alloc_ring(), intelxl_disable_ring(), intelxl_enable_ring(), intelxl_free_ring(), intelxl_ring::map, intelxl_ring::raw, and rc.
Referenced by ice_open(), and intelxl_open().
void intelxl_destroy_ring | ( | struct intelxl_nic * | intelxl, |
struct intelxl_ring * | ring | ||
) |
Destroy descriptor ring.
intelxl | Intel device |
ring | Descriptor ring |
Definition at line 1317 of file intelxl.c.
References intelxl_disable_ring(), intelxl_free_ring(), and rc.
Referenced by ice_close(), ice_open(), intelxl_close(), and intelxl_open().
|
static |
Refill receive descriptor ring.
intelxl | Intel device |
Definition at line 1336 of file intelxl.c.
References alloc_rx_iob(), assert(), intelxl_ring::cons, cpu_to_le64, io_buffer::data, intelxl_rx_descriptor::data, DBGC2, intelxl_ring::desc, intelxl_nic::dma, INTELXL_RX_FILL, INTELXL_RX_NUM_DESC, iob_dma(), intelxl_nic::mfs, NULL, intelxl_ring::prod, intelxl_nic::regs, rx, intelxl_ring::rx, intelxl_nic::rx, intelxl_nic::rx_iobuf, intelxl_ring::tail, virt_to_phys(), wmb(), and writel().
Referenced by intelxl_open(), and intelxl_poll().
void intelxl_empty_rx | ( | struct intelxl_nic * | intelxl | ) |
Discard unused receive I/O buffers.
intelxl | Intel device |
Definition at line 1384 of file intelxl.c.
References free_rx_iob(), INTELXL_RX_NUM_DESC, NULL, and intelxl_nic::rx_iobuf.
Referenced by ice_close(), intelxl_close(), and intelxlvf_close().
|
static |
Open network device.
netdev | Network device |
rc | Return status code |
Definition at line 1408 of file intelxl.c.
References intelxl_nic::base, ETH_HLEN, intelxl_admin_autoneg(), intelxl_admin_link(), intelxl_admin_mac_config(), intelxl_admin_mac_write(), INTELXL_ALIGN, intelxl_create_ring(), intelxl_destroy_ring(), INTELXL_GLLAN_TXPRE_QDIS, INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS, INTELXL_GLLAN_TXPRE_QDIS_QINDX, INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS, INTELXL_QTX_HEAD, INTELXL_QUEUE_PRE_DISABLE_DELAY_US, INTELXL_QXX_CTL, INTELXL_QXX_CTL_PFVF_PF_INDX, INTELXL_QXX_CTL_PFVF_Q_PF, intelxl_refill_rx(), intelxl_nic::mfs, net_device::mtu, netdev, intelxl_nic::pf, net_device::priv, queue, intelxl_nic::queue, rc, intelxl_ring::reg, intelxl_nic::regs, intelxl_nic::rx, intelxl_nic::tx, udelay(), and writel().
|
static |
Close network device.
netdev | Network device |
Definition at line 1476 of file intelxl.c.
References intelxl_nic::base, intelxl_context_dump(), intelxl_destroy_ring(), intelxl_empty_rx(), INTELXL_GLLAN_TXPRE_QDIS, INTELXL_GLLAN_TXPRE_QDIS_QINDX, INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS, INTELXL_PFCM_LANCTXCTL_TYPE_RX, INTELXL_PFCM_LANCTXCTL_TYPE_TX, INTELXL_QUEUE_PRE_DISABLE_DELAY_US, netdev, net_device::priv, queue, intelxl_nic::queue, intelxl_nic::regs, intelxl_nic::rx, intelxl_nic::tx, udelay(), and writel().
int intelxl_transmit | ( | struct net_device * | netdev, |
struct io_buffer * | iobuf | ||
) |
Transmit packet.
netdev | Network device |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 1510 of file intelxl.c.
References intelxl_ring::cons, cpu_to_le32, cpu_to_le64, io_buffer::data, intelxl_tx_descriptor::data, DBGC, DBGC2, intelxl_ring::desc, ENOBUFS, INTELXL_TX_DATA_DTYP, INTELXL_TX_DATA_EOP, INTELXL_TX_DATA_JFDI, INTELXL_TX_DATA_LEN, INTELXL_TX_DATA_RS, INTELXL_TX_FILL, INTELXL_TX_NUM_DESC, iob_dma(), iob_len(), len, netdev, net_device::priv, intelxl_ring::prod, intelxl_nic::regs, intelxl_ring::tail, tx, intelxl_ring::tx, intelxl_nic::tx, virt_to_phys(), wmb(), and writel().
|
static |
Poll for completed packets.
netdev | Network device |
Definition at line 1549 of file intelxl.c.
References intelxl_ring::cons, DBGC2, intelxl_ring::desc, intelxl_tx_writeback_descriptor::flags, INTELXL_TX_NUM_DESC, INTELXL_TX_WB_FL_DD, netdev, netdev_tx_complete_next(), net_device::priv, intelxl_ring::prod, intelxl_ring::tx, intelxl_nic::tx, and intelxl_tx_descriptor::wb.
Referenced by intelxl_poll().
|
static |
Poll for received packets.
netdev | Network device |
Definition at line 1578 of file intelxl.c.
References intelxl_ring::cons, cpu_to_le32, DBGC, DBGC2, intelxl_ring::desc, EIO, intelxl_rx_writeback_descriptor::flags, INTELXL_RX_NUM_DESC, INTELXL_RX_WB_FL_DD, INTELXL_RX_WB_FL_RXE, INTELXL_RX_WB_FL_VLAN, INTELXL_RX_WB_LEN, iob_put, le16_to_cpu, le32_to_cpu, len, intelxl_rx_writeback_descriptor::len, netdev, NULL, net_device::priv, intelxl_ring::prod, intelxl_ring::rx, intelxl_nic::rx, intelxl_nic::rx_iobuf, tag, intelxl_rx_writeback_descriptor::vlan, vlan_netdev_rx(), vlan_netdev_rx_err(), VLAN_TAG, and intelxl_rx_descriptor::wb.
Referenced by intelxl_poll().
void intelxl_poll | ( | struct net_device * | netdev | ) |
Poll for completed and received packets.
netdev | Network device |
Definition at line 1630 of file intelxl.c.
References INTELXL_INT_DYN_CTL_INTENA, intelxl_poll_admin(), intelxl_poll_rx(), intelxl_poll_tx(), intelxl_refill_rx(), intelxl_nic::intr, netdev, net_device::priv, intelxl_nic::regs, and writel().
|
static |
Probe PCI device.
pci | PCI device |
rc | Return status code |
Definition at line 1684 of file intelxl.c.
References adjust_pci_device(), alloc_etherdev(), intelxl_nic::base, intelxl_nic::command, DBGC, intelxl_ring::desc, pci_device::dev, net_device::dev, pci_device::dma, net_device::dma, intelxl_nic::dma, dma_set_mask_64bit(), ENODEV, ENOMEM, ENXIO, intelxl_nic::event, intelxl_nic::exp, intelxl_nic::handle, intelxl_admin_clear_pxe(), INTELXL_ADMIN_CMD, intelxl_admin_driver(), intelxl_admin_event(), INTELXL_ADMIN_EVT, intelxl_admin_link(), intelxl_admin_mac_read(), intelxl_admin_promisc(), intelxl_admin_switch(), intelxl_admin_vsi(), INTELXL_BAR_SIZE, intelxl_close_admin(), intelxl_init_admin(), intelxl_init_ring(), INTELXL_MAX_PKT_LEN, intelxl_msix_disable(), intelxl_msix_enable(), INTELXL_MSIX_VECTOR, intelxl_open_admin(), intelxl_operations, INTELXL_PFFUNC_RID, INTELXL_PFFUNC_RID_FUNC_NUM, INTELXL_PFGEN_PORTNUM, INTELXL_PFGEN_PORTNUM_PORT_NUM, INTELXL_PFINT_DYN_CTL0, INTELXL_PFINT_ICR0_ENA, INTELXL_PFINT_ICR0_ENA_ADMINQ, INTELXL_PFINT_LNKLST0, INTELXL_PFINT_LNKLST0_FIRSTQ_INDX, INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX, INTELXL_PFLAN_QALLOC, INTELXL_PFLAN_QALLOC_FIRSTQ, INTELXL_PFLAN_QALLOC_LASTQ, INTELXL_QINT_RQCTL, INTELXL_QINT_RQCTL_CAUSE_ENA, INTELXL_QINT_RQCTL_NEXTQ_INDX, INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX, INTELXL_QINT_TQCTL, INTELXL_QINT_TQCTL_CAUSE_ENA, INTELXL_QINT_TQCTL_NEXTQ_INDX_NONE, INTELXL_QRX, INTELXL_QTX, INTELXL_QXX_TAIL, INTELXL_RX_NUM_DESC, INTELXL_TX_NUM_DESC, intelxl_nic::intr, iounmap(), net_device::max_pkt_len, pci_device::membase, memset(), netdev, netdev_init(), netdev_nullify(), netdev_put(), PCI_CAP_ID_EXP, pci_find_capability(), pci_ioremap(), pci_reset(), pci_set_drvdata(), intelxl_nic::pf, intelxl_nic::port, net_device::priv, intelxl_nic::queue, rc, readl(), intelxl_ring::reg, register_netdev(), intelxl_nic::regs, intelxl_ring::rx, intelxl_nic::rx, intelxl_ring::tail, intelxl_ring::tx, intelxl_nic::tx, unregister_netdev(), and writel().
|
static |
Remove PCI device.
pci | PCI device |
Definition at line 1849 of file intelxl.c.
References intelxl_nic::exp, intelxl_close_admin(), intelxl_msix_disable(), INTELXL_MSIX_VECTOR, iounmap(), netdev, netdev_nullify(), netdev_put(), pci_get_drvdata(), pci_reset(), net_device::priv, intelxl_nic::regs, and unregister_netdev().
const struct intelxl_admin_offsets intelxl_admin_offsets |
Admin queue register offsets.
|
static |
Network device operations.
Definition at line 1664 of file intelxl.c.
Referenced by intelxl_probe().
|
static |
PCI device IDs.
struct pci_driver intelxl_driver __pci_driver |
PCI driver.