57 DBGC ( intel,
"INTEL %p TX %d (%#x%08x) RX %d (%#x%08x) multi %d\n",
103 DBGC ( intel,
"INTEL %p link status is %08x\n", intel, links );
137 DBGC ( intel,
"INTEL %p negotiate API version failed: %s\n",
144 DBGC ( intel,
"INTEL %p negotiate API version unexpected " 145 "response:\n", intel );
152 DBGC ( intel,
"INTEL %p negotiate API version failed\n",
175 DBGC ( intel,
"INTEL %p get queue configuration failed: %s\n",
182 DBGC ( intel,
"INTEL %p get queue configuration unexpected " 183 "response:\n", intel );
190 DBGC ( intel,
"INTEL %p get queue configuration refused\n",
196 *vlan_thing =
msg.queues.vlan_thing;
228 DBGC ( intel,
"INTEL %p could not reset: %s\n",
244 DBGC ( intel,
"INTEL %p could not set MAC address: %s\n",
246 goto err_mbox_set_mac;
251 DBGC ( intel,
"INTEL %p could not set MTU %zd: %s\n",
253 goto err_mbox_set_mtu;
271 DBGC ( intel,
"INTEL %p stripping VLAN tags (thing=%d)\n",
380 DBGC ( intel,
"INTEL %p mailbox poll failed!\n",
448 memset ( intel, 0,
sizeof ( *intel ) );
460 if ( ! intel->
regs ) {
475 DBGC ( intel,
"INTEL %p could not reset and fetch MAC: %s\n",
487 goto err_register_netdev;
529 PCI_ROM ( 0x8086, 0x10ed,
"82599-vf",
"82599 VF", 0 ),
530 PCI_ROM ( 0x8086, 0x1515,
"x540-vf",
"X540 VF", 0 ),
531 PCI_ROM ( 0x8086, 0x1565,
"x550-vf",
"X550 VF", 0 ),
532 PCI_ROM ( 0x8086, 0x15a8,
"x552-vf",
"X552 VF", 0 ),
533 PCI_ROM ( 0x8086, 0x15c5,
"x557-vf",
"X557-AT2 VF", 0 ),
#define INTELXVF_SRRCTL_DROP_EN
unsigned long membase
Memory base.
struct arbelprm_rc_send_wqe rc
static void intelxvf_remove(struct pci_device *pci)
Remove PCI device.
struct dma_device dma
DMA device.
#define INTEL_NUM_RX_DESC
Number of receive descriptors.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
int intelvf_mbox_set_mtu(struct intel_nic *intel, size_t mtu)
Send set MTU message.
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
void intel_poll_rx(struct net_device *netdev)
Poll for received packets.
void intel_reset_ring(struct intel_nic *intel, unsigned int reg)
Reset descriptor ring.
int(* open)(struct net_device *netdev)
Open network device.
#define INTELXVF_MBCTRL
Mailbox Control Register.
struct intel_mailbox mbox
Mailbox.
#define INTEL_xDCTL
Receive/Transmit Descriptor Control (offset)
#define INTELXVF_GORCL
Good Packets Received Count Low.
#define INTELXVF_EIMS
Extended Interrupt Mask Set/Read Register.
#define INTELXVF_TD(n)
Transmit Descriptor register block.
#define INTELXVF_RD(n)
Receive Descriptor register block.
#define INTEL_NUM_TX_DESC
Number of transmit descriptors.
struct pci_device_id * ids
PCI ID table.
void intel_poll_tx(struct net_device *netdev)
Poll for completed packets.
#define INTELXVF_SRRCTL_BSIZE_DEFAULT
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
struct intel_ring rx
Receive descriptor ring.
#define INTELXVF_CTRL
Control Register.
int intel_create_ring(struct intel_nic *intel, struct intel_ring *ring)
Create descriptor ring.
void intel_empty_rx(struct intel_nic *intel)
Discard unused receive I/O buffers.
static __always_inline void dma_set_mask_64bit(struct dma_device *dma)
Set 64-bit addressable space mask.
Intel 10 Gigabit Ethernet network card driver.
static int intelxvf_open(struct net_device *netdev)
Open network device.
struct dma_device * dma
DMA device.
#define INTELXVF_MBMEM
Mailbox Memory Register Base.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
static int intelxvf_probe(struct pci_device *pci)
Probe PCI device.
static void intelxvf_check_link(struct net_device *netdev)
Check link state.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
static void intel_init_ring(struct intel_ring *ring, unsigned int count, unsigned int reg, void(*describe)(struct intel_descriptor *desc, physaddr_t addr, size_t len))
Initialise descriptor ring.
#define INTELXVF_LINKS
Link Status Register.
struct device dev
Generic device.
#define INTELXVF_DCA_RXCTRL_MUST_BE_ZERO
Must be zero.
void intel_refill_rx(struct intel_nic *intel)
Refill receive descriptor ring.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
#define INTELVF_BAR_SIZE
Intel VF BAR size.
#define INTELXVF_SRRCTL_DESCTYPE_MASK
#define INTELXVF_GORCH
Good Packets Received Count High.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
int intelvf_mbox_set_mac(struct intel_nic *intel, const uint8_t *ll_addr)
Send set MAC address message.
static int intelxvf_mbox_version(struct intel_nic *intel, unsigned int version)
Send negotiate API version message.
static void intel_init_mbox(struct intel_mailbox *mbox, unsigned int ctrl, unsigned int mem)
Initialise mailbox.
#define ENOMEM
Not enough space.
#define INTELXVF_IVAR_TX0_VALID
TX queue 0 valid.
struct pci_driver intelxvf_driver __pci_driver
PCI driver.
u32 version
Driver version.
Intel 10 Gigabit Ethernet virtual function network card driver.
static void intelxvf_poll(struct net_device *netdev)
Poll for completed and received packets.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define INTELXVF_IVAR
Interrupt Vector Allocation Register.
#define INTELXVF_SRRCTL_DESCTYPE_DEFAULT
#define INTELXVF_SRRCTL_BHDRSIZE_DEFAULT
void * priv
Driver private data.
void intel_describe_rx(struct intel_descriptor *rx, physaddr_t addr, size_t len __unused)
Populate receive descriptor.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
#define INTELXVF_IVAR_RX0_VALID
RX queue 0 valid.
static struct net_device * netdev
#define INTELXVF_DCA_RXCTRL
RX DCA Control Register.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define EPROTO
Protocol error.
#define INTELXVF_IVAR_TX0_DEFAULT
char * strerror(int errno)
Retrieve string representation of error number.
#define INTELVF_MSG_ACK
Message ACK flag.
int intelvf_mbox_msg(struct intel_nic *intel, union intelvf_msg *msg)
Send/receive mailbox message.
int intelvf_mbox_reset(struct intel_nic *intel, uint8_t *hw_addr)
Send reset message and get initial MAC address.
int register_netdev(struct net_device *netdev)
Register network device.
#define INTELXVF_IVARM
Interrupt Vector Allocation Miscellaneous Register.
static struct net_device_operations intelxvf_operations
Network device operations.
#define ENODEV
No such device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define INTELXVF_EIRQ_TX0
TX queue 0 (via IVAR)
#define INTELXVF_IVAR_RX0_DEFAULT
static void intelxvf_close(struct net_device *netdev)
Close network device.
#define INTELXVF_LINKS_UP
Link up.
A PCI device ID list entry.
#define INTELXVF_EIRQ_MBOX
Mailbox (via IVARM)
#define INTELXVF_PSRTYPE
Packet Split Receive Type.
static struct xen_remove_from_physmap * remove
static void intelxvf_stats(struct intel_nic *intel)
Dump statistics.
static void intelxvf_reset(struct intel_nic *intel)
Reset hardware.
Network device operations.
struct device * dev
Underlying hardware device.
#define EPERM
Operation not permitted.
#define INTELXVF_GOTCL
Good Packets Transmitted Count Low.
Network device management.
#define INTELXVF_SRRCTL_BSIZE_MASK
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
struct dma_device * dma
DMA device.
#define INTELVF_MSG_TYPE_MASK
Message type mask.
#define INTELXVF_CTRL_RST
Function-level reset.
#define INTELXVF_SRRCTL_BHDRSIZE_MASK
#define INTELXVF_EIRQ_RX0
RX queue 0 (via IVAR)
static struct pci_device_id intelxvf_nics[]
PCI device IDs.
int(* probe)(struct pci_device *pci)
Probe device.
#define INTELXVF_SRRCTL
Split Receive Control Register.
int intel_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
int intelvf_mbox_poll(struct intel_nic *intel)
Poll mailbox.
void intel_destroy_ring(struct intel_nic *intel, struct intel_ring *ring)
Destroy descriptor ring.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
#define INTELXVF_MSG_TYPE_VERSION
Negotiate API version mailbox message.
void intel_describe_tx_adv(struct intel_descriptor *tx, physaddr_t addr, size_t len)
Populate advanced transmit descriptor.
#define INTELXVF_MSG_VERSION_1_1
API version 1.1.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define INTELX_RXDCTL_VME
Receive Descriptor Control Register.
#define INTELXVF_GPTC
Good Packets Transmitted Count.
struct intel_ring tx
Transmit descriptor ring.
#define INTELXVF_IVARM_MBOX_VALID
Mailbox valid.
#define INTELXVF_GOTCH
Good Packets Transmitted Count High.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static int intelxvf_mbox_queues(struct intel_nic *intel, int *vlan_thing)
Get queue configuration.
size_t max_pkt_len
Maximum packet length.
#define INTELXVF_IVARM_MBOX_DEFAULT
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
static void intelxvf_irq(struct net_device *netdev, int enable)
Enable or disable interrupts.
#define INTELXVF_NUM_RINGS
Number of queues.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define INTELXVF_GPRC
Good Packets Received Count.
#define INTELVF_MSG_TYPE_GET_QUEUES
Get queue configuration message.
#define INTELXVF_EIMC
Extended Interrupt Mask Clear Register.
#define INTELXVF_EICR
Extended Interrupt Cause Read Register.
void * memset(void *dest, int character, size_t len) __nonnull