iPXE
Data Structures | Macros | Functions | Variables
intelxl.h File Reference

Intel 40 Gigabit Ethernet network card driver. More...

#include <stdint.h>
#include <ipxe/if_ether.h>
#include <ipxe/pcimsix.h>
#include <ipxe/dma.h>

Go to the source code of this file.

Data Structures

struct  intelxl_admin_offsets
 Admin queue register offsets. More...
 
struct  intelxl_admin_buffer_params
 Admin queue data buffer command parameters. More...
 
struct  intelxl_admin_version
 Admin queue version number. More...
 
struct  intelxl_admin_version_params
 Admin queue Get Version command parameters. More...
 
struct  intelxl_admin_driver_params
 Admin queue Driver Version command parameters. More...
 
struct  intelxl_admin_driver_buffer
 Admin queue Driver Version data buffer. More...
 
struct  intelxl_admin_shutdown_params
 Admin queue Shutdown command parameters. More...
 
struct  intelxl_admin_mac_read_params
 Admin queue Manage MAC Address Read command parameters. More...
 
struct  intelxl_admin_mac_read_buffer
 Admin queue Manage MAC Address Read data buffer. More...
 
struct  intelxl_admin_mac_write_params
 Admin queue Manage MAC Address Write command parameters. More...
 
struct  intelxl_admin_clear_pxe_params
 Admin queue Clear PXE Mode command parameters. More...
 
struct  intelxl_admin_switch_config
 Switching element configuration. More...
 
struct  intelxl_admin_switch_params
 Admin queue Get Switch Configuration command parameters. More...
 
struct  intelxl_admin_switch_buffer
 Admin queue Get Switch Configuration data buffer. More...
 
struct  intelxl_admin_vsi_params
 Admin queue Get VSI Parameters command parameters. More...
 
struct  intelxl_admin_vsi_buffer
 Admin queue Get VSI Parameters data buffer. More...
 
struct  intelxl_admin_promisc_params
 Admin queue Set VSI Promiscuous Modes command parameters. More...
 
struct  intelxl_admin_mac_config_params
 Admin queue Set MAC Configuration command parameters. More...
 
struct  intelxl_admin_autoneg_params
 Admin queue Restart Autonegotiation command parameters. More...
 
struct  intelxl_admin_link_params
 Admin queue Get Link Status command parameters. More...
 
union  intelxl_admin_params
 Admin queue command parameters. More...
 
union  intelxl_admin_buffer
 Admin queue data buffer. More...
 
struct  intelxl_admin_descriptor
 Admin queue descriptor. More...
 
struct  intelxl_admin
 Admin queue. More...
 
struct  intelxl_context_line
 Queue context line. More...
 
struct  intelxl_context_tx
 Transmit queue context. More...
 
struct  intelxl_context_rx
 Receive queue context. More...
 
struct  intelxl_tx_data_descriptor
 Transmit data descriptor. More...
 
struct  intelxl_tx_writeback_descriptor
 Transmit writeback descriptor. More...
 
union  intelxl_tx_descriptor
 Transmit descriptor. More...
 
struct  intelxl_rx_data_descriptor
 Receive data descriptor. More...
 
struct  intelxl_rx_writeback_descriptor
 Receive writeback descriptor. More...
 
union  intelxl_rx_descriptor
 Packet descriptor. More...
 
struct  intelxl_ring
 Descriptor ring. More...
 
struct  intelxl_nic
 An Intel 40 Gigabit network card. More...
 

Macros

#define INTELXL_BAR_SIZE   0x200000
 BAR size. More...
 
#define INTELXL_ALIGN   256
 Alignment. More...
 
#define INTELXL_ADMIN_CMD   0x080000
 PF Admin Command Queue register block. More...
 
#define INTELXL_ADMIN_EVT   0x080080
 PF Admin Event Queue register block. More...
 
#define INTELXL_ADMIN_BAL   0x000
 Admin Queue Base Address Low Register (offset) More...
 
#define INTELXL_ADMIN_BAH   0x100
 Admin Queue Base Address High Register (offset) More...
 
#define INTELXL_ADMIN_LEN   0x200
 Admin Queue Length Register (offset) More...
 
#define INTELXL_ADMIN_LEN_LEN(x)   ( (x) << 0 )
 Queue length. More...
 
#define INTELXL_ADMIN_LEN_ENABLE   0x80000000UL
 Queue enable. More...
 
#define INTELXL_ADMIN_HEAD   0x300
 Admin Queue Head Register (offset) More...
 
#define INTELXL_ADMIN_TAIL   0x400
 Admin Queue Tail Register (offset) More...
 
#define INTELXL_ADMIN_VERSION   0x0001
 Admin queue Get Version command. More...
 
#define INTELXL_ADMIN_DRIVER   0x0002
 Admin queue Driver Version command. More...
 
#define INTELXL_ADMIN_SHUTDOWN   0x0003
 Admin queue Shutdown command. More...
 
#define INTELXL_ADMIN_SHUTDOWN_UNLOADING   0x01
 Driver is unloading. More...
 
#define INTELXL_ADMIN_MAC_READ   0x0107
 Admin queue Manage MAC Address Read command. More...
 
#define INTELXL_ADMIN_MAC_READ_VALID_LAN   0x10
 LAN MAC address is valid. More...
 
#define INTELXL_ADMIN_MAC_WRITE   0x0108
 Admin queue Manage MAC Address Write command. More...
 
#define INTELXL_ADMIN_CLEAR_PXE   0x0110
 Admin queue Clear PXE Mode command. More...
 
#define INTELXL_ADMIN_CLEAR_PXE_MAGIC   0x02
 Clear PXE Mode magic value. More...
 
#define INTELXL_ADMIN_SWITCH   0x0200
 Admin queue Get Switch Configuration command. More...
 
#define INTELXL_ADMIN_SWITCH_TYPE_VSI   19
 Virtual Station Inferface element type. More...
 
#define INTELXL_ADMIN_VSI   0x0212
 Admin queue Get VSI Parameters command. More...
 
#define INTELXL_ADMIN_PROMISC   0x0254
 Admin queue Set VSI Promiscuous Modes command. More...
 
#define INTELXL_ADMIN_PROMISC_FL_UNICAST   0x0001
 Promiscuous unicast mode. More...
 
#define INTELXL_ADMIN_PROMISC_FL_MULTICAST   0x0002
 Promiscuous multicast mode. More...
 
#define INTELXL_ADMIN_PROMISC_FL_BROADCAST   0x0004
 Promiscuous broadcast mode. More...
 
#define INTELXL_ADMIN_PROMISC_FL_VLAN   0x0010
 Promiscuous VLAN mode. More...
 
#define INTELXL_ADMIN_MAC_CONFIG   0x0603
 Admin queue Set MAC Configuration command. More...
 
#define INTELXL_ADMIN_MAC_CONFIG_FL_CRC   0x04
 Append CRC on transmit. More...
 
#define INTELXL_ADMIN_AUTONEG   0x0605
 Admin queue Restart Autonegotiation command. More...
 
#define INTELXL_ADMIN_AUTONEG_FL_RESTART   0x02
 Restart autonegotiation. More...
 
#define INTELXL_ADMIN_AUTONEG_FL_ENABLE   0x04
 Enable link. More...
 
#define INTELXL_ADMIN_LINK   0x0607
 Admin queue Get Link Status command. More...
 
#define INTELXL_ADMIN_LINK_NOTIFY   0x03
 Notify driver of link status changes. More...
 
#define INTELXL_ADMIN_LINK_UP   0x01
 Link is up. More...
 
#define INTELXL_ADMIN_BUFFER_SIZE   0x1000
 Maximum size of a data buffer. More...
 
#define INTELXL_ADMIN_FL_DD   0x0001
 Admin descriptor done. More...
 
#define INTELXL_ADMIN_FL_CMP   0x0002
 Admin descriptor contains a completion. More...
 
#define INTELXL_ADMIN_FL_ERR   0x0004
 Admin descriptor completed in error. More...
 
#define INTELXL_ADMIN_FL_RD   0x0400
 Admin descriptor uses data buffer for command parameters. More...
 
#define INTELXL_ADMIN_FL_BUF   0x1000
 Admin descriptor uses data buffer. More...
 
#define INTELXL_ADMIN_EEXIST   13
 Error: attempt to create something that already exists. More...
 
#define INTELXL_ADMIN_NUM_DESC   4
 Number of admin queue descriptors. More...
 
#define INTELXL_ADMIN_MAX_WAIT_MS   100
 Maximum time to wait for an admin request to complete. More...
 
#define INTELXL_ADMIN_API_MAJOR   1
 Admin queue API major version. More...
 
#define INTELXL_PFCM_LANCTXDATA(x)   ( 0x10c100 + ( 0x80 * (x) ) )
 CMLAN Context Data Register. More...
 
#define INTELXL_PFCM_LANCTXCTL   0x10c300
 CMLAN Context Control Register. More...
 
#define INTELXL_PFCM_LANCTXCTL_QUEUE_NUM(x)   ( (x) << 0 )
 Queue number. More...
 
#define INTELXL_PFCM_LANCTXCTL_SUB_LINE(x)   ( (x) << 12 )
 Sub-line. More...
 
#define INTELXL_PFCM_LANCTXCTL_TYPE(x)   ( (x) << 15 )
 Queue type. More...
 
#define INTELXL_PFCM_LANCTXCTL_TYPE_RX   INTELXL_PFCM_LANCTXCTL_TYPE ( 0x0 )
 RX queue type. More...
 
#define INTELXL_PFCM_LANCTXCTL_TYPE_TX   INTELXL_PFCM_LANCTXCTL_TYPE ( 0x1 )
 TX queue type. More...
 
#define INTELXL_PFCM_LANCTXCTL_OP_CODE(x)   ( (x) << 17 )
 Op code. More...
 
#define INTELXL_PFCM_LANCTXCTL_OP_CODE_READ   INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x0 )
 Read context. More...
 
#define INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE   INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x1 )
 Write context. More...
 
#define INTELXL_PFCM_LANCTXSTAT   0x10c380
 CMLAN Context Status Register. More...
 
#define INTELXL_PFCM_LANCTXSTAT_DONE   0x00000001UL
 Complete. More...
 
#define INTELXL_CTX_TX_FL_NEW   0x4000
 New transmit queue context. More...
 
#define INTELXL_CTX_TX_BASE(base)   ( (base) >> 7 )
 Transmit queue base address. More...
 
#define INTELXL_CTX_TX_COUNT(count)   ( (count) << 1 )
 Transmit queue count. More...
 
#define INTELXL_CTX_TX_QSET(qset)   ( (qset) << 4 )
 Transmit queue set. More...
 
#define INTELXL_CTX_RX_BASE_COUNT(base, count)   ( ( (base) >> 7 ) | ( ( ( uint64_t ) (count) ) << 57 ) )
 Receive queue base address and queue count. More...
 
#define INTELXL_CTX_RX_LEN(len)   ( (len) >> 1 )
 Receive queue data buffer length. More...
 
#define INTELXL_CTX_RX_FL_DSIZE   0x10
 Use 32-byte receive descriptors. More...
 
#define INTELXL_CTX_RX_FL_CRCSTRIP   0x20
 Strip CRC from received packets. More...
 
#define INTELXL_CTX_RX_MFS(mfs)   ( (mfs) >> 2 )
 Receive queue maximum frame size. More...
 
#define INTELXL_CTX_MAX_WAIT_MS   100
 Maximum time to wait for a context operation to complete. More...
 
#define INTELXL_QUEUE_ENABLE_DELAY_US   20
 Time to wait for a queue to become enabled. More...
 
#define INTELXL_QUEUE_PRE_DISABLE_DELAY_US   400
 Time to wait for a transmit queue to become pre-disabled. More...
 
#define INTELXL_QUEUE_DISABLE_MAX_WAIT_MS   1000
 Maximum time to wait for a queue to become disabled. More...
 
#define INTELXL_QTX_HEAD(x)   ( 0x0e4000 + ( 0x4 * (x) ) )
 Global Transmit Queue Head register. More...
 
#define INTELXL_GLLAN_TXPRE_QDIS(x)   ( 0x0e6500 + ( 0x4 * ( (x) / 0x80 ) ) )
 Global Transmit Pre Queue Disable register. More...
 
#define INTELXL_GLLAN_TXPRE_QDIS_QINDX(x)   ( (x) << 0 )
 Queue index. More...
 
#define INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS   0x40000000UL
 Set disable. More...
 
#define INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS   0x80000000UL
 Clear disable. More...
 
#define INTELXL_QTX(x)   ( 0x100000 + ( 0x4 * (x) ) )
 Global Transmit Queue register block. More...
 
#define INTELXL_QRX(x)   ( 0x120000 + ( 0x4 * (x) ) )
 Global Receive Queue register block. More...
 
#define INTELXL_QXX_ENA   0x0000
 Queue Enable Register (offset) More...
 
#define INTELXL_QXX_ENA_REQ   0x00000001UL
 Enable request. More...
 
#define INTELXL_QXX_ENA_STAT   0x00000004UL
 Enabled status. More...
 
#define INTELXL_QXX_CTL   0x4000
 Queue Control Register (offset) More...
 
#define INTELXL_QXX_CTL_PFVF_Q(x)   ( (x) << 0 )
 PF/VF queue. More...
 
#define INTELXL_QXX_CTL_PFVF_Q_PF   INTELXL_QXX_CTL_PFVF_Q ( 0x2 )
 PF queue. More...
 
#define INTELXL_QXX_CTL_PFVF_PF_INDX(x)   ( (x) << 2 )
 PF index. More...
 
#define INTELXL_QXX_TAIL   0x8000
 Queue Tail Pointer Register (offset) More...
 
#define INTELXL_TX_DATA_DTYP   0x0
 Transmit data descriptor type. More...
 
#define INTELXL_TX_DATA_EOP   0x10
 Transmit data descriptor end of packet. More...
 
#define INTELXL_TX_DATA_RS   0x20
 Transmit data descriptor report status. More...
 
#define INTELXL_TX_DATA_JFDI   0x40
 Transmit data descriptor pretty please. More...
 
#define INTELXL_TX_DATA_LEN(len)   ( (len) << 2 )
 Transmit data descriptor length. More...
 
#define INTELXL_TX_WB_FL_DD   0x01
 Transmit writeback descriptor complete. More...
 
#define INTELXL_RX_WB_FL_DD   0x00000001UL
 Receive writeback descriptor complete. More...
 
#define INTELXL_RX_WB_FL_VLAN   0x00000004UL
 Receive writeback descriptor VLAN tag present. More...
 
#define INTELXL_RX_WB_FL_RXE   0x00080000UL
 Receive writeback descriptor error. More...
 
#define INTELXL_RX_WB_LEN(len)   ( ( (len) >> 6 ) & 0x3fff )
 Receive writeback descriptor length. More...
 
#define INTELXL_TX_NUM_DESC   64
 Number of transmit descriptors. More...
 
#define INTELXL_TX_FILL   ( INTELXL_TX_NUM_DESC - 1 )
 Transmit descriptor ring maximum fill level. More...
 
#define INTELXL_RX_NUM_DESC   64
 Number of receive descriptors. More...
 
#define INTELXL_RX_FILL   16
 Receive descriptor ring fill level. More...
 
#define INTELXL_MAX_PKT_LEN   ( 9728 - 4 /* CRC */ )
 Maximum packet length (excluding CRC) More...
 
#define INTELXL_PFINT_DYN_CTL0   0x038480
 PF Interrupt Zero Dynamic Control Register. More...
 
#define INTELXL_INT_DYN_CTL_INTENA   0x00000001UL
 Enable. More...
 
#define INTELXL_INT_DYN_CTL_CLEARPBA   0x00000002UL
 Acknowledge. More...
 
#define INTELXL_INT_DYN_CTL_INTENA_MASK   0x80000000UL
 Ignore enable. More...
 
#define INTELXL_PFINT_LNKLST0   0x038500
 PF Interrupt Zero Linked List Register. More...
 
#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX(x)   ( (x) << 0 )
 Queue index. More...
 
#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX_NONE   INTELXL_PFINT_LNKLST0_FIRSTQ_INDX ( 0x7ff )
 End of list. More...
 
#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE(x)   ( (x) << 11 )
 Queue type. More...
 
#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX   INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x0 )
 Receive queue. More...
 
#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX   INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x1 )
 Transmit queue. More...
 
#define INTELXL_PFINT_ICR0_ENA   0x038800
 PF Interrupt Zero Cause Enablement Register. More...
 
#define INTELXL_PFINT_ICR0_ENA_ADMINQ   0x40000000UL
 Admin event. More...
 
#define INTELXL_QINT_RQCTL(x)   ( 0x03a000 + ( 0x4 * (x) ) )
 Receive Queue Interrupt Cause Control Register. More...
 
#define INTELXL_QINT_RQCTL_NEXTQ_INDX(x)   ( (x) << 16 )
 Queue index. More...
 
#define INTELXL_QINT_RQCTL_NEXTQ_INDX_NONE   INTELXL_QINT_RQCTL_NEXTQ_INDX ( 0x7ff )
 End of list. More...
 
#define INTELXL_QINT_RQCTL_NEXTQ_TYPE(x)   ( (x) << 27 )
 Queue type. More...
 
#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_RX   INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x0 )
 Receive queue. More...
 
#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX   INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x1 )
 Transmit queue. More...
 
#define INTELXL_QINT_RQCTL_CAUSE_ENA   0x40000000UL
 Enable. More...
 
#define INTELXL_QINT_TQCTL(x)   ( 0x03c000 + ( 0x4 * (x) ) )
 Transmit Queue Interrupt Cause Control Register. More...
 
#define INTELXL_QINT_TQCTL_NEXTQ_INDX(x)   ( (x) << 16 )
 Queue index. More...
 
#define INTELXL_QINT_TQCTL_NEXTQ_INDX_NONE   INTELXL_QINT_TQCTL_NEXTQ_INDX ( 0x7ff )
 End of list. More...
 
#define INTELXL_QINT_TQCTL_NEXTQ_TYPE(x)   ( (x) << 27 )
 Queue type. More...
 
#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_RX   INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x0 )
 Receive queue. More...
 
#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX   INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x1 )
 Transmit queue. More...
 
#define INTELXL_QINT_TQCTL_CAUSE_ENA   0x40000000UL
 Enable. More...
 
#define INTELXL_PFFUNC_RID   0x09c000
 Function Requester ID Information Register. More...
 
#define INTELXL_PFFUNC_RID_FUNC_NUM(x)   ( ( (x) >> 0 ) & 0x7 )
 Function number. More...
 
#define INTELXL_PFLAN_QALLOC   0x1c0400
 PF Queue Allocation Register. More...
 
#define INTELXL_PFLAN_QALLOC_FIRSTQ(x)   ( ( (x) >> 0 ) & 0x7ff )
 First queue. More...
 
#define INTELXL_PFLAN_QALLOC_LASTQ(x)   ( ( (x) >> 16 ) & 0x7ff )
 Last queue. More...
 
#define INTELXL_PFGEN_PORTNUM   0x1c0480
 PF LAN Port Number Register. More...
 
#define INTELXL_PFGEN_PORTNUM_PORT_NUM(x)   ( ( (x) >> 0 ) & 0x3 )
 Port number. More...
 
#define INTELXL_MSIX_VECTOR   0
 MSI-X interrupt vector. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FILE_SECBOOT (PERMITTED)
 
static void intelxl_init_admin (struct intelxl_admin *admin, unsigned int base, const struct intelxl_admin_offsets *regs)
 Initialise admin queue. More...
 
static void intelxl_init_ring (struct intelxl_ring *ring, unsigned int count, size_t len, int(*context)(struct intelxl_nic *intelxl, physaddr_t address))
 Initialise descriptor ring. More...
 
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...
 
struct intelxl_admin_descriptorintelxl_admin_command_descriptor (struct intelxl_nic *intelxl)
 Get next admin command queue descriptor. More...
 
union intelxl_admin_bufferintelxl_admin_command_buffer (struct intelxl_nic *intelxl)
 Get next admin command queue data buffer. More...
 
int intelxl_admin_command (struct intelxl_nic *intelxl)
 Issue admin queue command. More...
 
int intelxl_admin_clear_pxe (struct intelxl_nic *intelxl)
 Clear PXE mode. More...
 
int intelxl_admin_mac_config (struct intelxl_nic *intelxl)
 Set MAC configuration. 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, struct intelxl_ring *ring)
 
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...
 
void intelxl_empty_rx (struct intelxl_nic *intelxl)
 Discard unused receive I/O buffers. More...
 
int intelxl_transmit (struct net_device *netdev, struct io_buffer *iobuf)
 Transmit packet. More...
 
void intelxl_poll (struct net_device *netdev)
 Poll for completed and received packets. More...
 

Variables

const struct intelxl_admin_offsets intelxl_admin_offsets
 Admin queue register offsets. More...
 

Detailed Description

Intel 40 Gigabit Ethernet network card driver.

Definition in file intelxl.h.

Macro Definition Documentation

◆ INTELXL_BAR_SIZE

#define INTELXL_BAR_SIZE   0x200000

BAR size.

Definition at line 21 of file intelxl.h.

◆ INTELXL_ALIGN

#define INTELXL_ALIGN   256

Alignment.

No data structure requires greater than 256 byte alignment.

Definition at line 27 of file intelxl.h.

◆ INTELXL_ADMIN_CMD

#define INTELXL_ADMIN_CMD   0x080000

PF Admin Command Queue register block.

Definition at line 37 of file intelxl.h.

◆ INTELXL_ADMIN_EVT

#define INTELXL_ADMIN_EVT   0x080080

PF Admin Event Queue register block.

Definition at line 40 of file intelxl.h.

◆ INTELXL_ADMIN_BAL

#define INTELXL_ADMIN_BAL   0x000

Admin Queue Base Address Low Register (offset)

Definition at line 43 of file intelxl.h.

◆ INTELXL_ADMIN_BAH

#define INTELXL_ADMIN_BAH   0x100

Admin Queue Base Address High Register (offset)

Definition at line 46 of file intelxl.h.

◆ INTELXL_ADMIN_LEN

#define INTELXL_ADMIN_LEN   0x200

Admin Queue Length Register (offset)

Definition at line 49 of file intelxl.h.

◆ INTELXL_ADMIN_LEN_LEN

#define INTELXL_ADMIN_LEN_LEN (   x)    ( (x) << 0 )

Queue length.

Definition at line 50 of file intelxl.h.

◆ INTELXL_ADMIN_LEN_ENABLE

#define INTELXL_ADMIN_LEN_ENABLE   0x80000000UL

Queue enable.

Definition at line 51 of file intelxl.h.

◆ INTELXL_ADMIN_HEAD

#define INTELXL_ADMIN_HEAD   0x300

Admin Queue Head Register (offset)

Definition at line 54 of file intelxl.h.

◆ INTELXL_ADMIN_TAIL

#define INTELXL_ADMIN_TAIL   0x400

Admin Queue Tail Register (offset)

Definition at line 57 of file intelxl.h.

◆ INTELXL_ADMIN_VERSION

#define INTELXL_ADMIN_VERSION   0x0001

Admin queue Get Version command.

Definition at line 88 of file intelxl.h.

◆ INTELXL_ADMIN_DRIVER

#define INTELXL_ADMIN_DRIVER   0x0002

Admin queue Driver Version command.

Definition at line 111 of file intelxl.h.

◆ INTELXL_ADMIN_SHUTDOWN

#define INTELXL_ADMIN_SHUTDOWN   0x0003

Admin queue Shutdown command.

Definition at line 136 of file intelxl.h.

◆ INTELXL_ADMIN_SHUTDOWN_UNLOADING

#define INTELXL_ADMIN_SHUTDOWN_UNLOADING   0x01

Driver is unloading.

Definition at line 147 of file intelxl.h.

◆ INTELXL_ADMIN_MAC_READ

#define INTELXL_ADMIN_MAC_READ   0x0107

Admin queue Manage MAC Address Read command.

Definition at line 150 of file intelxl.h.

◆ INTELXL_ADMIN_MAC_READ_VALID_LAN

#define INTELXL_ADMIN_MAC_READ_VALID_LAN   0x10

LAN MAC address is valid.

Definition at line 161 of file intelxl.h.

◆ INTELXL_ADMIN_MAC_WRITE

#define INTELXL_ADMIN_MAC_WRITE   0x0108

Admin queue Manage MAC Address Write command.

Definition at line 176 of file intelxl.h.

◆ INTELXL_ADMIN_CLEAR_PXE

#define INTELXL_ADMIN_CLEAR_PXE   0x0110

Admin queue Clear PXE Mode command.

Definition at line 193 of file intelxl.h.

◆ INTELXL_ADMIN_CLEAR_PXE_MAGIC

#define INTELXL_ADMIN_CLEAR_PXE_MAGIC   0x02

Clear PXE Mode magic value.

Definition at line 204 of file intelxl.h.

◆ INTELXL_ADMIN_SWITCH

#define INTELXL_ADMIN_SWITCH   0x0200

Admin queue Get Switch Configuration command.

Definition at line 207 of file intelxl.h.

◆ INTELXL_ADMIN_SWITCH_TYPE_VSI

#define INTELXL_ADMIN_SWITCH_TYPE_VSI   19

Virtual Station Inferface element type.

Definition at line 232 of file intelxl.h.

◆ INTELXL_ADMIN_VSI

#define INTELXL_ADMIN_VSI   0x0212

Admin queue Get VSI Parameters command.

Definition at line 257 of file intelxl.h.

◆ INTELXL_ADMIN_PROMISC

#define INTELXL_ADMIN_PROMISC   0x0254

Admin queue Set VSI Promiscuous Modes command.

Definition at line 284 of file intelxl.h.

◆ INTELXL_ADMIN_PROMISC_FL_UNICAST

#define INTELXL_ADMIN_PROMISC_FL_UNICAST   0x0001

Promiscuous unicast mode.

Definition at line 299 of file intelxl.h.

◆ INTELXL_ADMIN_PROMISC_FL_MULTICAST

#define INTELXL_ADMIN_PROMISC_FL_MULTICAST   0x0002

Promiscuous multicast mode.

Definition at line 302 of file intelxl.h.

◆ INTELXL_ADMIN_PROMISC_FL_BROADCAST

#define INTELXL_ADMIN_PROMISC_FL_BROADCAST   0x0004

Promiscuous broadcast mode.

Definition at line 305 of file intelxl.h.

◆ INTELXL_ADMIN_PROMISC_FL_VLAN

#define INTELXL_ADMIN_PROMISC_FL_VLAN   0x0010

Promiscuous VLAN mode.

Definition at line 308 of file intelxl.h.

◆ INTELXL_ADMIN_MAC_CONFIG

#define INTELXL_ADMIN_MAC_CONFIG   0x0603

Admin queue Set MAC Configuration command.

Definition at line 311 of file intelxl.h.

◆ INTELXL_ADMIN_MAC_CONFIG_FL_CRC

#define INTELXL_ADMIN_MAC_CONFIG_FL_CRC   0x04

Append CRC on transmit.

Definition at line 324 of file intelxl.h.

◆ INTELXL_ADMIN_AUTONEG

#define INTELXL_ADMIN_AUTONEG   0x0605

Admin queue Restart Autonegotiation command.

Definition at line 327 of file intelxl.h.

◆ INTELXL_ADMIN_AUTONEG_FL_RESTART

#define INTELXL_ADMIN_AUTONEG_FL_RESTART   0x02

Restart autonegotiation.

Definition at line 338 of file intelxl.h.

◆ INTELXL_ADMIN_AUTONEG_FL_ENABLE

#define INTELXL_ADMIN_AUTONEG_FL_ENABLE   0x04

Enable link.

Definition at line 341 of file intelxl.h.

◆ INTELXL_ADMIN_LINK

#define INTELXL_ADMIN_LINK   0x0607

Admin queue Get Link Status command.

Definition at line 344 of file intelxl.h.

◆ INTELXL_ADMIN_LINK_NOTIFY

#define INTELXL_ADMIN_LINK_NOTIFY   0x03

Notify driver of link status changes.

Definition at line 363 of file intelxl.h.

◆ INTELXL_ADMIN_LINK_UP

#define INTELXL_ADMIN_LINK_UP   0x01

Link is up.

Definition at line 366 of file intelxl.h.

◆ INTELXL_ADMIN_BUFFER_SIZE

#define INTELXL_ADMIN_BUFFER_SIZE   0x1000

Maximum size of a data buffer.

Definition at line 399 of file intelxl.h.

◆ INTELXL_ADMIN_FL_DD

#define INTELXL_ADMIN_FL_DD   0x0001

Admin descriptor done.

Definition at line 434 of file intelxl.h.

◆ INTELXL_ADMIN_FL_CMP

#define INTELXL_ADMIN_FL_CMP   0x0002

Admin descriptor contains a completion.

Definition at line 437 of file intelxl.h.

◆ INTELXL_ADMIN_FL_ERR

#define INTELXL_ADMIN_FL_ERR   0x0004

Admin descriptor completed in error.

Definition at line 440 of file intelxl.h.

◆ INTELXL_ADMIN_FL_RD

#define INTELXL_ADMIN_FL_RD   0x0400

Admin descriptor uses data buffer for command parameters.

Definition at line 443 of file intelxl.h.

◆ INTELXL_ADMIN_FL_BUF

#define INTELXL_ADMIN_FL_BUF   0x1000

Admin descriptor uses data buffer.

Definition at line 446 of file intelxl.h.

◆ INTELXL_ADMIN_EEXIST

#define INTELXL_ADMIN_EEXIST   13

Error: attempt to create something that already exists.

Definition at line 449 of file intelxl.h.

◆ INTELXL_ADMIN_NUM_DESC

#define INTELXL_ADMIN_NUM_DESC   4

Number of admin queue descriptors.

Definition at line 484 of file intelxl.h.

◆ INTELXL_ADMIN_MAX_WAIT_MS

#define INTELXL_ADMIN_MAX_WAIT_MS   100

Maximum time to wait for an admin request to complete.

Definition at line 487 of file intelxl.h.

◆ INTELXL_ADMIN_API_MAJOR

#define INTELXL_ADMIN_API_MAJOR   1

Admin queue API major version.

Definition at line 490 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXDATA

#define INTELXL_PFCM_LANCTXDATA (   x)    ( 0x10c100 + ( 0x80 * (x) ) )

CMLAN Context Data Register.

Definition at line 500 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL

#define INTELXL_PFCM_LANCTXCTL   0x10c300

CMLAN Context Control Register.

Definition at line 503 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_QUEUE_NUM

#define INTELXL_PFCM_LANCTXCTL_QUEUE_NUM (   x)    ( (x) << 0 )

Queue number.

Definition at line 504 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_SUB_LINE

#define INTELXL_PFCM_LANCTXCTL_SUB_LINE (   x)    ( (x) << 12 )

Sub-line.

Definition at line 507 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_TYPE

#define INTELXL_PFCM_LANCTXCTL_TYPE (   x)    ( (x) << 15 )

Queue type.

Definition at line 510 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_TYPE_RX

#define INTELXL_PFCM_LANCTXCTL_TYPE_RX   INTELXL_PFCM_LANCTXCTL_TYPE ( 0x0 )

RX queue type.

Definition at line 513 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_TYPE_TX

#define INTELXL_PFCM_LANCTXCTL_TYPE_TX   INTELXL_PFCM_LANCTXCTL_TYPE ( 0x1 )

TX queue type.

Definition at line 515 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE

#define INTELXL_PFCM_LANCTXCTL_OP_CODE (   x)    ( (x) << 17 )

Op code.

Definition at line 517 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE_READ

#define INTELXL_PFCM_LANCTXCTL_OP_CODE_READ   INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x0 )

Read context.

Definition at line 520 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE

#define INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE   INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x1 )

Write context.

Definition at line 522 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXSTAT

#define INTELXL_PFCM_LANCTXSTAT   0x10c380

CMLAN Context Status Register.

Definition at line 526 of file intelxl.h.

◆ INTELXL_PFCM_LANCTXSTAT_DONE

#define INTELXL_PFCM_LANCTXSTAT_DONE   0x00000001UL

Complete.

Definition at line 527 of file intelxl.h.

◆ INTELXL_CTX_TX_FL_NEW

#define INTELXL_CTX_TX_FL_NEW   0x4000

New transmit queue context.

Definition at line 556 of file intelxl.h.

◆ INTELXL_CTX_TX_BASE

#define INTELXL_CTX_TX_BASE (   base)    ( (base) >> 7 )

Transmit queue base address.

Definition at line 559 of file intelxl.h.

◆ INTELXL_CTX_TX_COUNT

#define INTELXL_CTX_TX_COUNT (   count)    ( (count) << 1 )

Transmit queue count.

Definition at line 562 of file intelxl.h.

◆ INTELXL_CTX_TX_QSET

#define INTELXL_CTX_TX_QSET (   qset)    ( (qset) << 4 )

Transmit queue set.

Definition at line 565 of file intelxl.h.

◆ INTELXL_CTX_RX_BASE_COUNT

#define INTELXL_CTX_RX_BASE_COUNT (   base,
  count 
)    ( ( (base) >> 7 ) | ( ( ( uint64_t ) (count) ) << 57 ) )

Receive queue base address and queue count.

Definition at line 588 of file intelxl.h.

◆ INTELXL_CTX_RX_LEN

#define INTELXL_CTX_RX_LEN (   len)    ( (len) >> 1 )

Receive queue data buffer length.

Definition at line 592 of file intelxl.h.

◆ INTELXL_CTX_RX_FL_DSIZE

#define INTELXL_CTX_RX_FL_DSIZE   0x10

Use 32-byte receive descriptors.

Definition at line 595 of file intelxl.h.

◆ INTELXL_CTX_RX_FL_CRCSTRIP

#define INTELXL_CTX_RX_FL_CRCSTRIP   0x20

Strip CRC from received packets.

Definition at line 598 of file intelxl.h.

◆ INTELXL_CTX_RX_MFS

#define INTELXL_CTX_RX_MFS (   mfs)    ( (mfs) >> 2 )

Receive queue maximum frame size.

Definition at line 601 of file intelxl.h.

◆ INTELXL_CTX_MAX_WAIT_MS

#define INTELXL_CTX_MAX_WAIT_MS   100

Maximum time to wait for a context operation to complete.

Definition at line 604 of file intelxl.h.

◆ INTELXL_QUEUE_ENABLE_DELAY_US

#define INTELXL_QUEUE_ENABLE_DELAY_US   20

Time to wait for a queue to become enabled.

Definition at line 607 of file intelxl.h.

◆ INTELXL_QUEUE_PRE_DISABLE_DELAY_US

#define INTELXL_QUEUE_PRE_DISABLE_DELAY_US   400

Time to wait for a transmit queue to become pre-disabled.

Definition at line 610 of file intelxl.h.

◆ INTELXL_QUEUE_DISABLE_MAX_WAIT_MS

#define INTELXL_QUEUE_DISABLE_MAX_WAIT_MS   1000

Maximum time to wait for a queue to become disabled.

Definition at line 613 of file intelxl.h.

◆ INTELXL_QTX_HEAD

#define INTELXL_QTX_HEAD (   x)    ( 0x0e4000 + ( 0x4 * (x) ) )

Global Transmit Queue Head register.

Definition at line 623 of file intelxl.h.

◆ INTELXL_GLLAN_TXPRE_QDIS

#define INTELXL_GLLAN_TXPRE_QDIS (   x)    ( 0x0e6500 + ( 0x4 * ( (x) / 0x80 ) ) )

Global Transmit Pre Queue Disable register.

Definition at line 626 of file intelxl.h.

◆ INTELXL_GLLAN_TXPRE_QDIS_QINDX

#define INTELXL_GLLAN_TXPRE_QDIS_QINDX (   x)    ( (x) << 0 )

Queue index.

Definition at line 627 of file intelxl.h.

◆ INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS

#define INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS   0x40000000UL

Set disable.

Definition at line 630 of file intelxl.h.

◆ INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS

#define INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS   0x80000000UL

Clear disable.

Definition at line 632 of file intelxl.h.

◆ INTELXL_QTX

#define INTELXL_QTX (   x)    ( 0x100000 + ( 0x4 * (x) ) )

Global Transmit Queue register block.

Definition at line 636 of file intelxl.h.

◆ INTELXL_QRX

#define INTELXL_QRX (   x)    ( 0x120000 + ( 0x4 * (x) ) )

Global Receive Queue register block.

Definition at line 639 of file intelxl.h.

◆ INTELXL_QXX_ENA

#define INTELXL_QXX_ENA   0x0000

Queue Enable Register (offset)

Definition at line 642 of file intelxl.h.

◆ INTELXL_QXX_ENA_REQ

#define INTELXL_QXX_ENA_REQ   0x00000001UL

Enable request.

Definition at line 643 of file intelxl.h.

◆ INTELXL_QXX_ENA_STAT

#define INTELXL_QXX_ENA_STAT   0x00000004UL

Enabled status.

Definition at line 644 of file intelxl.h.

◆ INTELXL_QXX_CTL

#define INTELXL_QXX_CTL   0x4000

Queue Control Register (offset)

Definition at line 647 of file intelxl.h.

◆ INTELXL_QXX_CTL_PFVF_Q

#define INTELXL_QXX_CTL_PFVF_Q (   x)    ( (x) << 0 )

PF/VF queue.

Definition at line 648 of file intelxl.h.

◆ INTELXL_QXX_CTL_PFVF_Q_PF

#define INTELXL_QXX_CTL_PFVF_Q_PF   INTELXL_QXX_CTL_PFVF_Q ( 0x2 )

PF queue.

Definition at line 649 of file intelxl.h.

◆ INTELXL_QXX_CTL_PFVF_PF_INDX

#define INTELXL_QXX_CTL_PFVF_PF_INDX (   x)    ( (x) << 2 )

PF index.

Definition at line 651 of file intelxl.h.

◆ INTELXL_QXX_TAIL

#define INTELXL_QXX_TAIL   0x8000

Queue Tail Pointer Register (offset)

Definition at line 654 of file intelxl.h.

◆ INTELXL_TX_DATA_DTYP

#define INTELXL_TX_DATA_DTYP   0x0

Transmit data descriptor type.

Definition at line 667 of file intelxl.h.

◆ INTELXL_TX_DATA_EOP

#define INTELXL_TX_DATA_EOP   0x10

Transmit data descriptor end of packet.

Definition at line 670 of file intelxl.h.

◆ INTELXL_TX_DATA_RS

#define INTELXL_TX_DATA_RS   0x20

Transmit data descriptor report status.

Definition at line 673 of file intelxl.h.

◆ INTELXL_TX_DATA_JFDI

#define INTELXL_TX_DATA_JFDI   0x40

Transmit data descriptor pretty please.

This bit is completely missing from older versions of the XL710 datasheet. Later versions describe it innocuously as "reserved, must be 1". Without this bit, everything will appear to work (up to and including the port "transmit good octets" counter), but no packet will actually be sent.

Definition at line 683 of file intelxl.h.

◆ INTELXL_TX_DATA_LEN

#define INTELXL_TX_DATA_LEN (   len)    ( (len) << 2 )

Transmit data descriptor length.

Definition at line 686 of file intelxl.h.

◆ INTELXL_TX_WB_FL_DD

#define INTELXL_TX_WB_FL_DD   0x01

Transmit writeback descriptor complete.

Definition at line 699 of file intelxl.h.

◆ INTELXL_RX_WB_FL_DD

#define INTELXL_RX_WB_FL_DD   0x00000001UL

Receive writeback descriptor complete.

Definition at line 736 of file intelxl.h.

◆ INTELXL_RX_WB_FL_VLAN

#define INTELXL_RX_WB_FL_VLAN   0x00000004UL

Receive writeback descriptor VLAN tag present.

Definition at line 739 of file intelxl.h.

◆ INTELXL_RX_WB_FL_RXE

#define INTELXL_RX_WB_FL_RXE   0x00080000UL

Receive writeback descriptor error.

Definition at line 742 of file intelxl.h.

◆ INTELXL_RX_WB_LEN

#define INTELXL_RX_WB_LEN (   len)    ( ( (len) >> 6 ) & 0x3fff )

Receive writeback descriptor length.

Definition at line 745 of file intelxl.h.

◆ INTELXL_TX_NUM_DESC

#define INTELXL_TX_NUM_DESC   64

Number of transmit descriptors.

Chosen to exceed the receive ring fill level, in order to avoid running out of transmit descriptors when sending TCP ACKs.

Definition at line 809 of file intelxl.h.

◆ INTELXL_TX_FILL

#define INTELXL_TX_FILL   ( INTELXL_TX_NUM_DESC - 1 )

Transmit descriptor ring maximum fill level.

Definition at line 812 of file intelxl.h.

◆ INTELXL_RX_NUM_DESC

#define INTELXL_RX_NUM_DESC   64

Number of receive descriptors.

Must be a multiple of 32 and greater than or equal to 64.

Definition at line 818 of file intelxl.h.

◆ INTELXL_RX_FILL

#define INTELXL_RX_FILL   16

Receive descriptor ring fill level.

Must be a multiple of 8 and greater than 8.

Definition at line 824 of file intelxl.h.

◆ INTELXL_MAX_PKT_LEN

#define INTELXL_MAX_PKT_LEN   ( 9728 - 4 /* CRC */ )

Maximum packet length (excluding CRC)

Definition at line 827 of file intelxl.h.

◆ INTELXL_PFINT_DYN_CTL0

#define INTELXL_PFINT_DYN_CTL0   0x038480

PF Interrupt Zero Dynamic Control Register.

Definition at line 837 of file intelxl.h.

◆ INTELXL_INT_DYN_CTL_INTENA

#define INTELXL_INT_DYN_CTL_INTENA   0x00000001UL

Enable.

Definition at line 838 of file intelxl.h.

◆ INTELXL_INT_DYN_CTL_CLEARPBA

#define INTELXL_INT_DYN_CTL_CLEARPBA   0x00000002UL

Acknowledge.

Definition at line 839 of file intelxl.h.

◆ INTELXL_INT_DYN_CTL_INTENA_MASK

#define INTELXL_INT_DYN_CTL_INTENA_MASK   0x80000000UL

Ignore enable.

Definition at line 840 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0

#define INTELXL_PFINT_LNKLST0   0x038500

PF Interrupt Zero Linked List Register.

Definition at line 843 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_INDX

#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX (   x)    ( (x) << 0 )

Queue index.

Definition at line 844 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_INDX_NONE

#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX_NONE   INTELXL_PFINT_LNKLST0_FIRSTQ_INDX ( 0x7ff )

End of list.

Definition at line 847 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE

#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE (   x)    ( (x) << 11 )

Queue type.

Definition at line 849 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX

#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX   INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x0 )

Receive queue.

Definition at line 852 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX

#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX   INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 854 of file intelxl.h.

◆ INTELXL_PFINT_ICR0_ENA

#define INTELXL_PFINT_ICR0_ENA   0x038800

PF Interrupt Zero Cause Enablement Register.

Definition at line 858 of file intelxl.h.

◆ INTELXL_PFINT_ICR0_ENA_ADMINQ

#define INTELXL_PFINT_ICR0_ENA_ADMINQ   0x40000000UL

Admin event.

Definition at line 859 of file intelxl.h.

◆ INTELXL_QINT_RQCTL

#define INTELXL_QINT_RQCTL (   x)    ( 0x03a000 + ( 0x4 * (x) ) )

Receive Queue Interrupt Cause Control Register.

Definition at line 862 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_NEXTQ_INDX

#define INTELXL_QINT_RQCTL_NEXTQ_INDX (   x)    ( (x) << 16 )

Queue index.

Definition at line 863 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_NEXTQ_INDX_NONE

#define INTELXL_QINT_RQCTL_NEXTQ_INDX_NONE   INTELXL_QINT_RQCTL_NEXTQ_INDX ( 0x7ff )

End of list.

Definition at line 864 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_NEXTQ_TYPE

#define INTELXL_QINT_RQCTL_NEXTQ_TYPE (   x)    ( (x) << 27 )

Queue type.

Definition at line 866 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_NEXTQ_TYPE_RX

#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_RX   INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x0 )

Receive queue.

Definition at line 867 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX

#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX   INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 869 of file intelxl.h.

◆ INTELXL_QINT_RQCTL_CAUSE_ENA

#define INTELXL_QINT_RQCTL_CAUSE_ENA   0x40000000UL

Enable.

Definition at line 871 of file intelxl.h.

◆ INTELXL_QINT_TQCTL

#define INTELXL_QINT_TQCTL (   x)    ( 0x03c000 + ( 0x4 * (x) ) )

Transmit Queue Interrupt Cause Control Register.

Definition at line 874 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_NEXTQ_INDX

#define INTELXL_QINT_TQCTL_NEXTQ_INDX (   x)    ( (x) << 16 )

Queue index.

Definition at line 875 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_NEXTQ_INDX_NONE

#define INTELXL_QINT_TQCTL_NEXTQ_INDX_NONE   INTELXL_QINT_TQCTL_NEXTQ_INDX ( 0x7ff )

End of list.

Definition at line 876 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_NEXTQ_TYPE

#define INTELXL_QINT_TQCTL_NEXTQ_TYPE (   x)    ( (x) << 27 )

Queue type.

Definition at line 878 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_NEXTQ_TYPE_RX

#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_RX   INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x0 )

Receive queue.

Definition at line 879 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX

#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX   INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 881 of file intelxl.h.

◆ INTELXL_QINT_TQCTL_CAUSE_ENA

#define INTELXL_QINT_TQCTL_CAUSE_ENA   0x40000000UL

Enable.

Definition at line 883 of file intelxl.h.

◆ INTELXL_PFFUNC_RID

#define INTELXL_PFFUNC_RID   0x09c000

Function Requester ID Information Register.

Definition at line 886 of file intelxl.h.

◆ INTELXL_PFFUNC_RID_FUNC_NUM

#define INTELXL_PFFUNC_RID_FUNC_NUM (   x)    ( ( (x) >> 0 ) & 0x7 )

Function number.

Definition at line 887 of file intelxl.h.

◆ INTELXL_PFLAN_QALLOC

#define INTELXL_PFLAN_QALLOC   0x1c0400

PF Queue Allocation Register.

Definition at line 892 of file intelxl.h.

◆ INTELXL_PFLAN_QALLOC_FIRSTQ

#define INTELXL_PFLAN_QALLOC_FIRSTQ (   x)    ( ( (x) >> 0 ) & 0x7ff )

First queue.

Definition at line 893 of file intelxl.h.

◆ INTELXL_PFLAN_QALLOC_LASTQ

#define INTELXL_PFLAN_QALLOC_LASTQ (   x)    ( ( (x) >> 16 ) & 0x7ff )

Last queue.

Definition at line 896 of file intelxl.h.

◆ INTELXL_PFGEN_PORTNUM

#define INTELXL_PFGEN_PORTNUM   0x1c0480

PF LAN Port Number Register.

Definition at line 901 of file intelxl.h.

◆ INTELXL_PFGEN_PORTNUM_PORT_NUM

#define INTELXL_PFGEN_PORTNUM_PORT_NUM (   x)    ( ( (x) >> 0 ) & 0x3 )

Port number.

Definition at line 902 of file intelxl.h.

◆ INTELXL_MSIX_VECTOR

#define INTELXL_MSIX_VECTOR   0

MSI-X interrupt vector.

Definition at line 907 of file intelxl.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ intelxl_init_admin()

static void intelxl_init_admin ( struct intelxl_admin admin,
unsigned int  base,
const struct intelxl_admin_offsets regs 
)
inlinestatic

Initialise admin queue.

Parameters
adminAdmin queue
baseRegister block base
regsRegister offsets

Definition at line 476 of file intelxl.h.

477  {
478 
479  admin->base = base;
480  admin->regs = regs;
481 }
uint32_t base
Base.
Definition: librm.h:138
unsigned int base
Register block base.
Definition: intelxl.h:463
struct i386_regs regs
Definition: registers.h:15
const struct intelxl_admin_offsets * regs
Register offsets.
Definition: intelxl.h:465

References base, intelxl_admin::base, regs, and intelxl_admin::regs.

Referenced by ice_probe(), intelxl_probe(), and intelxlvf_probe().

◆ intelxl_init_ring()

static void intelxl_init_ring ( struct intelxl_ring ring,
unsigned int  count,
size_t  len,
int(*)(struct intelxl_nic *intelxl, physaddr_t address context 
)
inlinestatic

Initialise descriptor ring.

Parameters
ringDescriptor ring
countNumber of descriptors
lenLength of a single descriptor
contextMethod to program queue context

Definition at line 796 of file intelxl.h.

899  {

Referenced by ice_probe(), and intelxl_probe().

◆ intelxl_msix_enable()

int intelxl_msix_enable ( struct intelxl_nic intelxl,
struct pci_device pci,
unsigned int  vector 
)

Enable MSI-X dummy interrupt.

Parameters
intelxlIntel device
pciPCI device
vectorMSI-X vector
Return values
rcReturn status code

Definition at line 63 of file intelxl.c.

64  {
65  int rc;
66 
67  /* Enable MSI-X capability */
68  if ( ( rc = pci_msix_enable ( pci, &intelxl->msix ) ) != 0 ) {
69  DBGC ( intelxl, "INTELXL %p could not enable MSI-X: %s\n",
70  intelxl, strerror ( rc ) );
71  goto err_enable;
72  }
73 
74  /* Enable dummy interrupt */
75  pci_msix_unmask ( &intelxl->msix, vector );
76 
77  return 0;
78 
79  pci_msix_disable ( pci, &intelxl->msix );
80  err_enable:
81  return rc;
82 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
void pci_msix_disable(struct pci_device *pci, struct pci_msix *msix)
Disable MSI-X interrupts.
Definition: pcimsix.c:208
uint32_t vector
MSI-X vector.
Definition: ena.h:20
#define DBGC(...)
Definition: compiler.h:505
static void pci_msix_unmask(struct pci_msix *msix, unsigned int vector)
Unmask MSI-X interrupt vector.
Definition: pcimsix.h:77
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:79
struct pci_msix msix
MSI-X interrupt.
Definition: intelxl.h:939
int pci_msix_enable(struct pci_device *pci, struct pci_msix *msix)
Enable MSI-X interrupts.
Definition: pcimsix.c:137

References DBGC, intelxl_nic::msix, pci_msix_disable(), pci_msix_enable(), pci_msix_unmask(), rc, strerror(), and vector.

Referenced by ice_probe(), intelxl_probe(), and intelxlvf_probe().

◆ intelxl_msix_disable()

void intelxl_msix_disable ( struct intelxl_nic intelxl,
struct pci_device pci,
unsigned int  vector 
)

Disable MSI-X dummy interrupt.

Parameters
intelxlIntel device
pciPCI device
vectorMSI-X vector

Definition at line 91 of file intelxl.c.

92  {
93 
94  /* Disable dummy interrupts */
95  pci_msix_mask ( &intelxl->msix, vector );
96 
97  /* Disable MSI-X capability */
98  pci_msix_disable ( pci, &intelxl->msix );
99 }
void pci_msix_disable(struct pci_device *pci, struct pci_msix *msix)
Disable MSI-X interrupts.
Definition: pcimsix.c:208
uint32_t vector
MSI-X vector.
Definition: ena.h:20
static void pci_msix_mask(struct pci_msix *msix, unsigned int vector)
Mask MSI-X interrupt vector.
Definition: pcimsix.h:65
struct pci_msix msix
MSI-X interrupt.
Definition: intelxl.h:939

References 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().

◆ intelxl_admin_command_descriptor()

struct intelxl_admin_descriptor* intelxl_admin_command_descriptor ( struct intelxl_nic intelxl)

Get next admin command queue descriptor.

Parameters
intelxlIntel device
Return values
cmdCommand descriptor

Definition at line 222 of file intelxl.c.

222  {
223  struct intelxl_admin *admin = &intelxl->command;
225 
226  /* Get and initialise next descriptor */
227  cmd = &admin->desc[ admin->index % INTELXL_ADMIN_NUM_DESC ];
228  memset ( cmd, 0, sizeof ( *cmd ) );
229  return cmd;
230 }
Admin queue.
Definition: intelxl.h:452
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition: intelxl.h:484
unsigned int index
Queue index.
Definition: intelxl.h:460
struct intelxl_admin_descriptor * desc
Descriptors.
Definition: intelxl.h:454
Admin queue descriptor.
Definition: intelxl.h:416
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29
void * memset(void *dest, int character, size_t len) __nonnull

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

◆ intelxl_admin_command_buffer()

union intelxl_admin_buffer* intelxl_admin_command_buffer ( struct intelxl_nic intelxl)

Get next admin command queue data buffer.

Parameters
intelxlIntel device
Return values
bufData buffer

Definition at line 239 of file intelxl.c.

239  {
240  struct intelxl_admin *admin = &intelxl->command;
241  union intelxl_admin_buffer *buf;
242 
243  /* Get next data buffer */
244  buf = &admin->buf[ admin->index % INTELXL_ADMIN_NUM_DESC ];
245  memset ( buf, 0, sizeof ( *buf ) );
246  return buf;
247 }
union intelxl_admin_buffer * buf
Data buffers.
Definition: intelxl.h:456
Admin queue.
Definition: intelxl.h:452
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition: intelxl.h:484
unsigned int index
Queue index.
Definition: intelxl.h:460
Admin queue data buffer.
Definition: intelxl.h:402
void * memset(void *dest, int character, size_t len) __nonnull

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

◆ intelxl_admin_command()

int intelxl_admin_command ( struct intelxl_nic intelxl)

Issue admin queue command.

Parameters
intelxlIntel device
Return values
rcReturn status code

Definition at line 278 of file intelxl.c.

278  {
279  struct intelxl_admin *admin = &intelxl->command;
280  const struct intelxl_admin_offsets *regs = admin->regs;
281  void *admin_regs = ( intelxl->regs + admin->base );
283  union intelxl_admin_buffer *buf;
285  uint32_t cookie;
286  uint16_t silence;
287  unsigned int index;
288  unsigned int tail;
289  unsigned int i;
290  int rc;
291 
292  /* Get next queue entry */
293  index = admin->index++;
294  tail = ( admin->index % INTELXL_ADMIN_NUM_DESC );
295  cmd = &admin->desc[ index % INTELXL_ADMIN_NUM_DESC ];
296  buf = &admin->buf[ index % INTELXL_ADMIN_NUM_DESC ];
297  DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x",
298  intelxl, index, le16_to_cpu ( cmd->opcode ) );
299  if ( cmd->cookie )
300  DBGC2 ( intelxl, "/%#08x", le32_to_cpu ( cmd->cookie ) );
301  DBGC2 ( intelxl, ":\n" );
302 
303  /* Allow expected errors to be silenced */
304  silence = cmd->ret;
305  cmd->ret = 0;
306 
307  /* Sanity checks */
308  assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) );
309  assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_CMP ) ) );
310  assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_ERR ) ) );
311 
312  /* Populate data buffer address if applicable */
313  if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
314  address = dma ( &admin->map, buf );
315  cmd->params.buffer.high = cpu_to_le32 ( address >> 32 );
316  cmd->params.buffer.low = cpu_to_le32 ( address & 0xffffffffUL );
317  }
318 
319  /* Populate cookie, if not being (ab)used for VF opcode */
320  if ( ! cmd->cookie )
321  cmd->cookie = cpu_to_le32 ( index );
322 
323  /* Record cookie */
324  cookie = cmd->cookie;
325 
326  /* Post command descriptor */
327  DBGC2_HDA ( intelxl, virt_to_phys ( cmd ), cmd, sizeof ( *cmd ) );
328  if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_RD ) ) {
329  DBGC2_HDA ( intelxl, virt_to_phys ( buf ), buf,
330  le16_to_cpu ( cmd->len ) );
331  }
332  wmb();
333  writel ( tail, admin_regs + regs->tail );
334 
335  /* Wait for completion */
336  for ( i = 0 ; i < INTELXL_ADMIN_MAX_WAIT_MS ; i++ ) {
337 
338  /* If response is not complete, delay 1ms and retry */
339  if ( ! ( cmd->flags & INTELXL_ADMIN_FL_DD ) ) {
340  mdelay ( 1 );
341  continue;
342  }
343  DBGC2 ( intelxl, "INTELXL %p admin command %#x response:\n",
344  intelxl, index );
345  DBGC2_HDA ( intelxl, virt_to_phys ( cmd ), cmd,
346  sizeof ( *cmd ) );
347  if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
348  DBGC2_HDA ( intelxl, virt_to_phys ( buf ), buf,
349  le16_to_cpu ( cmd->len ) );
350  }
351 
352  /* Check for cookie mismatch */
353  if ( cmd->cookie != cookie ) {
354  DBGC ( intelxl, "INTELXL %p admin command %#x bad "
355  "cookie %#x\n", intelxl, index,
356  le32_to_cpu ( cmd->cookie ) );
357  rc = -EPROTO;
358  goto err;
359  }
360 
361  /* Check for unexpected errors */
362  if ( ( cmd->ret != 0 ) && ( cmd->ret != silence ) ) {
363  DBGC ( intelxl, "INTELXL %p admin command %#x error "
364  "%d\n", intelxl, index,
365  le16_to_cpu ( cmd->ret ) );
366  rc = -EIO;
367  goto err;
368  }
369 
370  /* Success */
371  return 0;
372  }
373 
374  rc = -ETIMEDOUT;
375  DBGC ( intelxl, "INTELXL %p timed out waiting for admin command %#x:\n",
376  intelxl, index );
377  err:
378  DBGC_HDA ( intelxl, virt_to_phys ( cmd ), cmd, sizeof ( *cmd ) );
379  return rc;
380 }
void * regs
Registers.
Definition: intelxl.h:912
#define INTELXL_ADMIN_FL_ERR
Admin descriptor completed in error.
Definition: intelxl.h:440
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
unsigned short uint16_t
Definition: stdint.h:11
wmb()
#define le32_to_cpu(value)
Definition: byteswap.h:114
union intelxl_admin_buffer * buf
Data buffers.
Definition: intelxl.h:456
Admin queue register offsets.
Definition: intelxl.h:64
uint64_t address
Base address.
Definition: ena.h:24
Admin queue.
Definition: intelxl.h:452
#define DBGC(...)
Definition: compiler.h:505
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
long index
Definition: bigint.h:65
unsigned long long uint64_t
Definition: stdint.h:13
unsigned int base
Register block base.
Definition: intelxl.h:463
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition: intelxl.h:484
#define INTELXL_ADMIN_FL_CMP
Admin descriptor contains a completion.
Definition: intelxl.h:437
unsigned int index
Queue index.
Definition: intelxl.h:460
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define DBGC_HDA(...)
Definition: compiler.h:506
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
struct dma_mapping map
DMA mapping.
Definition: intelxl.h:458
#define cpu_to_le32(value)
Definition: byteswap.h:108
#define EPROTO
Protocol error.
Definition: errno.h:625
#define DBGC2_HDA(...)
Definition: compiler.h:523
struct intelxl_admin_descriptor * desc
Descriptors.
Definition: intelxl.h:454
#define INTELXL_ADMIN_FL_BUF
Admin descriptor uses data buffer.
Definition: intelxl.h:446
#define le16_to_cpu(value)
Definition: byteswap.h:113
unsigned int uint32_t
Definition: stdint.h:12
struct i386_regs regs
Definition: registers.h:15
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition: timer.c:79
Admin queue descriptor.
Definition: intelxl.h:416
#define DBGC2(...)
Definition: compiler.h:522
#define EIO
Input/output error.
Definition: errno.h:434
#define cpu_to_le16(value)
Definition: byteswap.h:107
const struct intelxl_admin_offsets * regs
Register offsets.
Definition: intelxl.h:465
#define INTELXL_ADMIN_FL_RD
Admin descriptor uses data buffer for command parameters.
Definition: intelxl.h:443
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29
#define INTELXL_ADMIN_MAX_WAIT_MS
Maximum time to wait for an admin request to complete.
Definition: intelxl.h:487
#define ETIMEDOUT
Connection timed out.
Definition: errno.h:670
#define INTELXL_ADMIN_FL_DD
Admin descriptor done.
Definition: intelxl.h:434
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
Admin queue data buffer.
Definition: intelxl.h:402

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

◆ intelxl_admin_clear_pxe()

int intelxl_admin_clear_pxe ( struct intelxl_nic intelxl)

Clear PXE mode.

Parameters
intelxlIntel device
Return values
rcReturn status code

Definition at line 561 of file intelxl.c.

561  {
563  struct intelxl_admin_clear_pxe_params *pxe;
564  int rc;
565 
566  /* Populate descriptor */
570  pxe = &cmd->params.pxe;
572 
573  /* Issue command */
574  if ( ( rc = intelxl_admin_command ( intelxl ) ) != 0 )
575  return rc;
576 
577  /* Check for expected errors */
578  if ( cmd->ret == cpu_to_le16 ( INTELXL_ADMIN_EEXIST ) ) {
579  DBGC ( intelxl, "INTELXL %p already in non-PXE mode\n",
580  intelxl );
581  return 0;
582  }
583 
584  return 0;
585 }
struct intelxl_admin_descriptor * intelxl_admin_command_descriptor(struct intelxl_nic *intelxl)
Get next admin command queue descriptor.
Definition: intelxl.c:222
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC(...)
Definition: compiler.h:505
Admin queue Clear PXE Mode command parameters.
Definition: intelxl.h:196
#define INTELXL_ADMIN_CLEAR_PXE_MAGIC
Clear PXE Mode magic value.
Definition: intelxl.h:204
uint8_t magic
Magic value.
Definition: intelxl.h:198
#define INTELXL_ADMIN_EEXIST
Error: attempt to create something that already exists.
Definition: intelxl.h:449
int intelxl_admin_command(struct intelxl_nic *intelxl)
Issue admin queue command.
Definition: intelxl.c:278
Admin queue descriptor.
Definition: intelxl.h:416
#define cpu_to_le16(value)
Definition: byteswap.h:107
#define INTELXL_ADMIN_CLEAR_PXE
Admin queue Clear PXE Mode command.
Definition: intelxl.h:193
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29

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

◆ intelxl_admin_mac_config()

int intelxl_admin_mac_config ( struct intelxl_nic intelxl)

Set MAC configuration.

Parameters
intelxlIntel device
Return values
rcReturn status code

Definition at line 712 of file intelxl.c.

712  {
714  struct intelxl_admin_mac_config_params *config;
715  int rc;
716 
717  /* Populate descriptor */
720  config = &cmd->params.mac_config;
721  config->mfs = cpu_to_le16 ( intelxl->mfs );
723 
724  /* Issue command */
725  if ( ( rc = intelxl_admin_command ( intelxl ) ) != 0 )
726  return rc;
727 
728  return 0;
729 }
struct intelxl_admin_descriptor * intelxl_admin_command_descriptor(struct intelxl_nic *intelxl)
Get next admin command queue descriptor.
Definition: intelxl.c:222
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
size_t mfs
Maximum frame size.
Definition: intelxl.h:916
Admin queue Set MAC Configuration command parameters.
Definition: intelxl.h:314
int intelxl_admin_command(struct intelxl_nic *intelxl)
Issue admin queue command.
Definition: intelxl.c:278
#define INTELXL_ADMIN_MAC_CONFIG
Admin queue Set MAC Configuration command.
Definition: intelxl.h:311
Admin queue descriptor.
Definition: intelxl.h:416
uint16_t mfs
Maximum frame size.
Definition: intelxl.h:316
#define cpu_to_le16(value)
Definition: byteswap.h:107
#define INTELXL_ADMIN_MAC_CONFIG_FL_CRC
Append CRC on transmit.
Definition: intelxl.h:324
struct golan_eqe_cmd cmd
Definition: CIB_PRM.h:29

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

◆ intelxl_poll_admin()

void intelxl_poll_admin ( struct net_device netdev)

Poll admin event queue.

Parameters
netdevNetwork device

Definition at line 836 of file intelxl.c.

836  {
837  struct intelxl_nic *intelxl = netdev->priv;
838  struct intelxl_admin *admin = &intelxl->event;
839  struct intelxl_admin_descriptor *evt;
840  union intelxl_admin_buffer *buf;
841 
842  /* Check for events */
843  while ( 1 ) {
844 
845  /* Get next event descriptor and data buffer */
846  evt = &admin->desc[ admin->index % INTELXL_ADMIN_NUM_DESC ];
847  buf = &admin->buf[ admin->index % INTELXL_ADMIN_NUM_DESC ];
848 
849  /* Stop if descriptor is not yet completed */
850  if ( ! ( evt->flags & INTELXL_ADMIN_FL_DD ) )
851  return;
852  DBGC2 ( intelxl, "INTELXL %p admin event %#x:\n",
853  intelxl, admin->index );
854  DBGC2_HDA ( intelxl, virt_to_phys ( evt ), evt,
855  sizeof ( *evt ) );
856  if ( evt->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
857  DBGC2_HDA ( intelxl, virt_to_phys ( buf ), buf,
858  le16_to_cpu ( evt->len ) );
859  }
860 
861  /* Handle event */
862  intelxl->handle ( netdev, evt, buf );
863 
864  /* Reset descriptor and refill queue */
865  intelxl_admin_event_init ( intelxl, admin->index );
866  admin->index++;
867  intelxl_refill_admin ( intelxl );
868  }
869 }
void(* handle)(struct net_device *netdev, struct intelxl_admin_descriptor *evt, union intelxl_admin_buffer *buf)
Handle admin event.
Definition: intelxl.h:963
union intelxl_admin_buffer * buf
Data buffers.
Definition: intelxl.h:456
Admin queue.
Definition: intelxl.h:452
uint16_t flags
Flags.
Definition: intelxl.h:418
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition: intelxl.h:484
uint16_t len
Data length.
Definition: intelxl.h:422
unsigned int index
Queue index.
Definition: intelxl.h:460
static void intelxl_admin_event_init(struct intelxl_nic *intelxl, unsigned int index)
Initialise admin event queue descriptor.
Definition: intelxl.c:255
void * priv
Driver private data.
Definition: netdevice.h:432
static struct net_device * netdev
Definition: gdbudp.c:52
static void intelxl_refill_admin(struct intelxl_nic *intelxl)
Refill admin event queue.
Definition: intelxl.c:818
#define DBGC2_HDA(...)
Definition: compiler.h:523
struct intelxl_admin_descriptor * desc
Descriptors.
Definition: intelxl.h:454
#define INTELXL_ADMIN_FL_BUF
Admin descriptor uses data buffer.
Definition: intelxl.h:446
An Intel 40 Gigabit network card.
Definition: intelxl.h:910
#define le16_to_cpu(value)
Definition: byteswap.h:113
Admin queue descriptor.
Definition: intelxl.h:416
#define DBGC2(...)
Definition: compiler.h:522
#define cpu_to_le16(value)
Definition: byteswap.h:107
struct intelxl_admin event
Admin event queue.
Definition: intelxl.h:944
#define INTELXL_ADMIN_FL_DD
Admin descriptor done.
Definition: intelxl.h:434
Admin queue data buffer.
Definition: intelxl.h:402

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, and net_device::priv.

Referenced by intelxl_poll(), and intelxlvf_admin_command().

◆ intelxl_open_admin()

int intelxl_open_admin ( struct intelxl_nic intelxl)

Open admin queues.

Parameters
intelxlIntel device
Return values
rcReturn status code

Definition at line 877 of file intelxl.c.

877  {
878  int rc;
879 
880  /* Allocate admin event queue */
881  if ( ( rc = intelxl_alloc_admin ( intelxl, &intelxl->event ) ) != 0 )
882  goto err_alloc_event;
883 
884  /* Allocate admin command queue */
885  if ( ( rc = intelxl_alloc_admin ( intelxl, &intelxl->command ) ) != 0 )
886  goto err_alloc_command;
887 
888  /* (Re)open admin queues */
889  intelxl_reopen_admin ( intelxl );
890 
891  return 0;
892 
893  intelxl_disable_admin ( intelxl, &intelxl->command );
894  intelxl_disable_admin ( intelxl, &intelxl->event );
895  intelxl_free_admin ( intelxl, &intelxl->command );
896  err_alloc_command:
897  intelxl_free_admin ( intelxl, &intelxl->event );
898  err_alloc_event:
899  return rc;
900 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
static int intelxl_alloc_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Allocate admin queue.
Definition: intelxl.c:124
static void intelxl_free_admin(struct intelxl_nic *intelxl __unused, struct intelxl_admin *admin)
Free admin queue.
Definition: intelxl.c:206
static void intelxl_disable_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Disable admin queue.
Definition: intelxl.c:191
void intelxl_reopen_admin(struct intelxl_nic *intelxl)
Reopen admin queues (after virtual function reset)
Definition: intelxl.c:907
struct intelxl_admin event
Admin event queue.
Definition: intelxl.h:944

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

◆ intelxl_reopen_admin()

void intelxl_reopen_admin ( struct intelxl_nic intelxl)

Reopen admin queues (after virtual function reset)

Parameters
intelxlIntel device

Definition at line 907 of file intelxl.c.

907  {
908  unsigned int i;
909 
910  /* Enable admin event queue */
911  intelxl_enable_admin ( intelxl, &intelxl->event );
912 
913  /* Enable admin command queue */
914  intelxl_enable_admin ( intelxl, &intelxl->command );
915 
916  /* Initialise all admin event queue descriptors */
917  for ( i = 0 ; i < INTELXL_ADMIN_NUM_DESC ; i++ )
918  intelxl_admin_event_init ( intelxl, i );
919 
920  /* Post all descriptors to event queue */
921  intelxl_refill_admin ( intelxl );
922 }
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
static void intelxl_enable_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Enable admin queue.
Definition: intelxl.c:152
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition: intelxl.h:484
static void intelxl_admin_event_init(struct intelxl_nic *intelxl, unsigned int index)
Initialise admin event queue descriptor.
Definition: intelxl.c:255
static void intelxl_refill_admin(struct intelxl_nic *intelxl)
Refill admin event queue.
Definition: intelxl.c:818
struct intelxl_admin event
Admin event queue.
Definition: intelxl.h:944

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

◆ intelxl_close_admin()

void intelxl_close_admin ( struct intelxl_nic intelxl)

Close admin queues.

Parameters
intelxlIntel device

Definition at line 929 of file intelxl.c.

929  {
930 
931  /* Shut down admin queues */
932  intelxl_admin_shutdown ( intelxl );
933 
934  /* Disable admin queues */
935  intelxl_disable_admin ( intelxl, &intelxl->command );
936  intelxl_disable_admin ( intelxl, &intelxl->event );
937 
938  /* Free admin queues */
939  intelxl_free_admin ( intelxl, &intelxl->command );
940  intelxl_free_admin ( intelxl, &intelxl->event );
941 }
static int intelxl_admin_shutdown(struct intelxl_nic *intelxl)
Shutdown admin queues.
Definition: intelxl.c:455
struct intelxl_admin command
Admin command queue.
Definition: intelxl.h:942
static void intelxl_free_admin(struct intelxl_nic *intelxl __unused, struct intelxl_admin *admin)
Free admin queue.
Definition: intelxl.c:206
static void intelxl_disable_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Disable admin queue.
Definition: intelxl.c:191
struct intelxl_admin event
Admin event queue.
Definition: intelxl.h:944

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

◆ intelxl_alloc_ring()

int intelxl_alloc_ring ( struct intelxl_nic intelxl,
struct intelxl_ring ring 
)

Allocate descriptor ring.

Parameters
intelxlIntel device
ringDescriptor ring
Return values
rcReturn status code

Definition at line 957 of file intelxl.c.

958  {
959  int rc;
960 
961  /* Allocate descriptor ring */
962  ring->desc.raw = dma_alloc ( intelxl->dma, &ring->map, ring->len,
963  INTELXL_ALIGN );
964  if ( ! ring->desc.raw ) {
965  rc = -ENOMEM;
966  goto err_alloc;
967  }
968 
969  /* Initialise descriptor ring */
970  memset ( ring->desc.raw, 0, ring->len );
971 
972  /* Reset tail pointer */
973  writel ( 0, ( intelxl->regs + ring->tail ) );
974 
975  /* Reset counters */
976  ring->prod = 0;
977  ring->cons = 0;
978 
979  DBGC ( intelxl, "INTELXL %p ring %06x is at [%08lx,%08lx)\n",
980  intelxl, ring->tail, virt_to_phys ( ring->desc.raw ),
981  ( virt_to_phys ( ring->desc.raw ) + ring->len ) );
982 
983  return 0;
984 
985  dma_free ( &ring->map, ring->desc.raw, ring->len );
986  err_alloc:
987  return rc;
988 }
void * regs
Registers.
Definition: intelxl.h:912
size_t len
Length (in bytes)
Definition: intelxl.h:778
struct dma_device * dma
DMA device.
Definition: intelxl.h:914
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC(...)
Definition: compiler.h:505
unsigned int prod
Producer index.
Definition: intelxl.h:769
#define INTELXL_ALIGN
Alignment.
Definition: intelxl.h:27
void dma_free(struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.
#define ENOMEM
Not enough space.
Definition: errno.h:535
unsigned int cons
Consumer index.
Definition: intelxl.h:771
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
void * raw
Raw data.
Definition: intelxl.h:764
union intelxl_ring::@79 desc
Descriptors.
struct dma_mapping map
Descriptor ring DMA mapping.
Definition: intelxl.h:767
void * dma_alloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer.
unsigned int tail
Tail register.
Definition: intelxl.h:776
void * memset(void *dest, int character, size_t len) __nonnull

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, and writel().

Referenced by ice_create_tx(), intelxl_create_ring(), and intelxlvf_open().

◆ intelxl_free_ring()

void intelxl_free_ring ( struct intelxl_nic intelxl,
struct intelxl_ring ring 
)

◆ intelxl_create_ring()

int intelxl_create_ring ( struct intelxl_nic intelxl,
struct intelxl_ring ring 
)

Create descriptor ring.

Parameters
intelxlIntel device
ringDescriptor ring
Return values
rcReturn status code

Definition at line 1266 of file intelxl.c.

1267  {
1269  int rc;
1270 
1271  /* Allocate descriptor ring */
1272  if ( ( rc = intelxl_alloc_ring ( intelxl, ring ) ) != 0 )
1273  goto err_alloc;
1274 
1275  /* Program queue context */
1276  address = dma ( &ring->map, ring->desc.raw );
1277  if ( ( rc = ring->context ( intelxl, address ) ) != 0 )
1278  goto err_context;
1279 
1280  /* Enable ring */
1281  if ( ( rc = intelxl_enable_ring ( intelxl, ring ) ) != 0 )
1282  goto err_enable;
1283 
1284  return 0;
1285 
1286  intelxl_disable_ring ( intelxl, ring );
1287  err_enable:
1288  err_context:
1289  intelxl_free_ring ( intelxl, ring );
1290  err_alloc:
1291  return rc;
1292 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
int(* context)(struct intelxl_nic *intelxl, physaddr_t address)
Program queue context.
Definition: intelxl.h:784
static int intelxl_enable_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Enable descriptor ring.
Definition: intelxl.c:1208
uint64_t address
Base address.
Definition: ena.h:24
static int intelxl_disable_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Disable descriptor ring.
Definition: intelxl.c:1233
void * raw
Raw data.
Definition: intelxl.h:764
union intelxl_ring::@79 desc
Descriptors.
void intelxl_free_ring(struct intelxl_nic *intelxl __unused, struct intelxl_ring *ring)
Free descriptor ring.
Definition: intelxl.c:996
struct dma_mapping map
Descriptor ring DMA mapping.
Definition: intelxl.h:767
unsigned long physaddr_t
Definition: stdint.h:20
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
int intelxl_alloc_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Allocate descriptor ring.
Definition: intelxl.c:957

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

◆ intelxl_destroy_ring()

void intelxl_destroy_ring ( struct intelxl_nic intelxl,
struct intelxl_ring ring 
)

Destroy descriptor ring.

Parameters
intelxlIntel device
ringDescriptor ring

Definition at line 1300 of file intelxl.c.

1301  {
1302  int rc;
1303 
1304  /* Disable ring */
1305  if ( ( rc = intelxl_disable_ring ( intelxl, ring ) ) != 0 ) {
1306  /* Leak memory; there's nothing else we can do */
1307  return;
1308  }
1309 
1310  /* Free descriptor ring */
1311  intelxl_free_ring ( intelxl, ring );
1312 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
static int intelxl_disable_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Disable descriptor ring.
Definition: intelxl.c:1233
void intelxl_free_ring(struct intelxl_nic *intelxl __unused, struct intelxl_ring *ring)
Free descriptor ring.
Definition: intelxl.c:996

References intelxl_disable_ring(), intelxl_free_ring(), and rc.

Referenced by ice_close(), ice_open(), intelxl_close(), and intelxl_open().

◆ intelxl_empty_rx()

void intelxl_empty_rx ( struct intelxl_nic intelxl)

Discard unused receive I/O buffers.

Parameters
intelxlIntel device

Definition at line 1367 of file intelxl.c.

1367  {
1368  unsigned int i;
1369 
1370  /* Discard any unused receive buffers */
1371  for ( i = 0 ; i < INTELXL_RX_NUM_DESC ; i++ ) {
1372  if ( intelxl->rx_iobuf[i] )
1373  free_rx_iob ( intelxl->rx_iobuf[i] );
1374  intelxl->rx_iobuf[i] = NULL;
1375  }
1376 }
struct io_buffer * rx_iobuf[INTELXL_RX_NUM_DESC]
Receive I/O buffers.
Definition: intelxl.h:954
#define INTELXL_RX_NUM_DESC
Number of receive descriptors.
Definition: intelxl.h:818
void free_rx_iob(struct io_buffer *iobuf)
Unmap and free I/O buffer for receive DMA.
Definition: iobuf.c:215
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

References free_rx_iob(), INTELXL_RX_NUM_DESC, NULL, and intelxl_nic::rx_iobuf.

Referenced by ice_close(), intelxl_close(), and intelxlvf_close().

◆ intelxl_transmit()

int intelxl_transmit ( struct net_device netdev,
struct io_buffer iobuf 
)

Transmit packet.

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

Definition at line 1493 of file intelxl.c.

1493  {
1494  struct intelxl_nic *intelxl = netdev->priv;
1496  unsigned int tx_idx;
1497  unsigned int tx_tail;
1498  size_t len;
1499 
1500  /* Get next transmit descriptor */
1501  if ( ( intelxl->tx.prod - intelxl->tx.cons ) >= INTELXL_TX_FILL ) {
1502  DBGC ( intelxl, "INTELXL %p out of transmit descriptors\n",
1503  intelxl );
1504  return -ENOBUFS;
1505  }
1506  tx_idx = ( intelxl->tx.prod++ % INTELXL_TX_NUM_DESC );
1507  tx_tail = ( intelxl->tx.prod % INTELXL_TX_NUM_DESC );
1508  tx = &intelxl->tx.desc.tx[tx_idx].data;
1509 
1510  /* Populate transmit descriptor */
1511  len = iob_len ( iobuf );
1512  tx->address = cpu_to_le64 ( iob_dma ( iobuf ) );
1513  tx->len = cpu_to_le32 ( INTELXL_TX_DATA_LEN ( len ) );
1516  wmb();
1517 
1518  /* Notify card that there are packets ready to transmit */
1519  writel ( tx_tail, ( intelxl->regs + intelxl->tx.tail ) );
1520 
1521  DBGC2 ( intelxl, "INTELXL %p TX %d is [%08lx,%08lx)\n",
1522  intelxl, tx_idx, virt_to_phys ( iobuf->data ),
1523  ( virt_to_phys ( iobuf->data ) + len ) );
1524  return 0;
1525 }
void * regs
Registers.
Definition: intelxl.h:912
wmb()
#define INTELXL_TX_DATA_EOP
Transmit data descriptor end of packet.
Definition: intelxl.h:670
#define INTELXL_TX_DATA_DTYP
Transmit data descriptor type.
Definition: intelxl.h:667
#define DBGC(...)
Definition: compiler.h:505
unsigned int prod
Producer index.
Definition: intelxl.h:769
#define cpu_to_le64(value)
Definition: byteswap.h:109
union intelxl_tx_descriptor * tx
Transmit descriptors.
Definition: intelxl.h:760
#define INTELXL_TX_DATA_LEN(len)
Transmit data descriptor length.
Definition: intelxl.h:686
unsigned int cons
Consumer index.
Definition: intelxl.h:771
struct intelxl_tx_data_descriptor data
Transmit data descriptor.
Definition: intelxl.h:704
#define INTELXL_TX_NUM_DESC
Number of transmit descriptors.
Definition: intelxl.h:809
void * priv
Driver private data.
Definition: netdevice.h:432
ring len
Length.
Definition: dwmac.h:231
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
static struct net_device * netdev
Definition: gdbudp.c:52
static __always_inline physaddr_t iob_dma(struct io_buffer *iobuf)
Get I/O buffer DMA address.
Definition: iobuf.h:268
union intelxl_ring::@79 desc
Descriptors.
#define cpu_to_le32(value)
Definition: byteswap.h:108
#define INTELXL_TX_DATA_RS
Transmit data descriptor report status.
Definition: intelxl.h:673
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Definition: iobuf.h:160
Transmit data descriptor.
Definition: intelxl.h:657
An Intel 40 Gigabit network card.
Definition: intelxl.h:910
#define INTELXL_TX_DATA_JFDI
Transmit data descriptor pretty please.
Definition: intelxl.h:683
struct intelxl_ring tx
Transmit descriptor ring.
Definition: intelxl.h:950
#define ENOBUFS
No buffer space available.
Definition: errno.h:499
#define DBGC2(...)
Definition: compiler.h:522
void * data
Start of data.
Definition: iobuf.h:53
unsigned int tail
Tail register.
Definition: intelxl.h:776
#define INTELXL_TX_FILL
Transmit descriptor ring maximum fill level.
Definition: intelxl.h:812
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
Definition: wpa.h:237

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, wmb(), and writel().

◆ intelxl_poll()

void intelxl_poll ( struct net_device netdev)

Poll for completed and received packets.

Parameters
netdevNetwork device

Definition at line 1613 of file intelxl.c.

1613  {
1614  struct intelxl_nic *intelxl = netdev->priv;
1615 
1616  /* Poll for completed packets */
1617  intelxl_poll_tx ( netdev );
1618 
1619  /* Poll for received packets */
1620  intelxl_poll_rx ( netdev );
1621 
1622  /* Poll for admin events */
1624 
1625  /* Refill RX ring */
1626  intelxl_refill_rx ( intelxl );
1627 
1628  /* Rearm interrupt, since otherwise receive descriptors will
1629  * be written back only after a complete cacheline (four
1630  * packets) have been received.
1631  *
1632  * There is unfortunately no efficient way to determine
1633  * whether or not rearming the interrupt is necessary. If we
1634  * are running inside a hypervisor (e.g. using a VF or PF as a
1635  * passed-through PCI device), then the MSI-X write is
1636  * redirected by the hypervisor to the real host APIC and the
1637  * host ISR then raises an interrupt within the guest. We
1638  * therefore cannot poll the nominal MSI-X target location to
1639  * watch for the value being written. We could read from the
1640  * INT_DYN_CTL register, but this is even less efficient than
1641  * just unconditionally rearming the interrupt.
1642  */
1643  writel ( INTELXL_INT_DYN_CTL_INTENA, intelxl->regs + intelxl->intr );
1644 }
void * regs
Registers.
Definition: intelxl.h:912
#define INTELXL_INT_DYN_CTL_INTENA
Enable.
Definition: intelxl.h:838
static void intelxl_poll_tx(struct net_device *netdev)
Poll for completed packets.
Definition: intelxl.c:1532
static void intelxl_refill_rx(struct intelxl_nic *intelxl)
Refill receive descriptor ring.
Definition: intelxl.c:1319
void * priv
Driver private data.
Definition: netdevice.h:432
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
static struct net_device * netdev
Definition: gdbudp.c:52
void intelxl_poll_admin(struct net_device *netdev)
Poll admin event queue.
Definition: intelxl.c:836
unsigned int intr
Interrupt control register.
Definition: intelxl.h:935
An Intel 40 Gigabit network card.
Definition: intelxl.h:910
static void intelxl_poll_rx(struct net_device *netdev)
Poll for received packets.
Definition: intelxl.c:1561

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

Variable Documentation

◆ intelxl_admin_offsets

Admin queue register offsets.

Definition at line 109 of file intelxl.c.