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