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

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.
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.
int intelxl_msix_enable (struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector)
 Enable MSI-X dummy interrupt.
void intelxl_msix_disable (struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector)
 Disable MSI-X dummy interrupt.
struct intelxl_admin_descriptorintelxl_admin_command_descriptor (struct intelxl_nic *intelxl)
 Get next admin command queue descriptor.
union intelxl_admin_bufferintelxl_admin_command_buffer (struct intelxl_nic *intelxl)
 Get next admin command queue data buffer.
int intelxl_admin_command (struct intelxl_nic *intelxl)
 Issue admin queue command.
int intelxl_admin_clear_pxe (struct intelxl_nic *intelxl)
 Clear PXE mode.
int intelxl_admin_mac_config (struct intelxl_nic *intelxl)
 Set MAC configuration.
void intelxl_poll_admin (struct net_device *netdev)
 Poll admin event queue.
int intelxl_open_admin (struct intelxl_nic *intelxl)
 Open admin queues.
void intelxl_reopen_admin (struct intelxl_nic *intelxl)
 Reopen admin queues (after virtual function reset)
void intelxl_close_admin (struct intelxl_nic *intelxl)
 Close admin queues.
int intelxl_alloc_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring)
 Allocate descriptor ring.
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.
void intelxl_destroy_ring (struct intelxl_nic *intelxl, struct intelxl_ring *ring)
 Destroy descriptor ring.
void intelxl_empty_rx (struct intelxl_nic *intelxl)
 Discard unused receive I/O buffers.
int intelxl_transmit (struct net_device *netdev, struct io_buffer *iobuf)
 Transmit packet.
void intelxl_poll (struct net_device *netdev)
 Poll for completed and received packets.

Variables

const struct intelxl_admin_offsets intelxl_admin_offsets
 Admin queue register offsets.

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.

Referenced by intelxl_probe().

◆ INTELXL_ALIGN

#define INTELXL_ALIGN   256

Alignment.

No data structure requires greater than 256 byte alignment.

Definition at line 27 of file intelxl.h.

Referenced by ice_open(), intelxl_alloc_admin(), intelxl_alloc_ring(), intelxl_open(), and intelxlvf_open().

◆ INTELXL_ADMIN_CMD

#define INTELXL_ADMIN_CMD   0x080000

PF Admin Command Queue register block.

Definition at line 37 of file intelxl.h.

Referenced by ice_probe(), and intelxl_probe().

◆ INTELXL_ADMIN_EVT

#define INTELXL_ADMIN_EVT   0x080080

PF Admin Event Queue register block.

Definition at line 40 of file intelxl.h.

Referenced by ice_probe(), and intelxl_probe().

◆ 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)
Value:
( (x) << 0 )
static unsigned int x
Definition pixbuf.h:63

Queue length.

Definition at line 50 of file intelxl.h.

Referenced by intelxl_enable_admin().

◆ INTELXL_ADMIN_LEN_ENABLE

#define INTELXL_ADMIN_LEN_ENABLE   0x80000000UL

Queue enable.

Definition at line 51 of file intelxl.h.

Referenced by intelxl_enable_admin(), and intelxlvf_reset_wait_teardown().

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

Referenced by ice_admin_version(), and intelxl_admin_version().

◆ INTELXL_ADMIN_DRIVER

#define INTELXL_ADMIN_DRIVER   0x0002

Admin queue Driver Version command.

Definition at line 111 of file intelxl.h.

Referenced by intelxl_admin_driver().

◆ INTELXL_ADMIN_SHUTDOWN

#define INTELXL_ADMIN_SHUTDOWN   0x0003

Admin queue Shutdown command.

Definition at line 136 of file intelxl.h.

Referenced by intelxl_admin_shutdown().

◆ INTELXL_ADMIN_SHUTDOWN_UNLOADING

#define INTELXL_ADMIN_SHUTDOWN_UNLOADING   0x01

Driver is unloading.

Definition at line 147 of file intelxl.h.

Referenced by intelxl_admin_shutdown().

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

Referenced by ice_admin_mac_read(), and intelxl_admin_mac_read().

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

Referenced by ice_admin_mac_read(), and intelxl_admin_mac_read().

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

Referenced by ice_admin_mac_write(), and intelxl_admin_mac_write().

◆ INTELXL_ADMIN_CLEAR_PXE

#define INTELXL_ADMIN_CLEAR_PXE   0x0110

Admin queue Clear PXE Mode command.

Definition at line 193 of file intelxl.h.

Referenced by intelxl_admin_clear_pxe().

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

Referenced by intelxl_admin_clear_pxe().

◆ INTELXL_ADMIN_SWITCH

#define INTELXL_ADMIN_SWITCH   0x0200

Admin queue Get Switch Configuration command.

Definition at line 207 of file intelxl.h.

Referenced by ice_admin_switch(), and intelxl_admin_switch().

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

Referenced by intelxl_admin_switch().

◆ INTELXL_ADMIN_VSI

#define INTELXL_ADMIN_VSI   0x0212

Admin queue Get VSI Parameters command.

Definition at line 257 of file intelxl.h.

Referenced by intelxl_admin_vsi().

◆ INTELXL_ADMIN_PROMISC

#define INTELXL_ADMIN_PROMISC   0x0254

Admin queue Set VSI Promiscuous Modes command.

Definition at line 284 of file intelxl.h.

Referenced by intelxl_admin_promisc().

◆ INTELXL_ADMIN_PROMISC_FL_UNICAST

#define INTELXL_ADMIN_PROMISC_FL_UNICAST   0x0001

Promiscuous unicast mode.

Definition at line 299 of file intelxl.h.

Referenced by intelxl_admin_promisc(), and intelxlvf_admin_promisc().

◆ INTELXL_ADMIN_PROMISC_FL_MULTICAST

#define INTELXL_ADMIN_PROMISC_FL_MULTICAST   0x0002

Promiscuous multicast mode.

Definition at line 302 of file intelxl.h.

Referenced by intelxl_admin_promisc(), and intelxlvf_admin_promisc().

◆ INTELXL_ADMIN_PROMISC_FL_BROADCAST

#define INTELXL_ADMIN_PROMISC_FL_BROADCAST   0x0004

Promiscuous broadcast mode.

Definition at line 305 of file intelxl.h.

Referenced by intelxl_admin_promisc().

◆ INTELXL_ADMIN_PROMISC_FL_VLAN

#define INTELXL_ADMIN_PROMISC_FL_VLAN   0x0010

Promiscuous VLAN mode.

Definition at line 308 of file intelxl.h.

Referenced by intelxl_admin_promisc().

◆ INTELXL_ADMIN_MAC_CONFIG

#define INTELXL_ADMIN_MAC_CONFIG   0x0603

Admin queue Set MAC Configuration command.

Definition at line 311 of file intelxl.h.

Referenced by intelxl_admin_mac_config().

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

Referenced by intelxl_admin_mac_config().

◆ INTELXL_ADMIN_AUTONEG

#define INTELXL_ADMIN_AUTONEG   0x0605

Admin queue Restart Autonegotiation command.

Definition at line 327 of file intelxl.h.

Referenced by ice_admin_autoneg(), and intelxl_admin_autoneg().

◆ INTELXL_ADMIN_AUTONEG_FL_RESTART

#define INTELXL_ADMIN_AUTONEG_FL_RESTART   0x02

Restart autonegotiation.

Definition at line 338 of file intelxl.h.

Referenced by ice_admin_autoneg(), and intelxl_admin_autoneg().

◆ INTELXL_ADMIN_AUTONEG_FL_ENABLE

#define INTELXL_ADMIN_AUTONEG_FL_ENABLE   0x04

Enable link.

Definition at line 341 of file intelxl.h.

Referenced by ice_admin_autoneg(), and intelxl_admin_autoneg().

◆ INTELXL_ADMIN_LINK

#define INTELXL_ADMIN_LINK   0x0607

Admin queue Get Link Status command.

Definition at line 344 of file intelxl.h.

Referenced by ice_admin_event(), ice_admin_link(), intelxl_admin_event(), and intelxl_admin_link().

◆ INTELXL_ADMIN_LINK_NOTIFY

#define INTELXL_ADMIN_LINK_NOTIFY   0x03

Notify driver of link status changes.

Definition at line 363 of file intelxl.h.

Referenced by ice_admin_link(), and intelxl_admin_link().

◆ INTELXL_ADMIN_LINK_UP

#define INTELXL_ADMIN_LINK_UP   0x01

Link is up.

Definition at line 366 of file intelxl.h.

Referenced by ice_admin_link(), and intelxl_admin_link().

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

Referenced by intelxl_admin_command(), and intelxl_poll_admin().

◆ INTELXL_ADMIN_FL_CMP

#define INTELXL_ADMIN_FL_CMP   0x0002

Admin descriptor contains a completion.

Definition at line 437 of file intelxl.h.

Referenced by intelxl_admin_command().

◆ INTELXL_ADMIN_FL_ERR

#define INTELXL_ADMIN_FL_ERR   0x0004

Admin descriptor completed in error.

Definition at line 440 of file intelxl.h.

Referenced by intelxl_admin_command().

◆ INTELXL_ADMIN_FL_RD

◆ INTELXL_ADMIN_FL_BUF

◆ INTELXL_ADMIN_EEXIST

#define INTELXL_ADMIN_EEXIST   13

Error: attempt to create something that already exists.

Definition at line 449 of file intelxl.h.

Referenced by intelxl_admin_clear_pxe().

◆ INTELXL_ADMIN_NUM_DESC

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

Referenced by intelxl_admin_command().

◆ INTELXL_ADMIN_API_MAJOR

#define INTELXL_ADMIN_API_MAJOR   1

Admin queue API major version.

Definition at line 490 of file intelxl.h.

Referenced by ice_admin_version(), and intelxl_admin_version().

◆ INTELXL_PFCM_LANCTXDATA

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

CMLAN Context Data Register.

Definition at line 500 of file intelxl.h.

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_PFCM_LANCTXCTL

#define INTELXL_PFCM_LANCTXCTL   0x10c300

CMLAN Context Control Register.

Definition at line 503 of file intelxl.h.

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_PFCM_LANCTXCTL_QUEUE_NUM

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

Queue number.

Definition at line 504 of file intelxl.h.

504#define INTELXL_PFCM_LANCTXCTL_QUEUE_NUM(x) \
505 ( (x) << 0 ) /**< Queue number */

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_PFCM_LANCTXCTL_SUB_LINE

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

Sub-line.

Definition at line 506 of file intelxl.h.

506#define INTELXL_PFCM_LANCTXCTL_SUB_LINE(x) \
507 ( (x) << 12 ) /**< Sub-line */

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_PFCM_LANCTXCTL_TYPE

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

Queue type.

Definition at line 508 of file intelxl.h.

508#define INTELXL_PFCM_LANCTXCTL_TYPE(x) \
509 ( (x) << 15 ) /**< Queue type */

◆ INTELXL_PFCM_LANCTXCTL_TYPE_RX

#define INTELXL_PFCM_LANCTXCTL_TYPE_RX    INTELXL_PFCM_LANCTXCTL_TYPE ( 0x0 )

RX queue type.

Definition at line 510 of file intelxl.h.

510#define INTELXL_PFCM_LANCTXCTL_TYPE_RX \
511 INTELXL_PFCM_LANCTXCTL_TYPE ( 0x0 ) /**< RX queue type */

Referenced by intelxl_close(), and intelxl_context_rx().

◆ INTELXL_PFCM_LANCTXCTL_TYPE_TX

#define INTELXL_PFCM_LANCTXCTL_TYPE_TX    INTELXL_PFCM_LANCTXCTL_TYPE ( 0x1 )

TX queue type.

Definition at line 512 of file intelxl.h.

512#define INTELXL_PFCM_LANCTXCTL_TYPE_TX \
513 INTELXL_PFCM_LANCTXCTL_TYPE ( 0x1 ) /**< TX queue type */

Referenced by intelxl_close(), and intelxl_context_tx().

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE

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

Op code.

Definition at line 514 of file intelxl.h.

514#define INTELXL_PFCM_LANCTXCTL_OP_CODE(x) \
515 ( (x) << 17 ) /**< Op code */

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE_READ

#define INTELXL_PFCM_LANCTXCTL_OP_CODE_READ    INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x0 )

Read context.

Definition at line 516 of file intelxl.h.

516#define INTELXL_PFCM_LANCTXCTL_OP_CODE_READ \
517 INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x0 ) /**< Read context */

Referenced by intelxl_context_dump().

◆ INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE

#define INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE    INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x1 )

Write context.

Definition at line 518 of file intelxl.h.

518#define INTELXL_PFCM_LANCTXCTL_OP_CODE_WRITE \
519 INTELXL_PFCM_LANCTXCTL_OP_CODE ( 0x1 ) /**< Write context */

Referenced by intelxl_context_line().

◆ INTELXL_PFCM_LANCTXSTAT

#define INTELXL_PFCM_LANCTXSTAT   0x10c380

CMLAN Context Status Register.

Definition at line 522 of file intelxl.h.

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_PFCM_LANCTXSTAT_DONE

#define INTELXL_PFCM_LANCTXSTAT_DONE   0x00000001UL

Complete.

Definition at line 523 of file intelxl.h.

Referenced by intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_CTX_TX_FL_NEW

#define INTELXL_CTX_TX_FL_NEW   0x4000

New transmit queue context.

Definition at line 552 of file intelxl.h.

Referenced by intelxl_context_tx().

◆ INTELXL_CTX_TX_BASE

#define INTELXL_CTX_TX_BASE ( base)
Value:
( (base) >> 7 )
uint32_t base
Base.
Definition librm.h:3

Transmit queue base address.

Definition at line 555 of file intelxl.h.

Referenced by intelxl_context_tx().

◆ INTELXL_CTX_TX_COUNT

#define INTELXL_CTX_TX_COUNT ( count)
Value:
( (count) << 1 )
static unsigned int count
Number of entries.
Definition dwmac.h:220

Transmit queue count.

Definition at line 558 of file intelxl.h.

Referenced by intelxl_context_tx().

◆ INTELXL_CTX_TX_QSET

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

Transmit queue set.

Definition at line 561 of file intelxl.h.

Referenced by intelxl_context_tx().

◆ INTELXL_CTX_RX_BASE_COUNT

#define INTELXL_CTX_RX_BASE_COUNT ( base,
count )
Value:
( ( (base) >> 7 ) | ( ( ( uint64_t ) (count) ) << 57 ) )
unsigned long long uint64_t
Definition stdint.h:13

Receive queue base address and queue count.

Definition at line 584 of file intelxl.h.

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

Referenced by ice_context_rx(), and intelxl_context_rx().

◆ INTELXL_CTX_RX_LEN

#define INTELXL_CTX_RX_LEN ( len)
Value:
( (len) >> 1 )
ring len
Length.
Definition dwmac.h:226

Receive queue data buffer length.

Definition at line 588 of file intelxl.h.

Referenced by ice_context_rx(), and intelxl_context_rx().

◆ INTELXL_CTX_RX_FL_DSIZE

#define INTELXL_CTX_RX_FL_DSIZE   0x10

Use 32-byte receive descriptors.

Definition at line 591 of file intelxl.h.

Referenced by ice_context_rx(), and intelxl_context_rx().

◆ INTELXL_CTX_RX_FL_CRCSTRIP

#define INTELXL_CTX_RX_FL_CRCSTRIP   0x20

Strip CRC from received packets.

Definition at line 594 of file intelxl.h.

Referenced by ice_context_rx(), and intelxl_context_rx().

◆ INTELXL_CTX_RX_MFS

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

Receive queue maximum frame size.

Definition at line 597 of file intelxl.h.

Referenced by ice_context_rx(), and intelxl_context_rx().

◆ 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 600 of file intelxl.h.

Referenced by ice_dump_tx(), intelxl_context_dump(), and intelxl_context_line().

◆ INTELXL_QUEUE_ENABLE_DELAY_US

#define INTELXL_QUEUE_ENABLE_DELAY_US   20

Time to wait for a queue to become enabled.

Definition at line 603 of file intelxl.h.

Referenced by intelxl_enable_ring().

◆ 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 606 of file intelxl.h.

Referenced by intelxl_close(), and intelxl_open().

◆ 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 609 of file intelxl.h.

Referenced by intelxl_disable_ring().

◆ INTELXL_QTX_HEAD

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

Global Transmit Queue Head register.

Definition at line 619 of file intelxl.h.

Referenced by intelxl_open().

◆ INTELXL_GLLAN_TXPRE_QDIS

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

Global Transmit Pre Queue Disable register.

Definition at line 622 of file intelxl.h.

Referenced by intelxl_close(), and intelxl_open().

◆ INTELXL_GLLAN_TXPRE_QDIS_QINDX

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

Queue index.

Definition at line 623 of file intelxl.h.

623#define INTELXL_GLLAN_TXPRE_QDIS_QINDX(x) \
624 ( (x) << 0 ) /**< Queue index */

Referenced by intelxl_close(), and intelxl_open().

◆ INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS

#define INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS    0x40000000UL

Set disable.

Definition at line 625 of file intelxl.h.

625#define INTELXL_GLLAN_TXPRE_QDIS_SET_QDIS \
626 0x40000000UL /**< Set disable */

Referenced by intelxl_close(), and intelxl_open().

◆ INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS

#define INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS    0x80000000UL

Clear disable.

Definition at line 627 of file intelxl.h.

627#define INTELXL_GLLAN_TXPRE_QDIS_CLEAR_QDIS \
628 0x80000000UL /**< Clear disable */

Referenced by intelxl_open().

◆ INTELXL_QTX

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

Global Transmit Queue register block.

Definition at line 631 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QRX

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

Global Receive Queue register block.

Definition at line 634 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QXX_ENA

#define INTELXL_QXX_ENA   0x0000

Queue Enable Register (offset)

Definition at line 637 of file intelxl.h.

Referenced by intelxl_disable_ring(), and intelxl_enable_ring().

◆ INTELXL_QXX_ENA_REQ

#define INTELXL_QXX_ENA_REQ   0x00000001UL

Enable request.

Definition at line 638 of file intelxl.h.

Referenced by intelxl_enable_ring().

◆ INTELXL_QXX_ENA_STAT

#define INTELXL_QXX_ENA_STAT   0x00000004UL

Enabled status.

Definition at line 639 of file intelxl.h.

Referenced by intelxl_disable_ring(), and intelxl_enable_ring().

◆ INTELXL_QXX_CTL

#define INTELXL_QXX_CTL   0x4000

Queue Control Register (offset)

Definition at line 642 of file intelxl.h.

Referenced by intelxl_open().

◆ INTELXL_QXX_CTL_PFVF_Q

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

PF/VF queue.

Definition at line 643 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 644 of file intelxl.h.

644#define INTELXL_QXX_CTL_PFVF_Q_PF \
645 INTELXL_QXX_CTL_PFVF_Q ( 0x2 ) /**< PF queue */

Referenced by intelxl_open().

◆ INTELXL_QXX_CTL_PFVF_PF_INDX

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

PF index.

Definition at line 646 of file intelxl.h.

Referenced by intelxl_open().

◆ INTELXL_QXX_TAIL

#define INTELXL_QXX_TAIL   0x8000

Queue Tail Pointer Register (offset)

Definition at line 649 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_TX_DATA_DTYP

#define INTELXL_TX_DATA_DTYP   0x0

Transmit data descriptor type.

Definition at line 662 of file intelxl.h.

Referenced by intelxl_transmit().

◆ INTELXL_TX_DATA_EOP

#define INTELXL_TX_DATA_EOP   0x10

Transmit data descriptor end of packet.

Definition at line 665 of file intelxl.h.

Referenced by intelxl_transmit().

◆ INTELXL_TX_DATA_RS

#define INTELXL_TX_DATA_RS   0x20

Transmit data descriptor report status.

Definition at line 668 of file intelxl.h.

Referenced by intelxl_transmit().

◆ 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 678 of file intelxl.h.

Referenced by intelxl_transmit().

◆ INTELXL_TX_DATA_LEN

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

Transmit data descriptor length.

Definition at line 681 of file intelxl.h.

Referenced by intelxl_transmit().

◆ INTELXL_TX_WB_FL_DD

#define INTELXL_TX_WB_FL_DD   0x01

Transmit writeback descriptor complete.

Definition at line 694 of file intelxl.h.

Referenced by intelxl_poll_tx().

◆ INTELXL_RX_WB_FL_DD

#define INTELXL_RX_WB_FL_DD   0x00000001UL

Receive writeback descriptor complete.

Definition at line 731 of file intelxl.h.

Referenced by intelxl_poll_rx().

◆ INTELXL_RX_WB_FL_VLAN

#define INTELXL_RX_WB_FL_VLAN   0x00000004UL

Receive writeback descriptor VLAN tag present.

Definition at line 734 of file intelxl.h.

Referenced by intelxl_poll_rx().

◆ INTELXL_RX_WB_FL_RXE

#define INTELXL_RX_WB_FL_RXE   0x00080000UL

Receive writeback descriptor error.

Definition at line 737 of file intelxl.h.

Referenced by intelxl_poll_rx().

◆ INTELXL_RX_WB_LEN

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

Receive writeback descriptor length.

Definition at line 740 of file intelxl.h.

Referenced by intelxl_poll_rx().

◆ 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 804 of file intelxl.h.

Referenced by ice_admin_add_txq(), ice_probe(), intelxl_context_tx(), intelxl_poll_tx(), intelxl_probe(), intelxl_transmit(), intelxlvf_admin_configure(), and intelxlvf_probe().

◆ INTELXL_TX_FILL

#define INTELXL_TX_FILL   ( INTELXL_TX_NUM_DESC - 1 )

Transmit descriptor ring maximum fill level.

Definition at line 807 of file intelxl.h.

Referenced by intelxl_transmit().

◆ 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 813 of file intelxl.h.

Referenced by ice_context_rx(), ice_probe(), intelxl_context_rx(), intelxl_empty_rx(), intelxl_poll_rx(), intelxl_probe(), intelxl_refill_rx(), intelxlvf_admin_configure(), and intelxlvf_probe().

◆ 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 819 of file intelxl.h.

Referenced by intelxl_refill_rx().

◆ INTELXL_MAX_PKT_LEN

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

Maximum packet length (excluding CRC)

Definition at line 822 of file intelxl.h.

Referenced by ice_probe(), and intelxl_probe().

◆ INTELXL_PFINT_DYN_CTL0

#define INTELXL_PFINT_DYN_CTL0   0x038480

PF Interrupt Zero Dynamic Control Register.

Definition at line 832 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_INT_DYN_CTL_INTENA

#define INTELXL_INT_DYN_CTL_INTENA   0x00000001UL

Enable.

Definition at line 833 of file intelxl.h.

Referenced by intelxl_poll().

◆ INTELXL_INT_DYN_CTL_CLEARPBA

#define INTELXL_INT_DYN_CTL_CLEARPBA   0x00000002UL

Acknowledge.

Definition at line 834 of file intelxl.h.

◆ INTELXL_INT_DYN_CTL_INTENA_MASK

#define INTELXL_INT_DYN_CTL_INTENA_MASK   0x80000000UL

Ignore enable.

Definition at line 835 of file intelxl.h.

◆ INTELXL_PFINT_LNKLST0

#define INTELXL_PFINT_LNKLST0   0x038500

PF Interrupt Zero Linked List Register.

Definition at line 838 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_INDX

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

Queue index.

Definition at line 839 of file intelxl.h.

839#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX(x) \
840 ( (x) << 0 ) /**< Queue index */

Referenced by intelxl_probe().

◆ 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 841 of file intelxl.h.

841#define INTELXL_PFINT_LNKLST0_FIRSTQ_INDX_NONE \
842 INTELXL_PFINT_LNKLST0_FIRSTQ_INDX ( 0x7ff ) /**< End of list */

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE

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

Queue type.

Definition at line 843 of file intelxl.h.

843#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE(x) \
844 ( (x) << 11 ) /**< Queue type */

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX

#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX    INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x0 )

Receive queue.

Definition at line 845 of file intelxl.h.

845#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_RX \
846 INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x0 ) /**< Receive queue */

Referenced by intelxl_probe().

◆ INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX

#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX    INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 847 of file intelxl.h.

847#define INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE_TX \
848 INTELXL_PFINT_LNKLST0_FIRSTQ_TYPE ( 0x1 ) /**< Transmit queue */

◆ INTELXL_PFINT_ICR0_ENA

#define INTELXL_PFINT_ICR0_ENA   0x038800

PF Interrupt Zero Cause Enablement Register.

Definition at line 851 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFINT_ICR0_ENA_ADMINQ

#define INTELXL_PFINT_ICR0_ENA_ADMINQ   0x40000000UL

Admin event.

Definition at line 852 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QINT_RQCTL

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

Receive Queue Interrupt Cause Control Register.

Definition at line 855 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QINT_RQCTL_NEXTQ_INDX

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

Queue index.

Definition at line 856 of file intelxl.h.

Referenced by intelxl_probe().

◆ 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 857 of file intelxl.h.

857#define INTELXL_QINT_RQCTL_NEXTQ_INDX_NONE \
858 INTELXL_QINT_RQCTL_NEXTQ_INDX ( 0x7ff ) /**< End of list */

◆ INTELXL_QINT_RQCTL_NEXTQ_TYPE

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

Queue type.

Definition at line 859 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 860 of file intelxl.h.

860#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_RX \
861 INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x0 ) /**< Receive queue */

◆ INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX

#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX    INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 862 of file intelxl.h.

862#define INTELXL_QINT_RQCTL_NEXTQ_TYPE_TX \
863 INTELXL_QINT_RQCTL_NEXTQ_TYPE ( 0x1 ) /**< Transmit queue */

Referenced by intelxl_probe().

◆ INTELXL_QINT_RQCTL_CAUSE_ENA

#define INTELXL_QINT_RQCTL_CAUSE_ENA   0x40000000UL

Enable.

Definition at line 864 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QINT_TQCTL

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

Transmit Queue Interrupt Cause Control Register.

Definition at line 867 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_QINT_TQCTL_NEXTQ_INDX

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

Queue index.

Definition at line 868 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 869 of file intelxl.h.

869#define INTELXL_QINT_TQCTL_NEXTQ_INDX_NONE \
870 INTELXL_QINT_TQCTL_NEXTQ_INDX ( 0x7ff ) /**< End of list */

Referenced by intelxl_probe().

◆ INTELXL_QINT_TQCTL_NEXTQ_TYPE

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

Queue type.

Definition at line 871 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 872 of file intelxl.h.

872#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_RX \
873 INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x0 ) /**< Receive queue */

◆ INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX

#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX    INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x1 )

Transmit queue.

Definition at line 874 of file intelxl.h.

874#define INTELXL_QINT_TQCTL_NEXTQ_TYPE_TX \
875 INTELXL_QINT_TQCTL_NEXTQ_TYPE ( 0x1 ) /**< Transmit queue */

◆ INTELXL_QINT_TQCTL_CAUSE_ENA

#define INTELXL_QINT_TQCTL_CAUSE_ENA   0x40000000UL

Enable.

Definition at line 876 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFFUNC_RID

#define INTELXL_PFFUNC_RID   0x09c000

Function Requester ID Information Register.

Definition at line 879 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFFUNC_RID_FUNC_NUM

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

Function number.

Definition at line 880 of file intelxl.h.

880#define INTELXL_PFFUNC_RID_FUNC_NUM(x) \
881 ( ( (x) >> 0 ) & 0x7 ) /**< Function number */

Referenced by intelxl_probe().

◆ INTELXL_PFLAN_QALLOC

#define INTELXL_PFLAN_QALLOC   0x1c0400

PF Queue Allocation Register.

Definition at line 884 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFLAN_QALLOC_FIRSTQ

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

First queue.

Definition at line 885 of file intelxl.h.

885#define INTELXL_PFLAN_QALLOC_FIRSTQ(x) \
886 ( ( (x) >> 0 ) & 0x7ff ) /**< First queue */

Referenced by intelxl_probe().

◆ INTELXL_PFLAN_QALLOC_LASTQ

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

Last queue.

Definition at line 887 of file intelxl.h.

887#define INTELXL_PFLAN_QALLOC_LASTQ(x) \
888 ( ( (x) >> 16 ) & 0x7ff ) /**< Last queue */

Referenced by intelxl_probe().

◆ INTELXL_PFGEN_PORTNUM

#define INTELXL_PFGEN_PORTNUM   0x1c0480

PF LAN Port Number Register.

Definition at line 891 of file intelxl.h.

Referenced by intelxl_probe().

◆ INTELXL_PFGEN_PORTNUM_PORT_NUM

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

Port number.

Definition at line 892 of file intelxl.h.

892#define INTELXL_PFGEN_PORTNUM_PORT_NUM(x) \
893 ( ( (x) >> 0 ) & 0x3 ) /**< Port number */

Referenced by intelxl_probe().

◆ INTELXL_MSIX_VECTOR

#define INTELXL_MSIX_VECTOR   0

MSI-X interrupt vector.

Definition at line 896 of file intelxl.h.

Referenced by ice_probe(), ice_remove(), intelxl_probe(), and intelxl_remove().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ intelxl_init_admin()

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}
struct i386_regs regs
Definition registers.h:1
unsigned int base
Register block base.
Definition intelxl.h:463
const struct intelxl_admin_offsets * regs
Register offsets.
Definition intelxl.h:465

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

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

◆ intelxl_init_ring()

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

Initialise descriptor ring.

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

Definition at line 791 of file intelxl.h.

793 {
794
795 ring->len = ( count * len );
796 ring->context = context;
797}
size_t len
Length (in bytes)
Definition intelxl.h:773
int(* context)(struct intelxl_nic *intelxl, physaddr_t address)
Program queue context.
Definition intelxl.h:779

References address, intelxl_ring::context, count, intelxl_ring::len, and len.

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 )
extern

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:3
uint32_t vector
MSI-X vector.
Definition ena.h:9
#define DBGC(...)
Definition compiler.h:505
int pci_msix_enable(struct pci_device *pci, struct pci_msix *msix)
Enable MSI-X interrupts.
Definition pcimsix.c:137
void pci_msix_disable(struct pci_device *pci, struct pci_msix *msix)
Disable MSI-X interrupts.
Definition pcimsix.c:208
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:928

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 )
extern

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}
static void pci_msix_mask(struct pci_msix *msix, unsigned int vector)
Mask MSI-X interrupt vector.
Definition pcimsix.h:65

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)
extern

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}
struct golan_eqe_cmd cmd
Definition CIB_PRM.h:1
void * memset(void *dest, int character, size_t len) __nonnull
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
Definition intelxl.h:484
Admin queue descriptor.
Definition intelxl.h:416
Admin queue.
Definition intelxl.h:452
struct intelxl_admin_descriptor * desc
Descriptors.
Definition intelxl.h:454
unsigned int index
Queue index.
Definition intelxl.h:460
struct intelxl_admin command
Admin command queue.
Definition intelxl.h:931

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)
extern

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 data buffer.
Definition intelxl.h:402

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)
extern

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}
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
long index
Definition bigint.h:65
#define assert(condition)
Assert a condition at run-time.
Definition assert.h:50
uint64_t address
Base address.
Definition ena.h:13
#define DBGC2(...)
Definition compiler.h:522
#define DBGC2_HDA(...)
Definition compiler.h:523
#define DBGC_HDA(...)
Definition compiler.h:506
#define ETIMEDOUT
Connection timed out.
Definition errno.h:670
#define EPROTO
Protocol error.
Definition errno.h:625
#define EIO
Input/output error.
Definition errno.h:434
#define le16_to_cpu(value)
Definition byteswap.h:113
#define le32_to_cpu(value)
Definition byteswap.h:114
#define cpu_to_le32(value)
Definition byteswap.h:108
#define cpu_to_le16(value)
Definition byteswap.h:107
#define wmb()
Definition io.h:546
#define INTELXL_ADMIN_FL_CMP
Admin descriptor contains a completion.
Definition intelxl.h:437
#define INTELXL_ADMIN_FL_BUF
Admin descriptor uses data buffer.
Definition intelxl.h:446
#define INTELXL_ADMIN_FL_RD
Admin descriptor uses data buffer for command parameters.
Definition intelxl.h:443
#define INTELXL_ADMIN_FL_DD
Admin descriptor done.
Definition intelxl.h:434
#define INTELXL_ADMIN_MAX_WAIT_MS
Maximum time to wait for an admin request to complete.
Definition intelxl.h:487
#define INTELXL_ADMIN_FL_ERR
Admin descriptor completed in error.
Definition intelxl.h:440
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
Admin queue register offsets.
Definition intelxl.h:64
struct dma_mapping map
DMA mapping.
Definition intelxl.h:458
void * regs
Registers.
Definition intelxl.h:901
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition timer.c:79
#define writel
Definition w89c840.c:160

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, intelxl_admin::regs, intelxl_nic::regs, 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)
extern

Clear PXE mode.

Parameters
intelxlIntel device
Return values
rcReturn status code

Definition at line 561 of file intelxl.c.

561 {
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}
int intelxl_admin_command(struct intelxl_nic *intelxl)
Issue admin queue command.
Definition intelxl.c:278
struct intelxl_admin_descriptor * intelxl_admin_command_descriptor(struct intelxl_nic *intelxl)
Get next admin command queue descriptor.
Definition intelxl.c:222
#define INTELXL_ADMIN_CLEAR_PXE
Admin queue Clear PXE Mode command.
Definition intelxl.h:193
#define INTELXL_ADMIN_EEXIST
Error: attempt to create something that already exists.
Definition intelxl.h:449
#define INTELXL_ADMIN_CLEAR_PXE_MAGIC
Clear PXE Mode magic value.
Definition intelxl.h:204
Admin queue Clear PXE Mode command parameters.
Definition intelxl.h:196
uint8_t magic
Magic value.
Definition intelxl.h:198

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)
extern

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}
#define INTELXL_ADMIN_MAC_CONFIG
Admin queue Set MAC Configuration command.
Definition intelxl.h:311
#define INTELXL_ADMIN_MAC_CONFIG_FL_CRC
Append CRC on transmit.
Definition intelxl.h:324
Admin queue Set MAC Configuration command parameters.
Definition intelxl.h:314
uint16_t mfs
Maximum frame size.
Definition intelxl.h:316
size_t mfs
Maximum frame size.
Definition intelxl.h:905

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)
extern

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}
static struct net_device * netdev
Definition gdbudp.c:53
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
uint16_t flags
Flags.
Definition intelxl.h:418
uint16_t len
Data length.
Definition intelxl.h:422
An Intel 40 Gigabit network card.
Definition intelxl.h:899
struct intelxl_admin event
Admin event queue.
Definition intelxl.h:933
void(* handle)(struct net_device *netdev, struct intelxl_admin_descriptor *evt, union intelxl_admin_buffer *buf)
Handle admin event.
Definition intelxl.h:952

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, and netdev.

Referenced by intelxl_poll(), and intelxlvf_admin_command().

◆ intelxl_open_admin()

int intelxl_open_admin ( struct intelxl_nic * intelxl)
extern

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}
static void intelxl_free_admin(struct intelxl_nic *intelxl __unused, struct intelxl_admin *admin)
Free admin queue.
Definition intelxl.c:206
void intelxl_reopen_admin(struct intelxl_nic *intelxl)
Reopen admin queues (after virtual function reset)
Definition intelxl.c:907
static void intelxl_disable_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Disable admin queue.
Definition intelxl.c:191
static int intelxl_alloc_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Allocate admin queue.
Definition intelxl.c:124

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)
extern

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}
static void intelxl_enable_admin(struct intelxl_nic *intelxl, struct intelxl_admin *admin)
Enable admin queue.
Definition intelxl.c:152

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)
extern

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

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 )
extern

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,
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}
#define ENOMEM
Not enough space.
Definition errno.h:535
#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.
void * dma_alloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer.
struct dma_device * dma
DMA device.
Definition intelxl.h:903
union intelxl_ring::@075242332004324155326134235227235157077022164124 desc
Descriptors.
unsigned int cons
Consumer index.
Definition intelxl.h:766
void * raw
Raw data.
Definition intelxl.h:759
unsigned int prod
Producer index.
Definition intelxl.h:764
struct dma_mapping map
Descriptor ring DMA mapping.
Definition intelxl.h:762
unsigned int tail
Tail register.
Definition intelxl.h:771

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 )
extern

References netdev.

◆ intelxl_create_ring()

int intelxl_create_ring ( struct intelxl_nic * intelxl,
struct intelxl_ring * ring )
extern

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}
unsigned long physaddr_t
Definition stdint.h:20
static int intelxl_disable_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Disable descriptor ring.
Definition intelxl.c:1233
int intelxl_alloc_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Allocate descriptor ring.
Definition intelxl.c:957
void intelxl_free_ring(struct intelxl_nic *intelxl __unused, struct intelxl_ring *ring)
Free descriptor ring.
Definition intelxl.c:996
static int intelxl_enable_ring(struct intelxl_nic *intelxl, struct intelxl_ring *ring)
Enable descriptor ring.
Definition intelxl.c:1208

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 )
extern

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}

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)
extern

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}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define INTELXL_RX_NUM_DESC
Number of receive descriptors.
Definition intelxl.h:813
void free_rx_iob(struct io_buffer *iobuf)
Unmap and free I/O buffer for receive DMA.
Definition iobuf.c:215
struct io_buffer * rx_iobuf[INTELXL_RX_NUM_DESC]
Receive I/O buffers.
Definition intelxl.h:943

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 )
extern

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}
#define ENOBUFS
No buffer space available.
Definition errno.h:499
#define cpu_to_le64(value)
Definition byteswap.h:109
#define INTELXL_TX_DATA_RS
Transmit data descriptor report status.
Definition intelxl.h:668
#define INTELXL_TX_FILL
Transmit descriptor ring maximum fill level.
Definition intelxl.h:807
#define INTELXL_TX_DATA_EOP
Transmit data descriptor end of packet.
Definition intelxl.h:665
#define INTELXL_TX_DATA_JFDI
Transmit data descriptor pretty please.
Definition intelxl.h:678
#define INTELXL_TX_DATA_LEN(len)
Transmit data descriptor length.
Definition intelxl.h:681
#define INTELXL_TX_NUM_DESC
Number of transmit descriptors.
Definition intelxl.h:804
#define INTELXL_TX_DATA_DTYP
Transmit data descriptor type.
Definition intelxl.h:662
static __always_inline physaddr_t iob_dma(struct io_buffer *iobuf)
Get I/O buffer DMA address.
Definition iobuf.h:268
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Definition iobuf.h:160
struct intelxl_ring tx
Transmit descriptor ring.
Definition intelxl.h:939
union intelxl_tx_descriptor * tx
Transmit descriptors.
Definition intelxl.h:755
Transmit data descriptor.
Definition intelxl.h:652
void * data
Start of data.
Definition iobuf.h:53
struct intelxl_tx_data_descriptor data
Transmit data descriptor.
Definition intelxl.h:699
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
Definition wpa.h:4

References intelxl_ring::cons, cpu_to_le32, cpu_to_le64, intelxl_tx_descriptor::data, io_buffer::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, intelxl_ring::prod, intelxl_nic::regs, intelxl_ring::tail, intelxl_nic::tx, intelxl_ring::tx, tx, wmb, and writel.

◆ intelxl_poll()

void intelxl_poll ( struct net_device * netdev)
extern

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 */
1618
1619 /* Poll for received packets */
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}
static void intelxl_poll_tx(struct net_device *netdev)
Poll for completed packets.
Definition intelxl.c:1532
static void intelxl_poll_rx(struct net_device *netdev)
Poll for received packets.
Definition intelxl.c:1561
void intelxl_poll_admin(struct net_device *netdev)
Poll admin event queue.
Definition intelxl.c:836
static void intelxl_refill_rx(struct intelxl_nic *intelxl)
Refill receive descriptor ring.
Definition intelxl.c:1319
#define INTELXL_INT_DYN_CTL_INTENA
Enable.
Definition intelxl.h:833
unsigned int intr
Interrupt control register.
Definition intelxl.h:924

References INTELXL_INT_DYN_CTL_INTENA, intelxl_poll_admin(), intelxl_poll_rx(), intelxl_poll_tx(), intelxl_refill_rx(), intelxl_nic::intr, netdev, intelxl_nic::regs, and writel.

Variable Documentation

◆ intelxl_admin_offsets

const struct intelxl_admin_offsets intelxl_admin_offsets
extern

Admin queue register offsets.

Definition at line 109 of file intelxl.c.

109 {
110 .bal = INTELXL_ADMIN_BAL,
111 .bah = INTELXL_ADMIN_BAH,
112 .len = INTELXL_ADMIN_LEN,
113 .head = INTELXL_ADMIN_HEAD,
114 .tail = INTELXL_ADMIN_TAIL,
115};
#define INTELXL_ADMIN_LEN
Admin Queue Length Register (offset)
Definition intelxl.h:49
#define INTELXL_ADMIN_HEAD
Admin Queue Head Register (offset)
Definition intelxl.h:54
#define INTELXL_ADMIN_BAL
Admin Queue Base Address Low Register (offset)
Definition intelxl.h:43
#define INTELXL_ADMIN_BAH
Admin Queue Base Address High Register (offset)
Definition intelxl.h:46
#define INTELXL_ADMIN_TAIL
Admin Queue Tail Register (offset)
Definition intelxl.h:57