72 DBGC ( intelxl,
"INTELXL %p timed out waiting for teardown (%#08x)\n",
73 intelxl, admin_evt_len );
85 unsigned int vfr_state;
101 DBGC ( intelxl,
"INTELXL %p timed out waiting for activation "
102 "(%#08x)\n", intelxl, vfgen_rstat );
222 if (
cmd->vret != 0 )
229 DBGC ( intelxl,
"INTELXL %p timed out waiting for admin VF command "
230 "%#x\n", intelxl, intelxl->
vopcode );
246 DBGC ( intelxl,
"INTELXL %p link %#02x speed %#02x\n", intelxl,
250 if (
link->status ) {
269 switch (
stat->event ) {
274 DBGC ( intelxl,
"INTELXL %p unrecognised status change "
297 unsigned int vopcode;
302 DBGC ( intelxl,
"INTELXL %p unrecognised event opcode "
309 if ( vopcode == intelxl->
vopcode ) {
314 if ( evt->
vret != 0 ) {
315 DBGC ( intelxl,
"INTELXL %p admin VF command %#x "
316 "error %d\n", intelxl, vopcode,
318 DBGC_HDA ( intelxl, virt_to_phys ( evt ), evt,
320 DBGC_HDA ( intelxl, virt_to_phys ( buf ), buf,
332 DBGC ( intelxl,
"INTELXL %p unrecognised VF event %#x:\n",
334 DBGC_HDA ( intelxl, virt_to_phys ( evt ), evt,
336 DBGC_HDA ( intelxl, virt_to_phys ( buf ), buf,
368 DBGC ( intelxl,
"INTELXL %p API v%d.%d\n",
373 DBGC ( intelxl,
"INTELXL %p unsupported API v%d\n",
410 DBGC ( intelxl,
"INTELXL %p capabilities %#08x VSI %#04x\n",
411 intelxl, intelxl->
caps, intelxl->
vsi );
443 DBGC ( intelxl,
"INTELXL %p TX bytes %#llx discards %#llx errors "
448 DBGC ( intelxl,
"INTELXL %p TX unicasts %#llx multicasts %#llx "
449 "broadcasts %#llx\n", intelxl,
453 DBGC ( intelxl,
"INTELXL %p RX bytes %#llx discards %#llx errors "
458 DBGC ( intelxl,
"INTELXL %p RX unicasts %#llx multicasts %#llx "
459 "broadcasts %#llx\n", intelxl,
760 memset ( intelxl, 0,
sizeof ( *intelxl ) );
779 if ( ! intelxl->
regs ) {
791 if ( ! intelxl->
exp ) {
792 DBGC ( intelxl,
"INTELXL %p missing PCIe capability\n",
812 goto err_reset_admin;
820 goto err_get_resources;
829 goto err_register_netdev;
885 PCI_ROM ( 0x8086, 0x154c,
"xl710-vf",
"XL710 VF", 0 ),
886 PCI_ROM ( 0x8086, 0x1571,
"xl710-vf-hv",
"XL710 VF (Hyper-V)", 0 ),
887 PCI_ROM ( 0x8086, 0x1889,
"iavf",
"Intel adaptive VF", 0 ),
888 PCI_ROM ( 0x8086, 0x37cd,
"x722-vf",
"X722 VF", 0 ),
889 PCI_ROM ( 0x8086, 0x37d9,
"x722-vf-hv",
"X722 VF (Hyper-V)", 0 ),
u32 link
Link to next descriptor.
struct arbelprm_rc_send_wqe rc
uint32_t stat
Completion status.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct net_device * netdev
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENXIO
No such device or address.
#define ETIMEDOUT
Connection timed out.
#define ENOMEM
Not enough space.
#define EIO
Input/output error.
#define ENOTSUP
Operation not supported.
#define ENODEV
No such device.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define cpu_to_le64(value)
#define le16_to_cpu(value)
#define le64_to_cpu(value)
#define le32_to_cpu(value)
#define cpu_to_le32(value)
#define cpu_to_le16(value)
void iounmap(volatile const void *io_addr)
Unmap I/O address.
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
int intelxl_msix_enable(struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector)
Enable MSI-X dummy interrupt.
int intelxl_admin_command(struct intelxl_nic *intelxl)
Issue admin queue command.
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_reopen_admin(struct intelxl_nic *intelxl)
Reopen admin queues (after virtual function reset)
void intelxl_free_ring(struct intelxl_nic *intelxl __unused, struct intelxl_ring *ring)
Free descriptor ring.
void intelxl_msix_disable(struct intelxl_nic *intelxl, struct pci_device *pci, unsigned int vector)
Disable MSI-X dummy interrupt.
int intelxl_open_admin(struct intelxl_nic *intelxl)
Open admin queues.
void intelxl_empty_rx(struct intelxl_nic *intelxl)
Discard unused receive I/O buffers.
void intelxl_poll_admin(struct net_device *netdev)
Poll admin event queue.
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.
#define INTELXL_ADMIN_PROMISC_FL_MULTICAST
Promiscuous multicast mode.
#define INTELXL_ADMIN_FL_BUF
Admin descriptor uses data buffer.
#define INTELXL_ADMIN_FL_RD
Admin descriptor uses data buffer for command parameters.
#define INTELXL_ADMIN_NUM_DESC
Number of admin queue descriptors.
#define INTELXL_ALIGN
Alignment.
#define INTELXL_RX_NUM_DESC
Number of receive descriptors.
static void intelxl_init_admin(struct intelxl_admin *admin, unsigned int base, const struct intelxl_admin_offsets *regs)
Initialise admin queue.
#define INTELXL_ADMIN_LEN_ENABLE
Queue enable.
#define INTELXL_TX_NUM_DESC
Number of transmit descriptors.
#define INTELXL_ADMIN_PROMISC_FL_UNICAST
Promiscuous unicast mode.
static int intelxlvf_reset_wait_teardown(struct intelxl_nic *intelxl)
Wait for admin event queue to be torn down.
static const struct intelxl_admin_offsets intelxlvf_admin_event_offsets
Admin event queue register offsets.
static int intelxlvf_admin_irq_map(struct net_device *netdev)
Configure IRQ mapping.
static int intelxlvf_admin_get_resources(struct net_device *netdev)
Get resources.
static int intelxlvf_reset_admin(struct intelxl_nic *intelxl)
Reset hardware via admin queue.
static void intelxlvf_admin_link(struct net_device *netdev, struct intelxlvf_admin_status_link *link)
Handle link status event.
static int intelxlvf_admin_command(struct net_device *netdev)
Issue admin queue virtual function command.
static int intelxlvf_admin_configure(struct net_device *netdev)
Configure queues.
static int intelxlvf_admin_stats(struct net_device *netdev)
Get statistics (for debugging)
static void intelxlvf_close(struct net_device *netdev)
Close network device.
static int intelxlvf_admin_queues(struct net_device *netdev, int enable)
Enable/disable queues.
static void intelxlvf_remove(struct pci_device *pci)
Remove PCI device.
static int intelxlvf_admin_version(struct net_device *netdev)
Negotiate API version.
static void intelxlvf_admin_status(struct net_device *netdev, struct intelxlvf_admin_status_buffer *stat)
Handle status change event.
static const struct intelxl_admin_offsets intelxlvf_admin_command_offsets
Admin command queue register offsets.
static struct net_device_operations intelxlvf_operations
Network device operations.
static int intelxlvf_open(struct net_device *netdev)
Open network device.
static int intelxlvf_probe(struct pci_device *pci)
Probe PCI device.
static int intelxlvf_reset_wait_active(struct intelxl_nic *intelxl)
Wait for virtual function to be marked as active.
static int intelxlvf_admin_promisc(struct net_device *netdev)
Configure promiscuous mode.
static struct pci_device_id intelxlvf_nics[]
PCI device IDs.
static int intelxlvf_admin_request_qps(struct net_device *netdev)
Configure number of queue pairs.
static void intelxlvf_admin_event(struct net_device *netdev, struct intelxl_admin_descriptor *xlevt, union intelxl_admin_buffer *xlbuf)
Handle admin event.
static int intelxlvf_reset_wait(struct intelxl_nic *intelxl)
Wait for reset to complete.
Intel 40 Gigabit Ethernet virtual function network card driver.
#define INTELXLVF_ADMIN_SEND_TO_PF
Admin queue Send Message to PF command.
#define INTELXLVF_ADMIN_EVT_BAL
Admin Event Queue Base Address Low Register (offset)
#define INTELXLVF_ADMIN_CMD_HEAD
Admin Command Queue Head Register (offset)
#define INTELXLVF_ADMIN_DISABLE
Admin Queue VF Disable Queues opcode.
#define INTELXLVF_ADMIN_API_MAJOR
Admin queue VF API major version.
#define INTELXLVF_ADMIN_STATUS_LINK
Link status change event type.
#define INTELXLVF_ADMIN_CONFIGURE
Admin Queue VF Configure Queues opcode.
#define INTELXLVF_ADMIN_EVT_LEN
Admin Event Queue Length Register (offset)
#define INTELXLVF_VFGEN_RSTAT
VF Reset Status Register.
#define INTELXLVF_RESET_DELAY_MS
Minimum time to wait for reset to complete.
#define INTELXLVF_ADMIN_VERSION
Admin Queue VF Version opcode.
#define INTELXLVF_ADMIN_EVT_BAH
Admin Event Queue Base Address High Register (offset)
#define INTELXLVF_VFGEN_RSTAT_VFR_STATE(x)
#define INTELXLVF_ADMIN_CMD_BAH
Admin Command Queue Base Address High Register (offset)
#define INTELXLVF_VFGEN_RSTAT_VFR_STATE_ACTIVE
#define INTELXLVF_ADMIN_REQUEST_QPS
Admin Queue VF Request Queues opcode.
#define INTELXLVF_RESET_MAX_WAIT_MS
Maximum time to wait for reset to complete.
#define INTELXLVF_QTX_TAIL
Transmit Queue Tail Register.
#define INTELXLVF_ADMIN_CAP_L2
Layer 2 capabilities (add/remove MAC, configure promiscuous mode)
#define INTELXLVF_ADMIN_ENABLE
Admin Queue VF Enable Queues opcode.
#define INTELXLVF_ADMIN_STATUS
Admin Queue VF Status Change Event opcode.
#define INTELXLVF_ADMIN_EVT_HEAD
Admin Event Queue Head Register (offset)
#define INTELXLVF_BAR_SIZE
BAR size.
#define INTELXLVF_ADMIN_API_MINOR
Admin queue VF API minor version.
#define INTELXLVF_ADMIN_IRQ_MAP
Admin Queue VF IRQ Map opcode.
struct intelxlvf_admin_descriptor * intelxlvf_admin_command_descriptor(struct intelxl_nic *intelxl)
Get next admin command queue descriptor.
#define INTELXLVF_ADMIN_CMD_BAL
Admin Command Queue Base Address Low Register (offset)
#define INTELXLVF_ADMIN_GET_STATS
Admin Queue VF Get Statistics opcode.
#define INTELXLVF_ADMIN_SEND_TO_VF
Admin queue Send Message to VF command.
#define INTELXLVF_ADMIN_CMD_LEN
Admin Command Queue Length Register (offset)
#define INTELXLVF_ADMIN_MAX_WAIT_MS
Maximum time to wait for a VF admin request to complete.
static union intelxlvf_admin_buffer * intelxlvf_admin_command_buffer(struct intelxl_nic *intelxl)
Get next admin command queue data buffer.
#define INTELXLVF_ADMIN_RESET
Admin Queue VF Reset opcode.
#define INTELXLVF_ADMIN_EVT_TAIL
Admin Event Queue Tail Register (offset)
static void intelxlvf_init_ring(struct intelxl_ring *ring, unsigned int count, size_t len, unsigned int tail)
Initialise descriptor ring.
#define INTELXLVF_ADMIN_CMD_TAIL
Admin Command Queue Tail Register (offset)
#define INTELXLVF_MSIX_VECTOR
MSI-X vector.
#define INTELXLVF_ADMIN_GET_RESOURCES
Admin Queue VF Get Resources opcode.
#define INTELXLVF_ADMIN_PROMISC
Admin Queue VF Configure Promiscuous Mode opcode.
#define INTELXLVF_ADMIN_CAP_RQPS
Request Queues capabilities.
#define INTELXLVF_QRX_TAIL
Receive Queue Tail Register.
#define INTELXLVF_VFINT_DYN_CTLN(x)
VF Interrupt N Dynamic Control Register.
#define INTELXLVF_ADMIN
VF Admin Queue register block.
static __always_inline void dma_set_mask_64bit(struct dma_device *dma)
Set 64-bit addressable space mask.
physaddr_t dma(struct dma_mapping *map, void *addr)
Get DMA address from virtual address.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
int register_netdev(struct net_device *netdev)
Register network device.
Network device management.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define __pci_driver
Declare a PCI driver.
#define PCI_CAP_ID_EXP
PCI Express.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define PCI_ROM(_vendor, _device, _name, _description, _data)
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
struct pci_api * api
API for this bus:dev.fn address.
#define container_of(ptr, type, field)
Get containing structure.
Admin queue register offsets.
union intelxl_admin_buffer * buf
Data buffers.
struct intelxl_admin_descriptor * desc
Descriptors.
unsigned int index
Queue index.
An Intel 40 Gigabit network card.
struct intelxl_admin event
Admin event queue.
size_t mfs
Maximum frame size.
struct dma_device * dma
DMA device.
unsigned int vopcode
Current VF opcode.
unsigned int vsi
Virtual Station Interface switching element ID.
struct intelxl_admin command
Admin command queue.
unsigned int intr
Interrupt control register.
struct intelxl_ring tx
Transmit descriptor ring.
struct intelxl_ring rx
Receive descriptor ring.
uint32_t caps
Device capabilities.
unsigned int exp
PCI Express capability offset.
void(* handle)(struct net_device *netdev, struct intelxl_admin_descriptor *evt, union intelxl_admin_buffer *buf)
Handle admin event.
union intelxl_ring::@075242332004324155326134235227235157077022164124 desc
Descriptors.
union intelxl_rx_descriptor * rx
Receive descriptors.
union intelxl_tx_descriptor * tx
Transmit descriptors.
struct dma_mapping map
Descriptor ring DMA mapping.
uint32_t caps
Capabilities.
uint32_t vopcode
VF opcode.
struct intelxl_admin_descriptor xl
Original 40 Gigabit Ethernet descriptor.
int32_t vret
VF return value.
uint32_t caps
Capabilities.
uint16_t vsi
VSI switching element ID.
uint8_t mac[ETH_ALEN]
MAC address.
uint16_t vec
Interrupt vector ID.
uint16_t txmap
Transmit queue bitmap.
uint16_t vsi
VSI switching element ID.
uint16_t count
Number of interrupt vectors.
uint16_t rxmap
Receive queue bitmap.
uint16_t vsi
VSI switching element ID.
uint32_t tx
Transmit queue bitmask.
uint32_t rx
Receive queue bitmask.
uint16_t vsi
VSI switching element ID.
uint16_t count
Number of queue pairs.
struct intelxlvf_admin_stats tx
Transmit statistics.
struct intelxlvf_admin_stats rx
Receive statistics.
Admin Queue VF Status Change Event data buffer.
Link status change event data.
uint32_t major
Major version.
uint32_t minor
Minor version.
Network device operations.
A PCI device ID list entry.
unsigned long membase
Memory base.
struct device dev
Generic device.
struct dma_device dma
DMA device.
int(* probe)(struct pci_device *pci)
Probe device.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
struct intelxlvf_admin_irq_map_buffer irq
VF IRQ Map data buffer.
struct intelxlvf_admin_status_buffer stat
VF Status Change Event data buffer.
struct intelxlvf_admin_queues_buffer queues
VF Enable/Disable Queues data buffer.
struct intelxlvf_admin_promisc_buffer promisc
VF Configure Promiscuous Mode data buffer.
struct intelxlvf_admin_version_buffer ver
VF Version data buffer.
struct intelxlvf_admin_configure_buffer cfg
VF Configure Queues data buffer.
union intelxl_admin_buffer xl
Original 40 Gigabit Ethernet data buffer.
struct intelxlvf_admin_stats_buffer stats
VF Get Statistics data buffer.
struct intelxlvf_admin_get_resources_buffer res
VF Get Resources data buffer.
struct intelxlvf_admin_request_qps_buffer rqps
VF Request Queues data buffer.
struct intelxlvf_admin_capabilities_buffer caps
VF Capabilities data buffer.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
static struct xen_remove_from_physmap * remove