85 DBGC (
nic,
"AQUANTIA: %p ring is at [%08llx,%08llx), reg base %#x\n",
86 nic, ( (
unsigned long long )phy_addr ),
87 ( (
unsigned long long ) phy_addr + ring->
length ), reg_base );
105 unsigned int tail = ring->
sw_tail;
114 unsigned int refilled = 0;
128 nic->rx_ring.sw_tail;
137 nic->iobufs[
nic->rx_ring.sw_tail] = iobuf;
139 DBGC(
nic,
"AQUANTIA: RX[%d] is [%llx,%llx)\n",
140 nic->rx_ring.sw_tail,
141 ( (
unsigned long long )
address ),
247 nic->hw_ops->start (
nic );
266 nic->hw_ops->stop (
nic );
281 nic->hw_ops->reset (
nic );
302 DBGC (
nic,
"AQUANTIA: %p out of transmit descriptors\n",
nic );
329 DBGC2 (
nic,
"AQUANTIA: %p TX[%d] is [%llx, %llx]\n",
330 nic,
nic->tx_ring.sw_tail,
331 ( (
unsigned long long )
address ),
351 DBGC (
nic,
"AQUANTIA: link up\n");
354 DBGC (
nic,
"AQUANTIA: link lost\n");
371 while (
nic->tx_ring.sw_head !=
nic->tx_ring.sw_tail ) {
375 nic->tx_ring.sw_head;
381 DBGC2 (
nic,
"AQUANTIA: %p TX[%d] complete\n",
382 nic,
nic->tx_ring.sw_head );
402 while (
nic->rx_ring.sw_head !=
nic->rx_ring.sw_tail ) {
406 nic->rx_ring.sw_head;
413 iobuf =
nic->iobufs[
nic->rx_ring.sw_head];
419 DBGC (
nic,
"AQUANTIA: %p RX[%d] complete (length %zd)\n",
520 goto err_unsupported;
535 if ( (
rc =
nic->hw_ops->reset (
nic ) ) != 0 )
544 goto err_register_netdev;
553 nic->hw_ops->reset (
nic );
577 nic->hw_ops->reset (
nic );
589 PCI_ROM ( 0x1D6A, 0x0001,
"AQC07",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A1 ),
590 PCI_ROM ( 0x1D6A, 0xD107,
"AQC07",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A1 ),
591 PCI_ROM ( 0x1D6A, 0x07B1,
"AQC07",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A1 ),
592 PCI_ROM ( 0x1D6A, 0x87B1,
"AQC07",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A1 ),
600 PCI_ROM ( 0x1D6A, 0xD108,
"AQC08",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A1 ),
601 PCI_ROM ( 0x1D6A, 0x08B1,
"AQC08",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A1 ),
602 PCI_ROM ( 0x1D6A, 0x88B1,
"AQC08",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A1 ),
603 PCI_ROM ( 0x1D6A, 0x11B1,
"AQC11",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A1 ),
604 PCI_ROM ( 0x1D6A, 0x91B1,
"AQC11",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A1 ),
607 PCI_ROM ( 0x1D6A, 0xD109,
"AQC09",
"Marvell AQtion 2.5Gbit Network Adapter",
ATL_FLAG_A1 ),
608 PCI_ROM ( 0x1D6A, 0x09B1,
"AQC09",
"Marvell AQtion 2.5Gbit Network Adapter",
ATL_FLAG_A1 ),
609 PCI_ROM ( 0x1D6A, 0x89B1,
"AQC09",
"Marvell AQtion 2.5Gbit Network Adapter",
ATL_FLAG_A1 ),
610 PCI_ROM ( 0x1D6A, 0x12B1,
"AQC12",
"Marvell AQtion 2.5Gbit Network Adapter",
ATL_FLAG_A1 ),
611 PCI_ROM ( 0x1D6A, 0x92B1,
"AQC12",
"Marvell AQtion 2.5Gbit Network Adapter",
ATL_FLAG_A1 ),
614 PCI_ROM ( 0x1D6A, 0x00C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
615 PCI_ROM ( 0x1D6A, 0x94C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
616 PCI_ROM ( 0x1D6A, 0x93C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
617 PCI_ROM ( 0x1D6A, 0x04C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
618 PCI_ROM ( 0x1D6A, 0x14C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
619 PCI_ROM ( 0x1D6A, 0x12C0,
"AQC13",
"Marvell AQtion 10Gbit Network Adapter",
ATL_FLAG_A2 ),
620 PCI_ROM ( 0x1D6A, 0x03C0,
"AQC14",
"Marvell AQtion 5Gbit Network Adapter",
ATL_FLAG_A2 ),
An aQuanita network card.
unsigned long membase
Memory base.
#define ATL_TPB0_CTRL2_HIGH_TSH
struct arbelprm_rc_send_wqe rc
#define iob_put(iobuf, len)
struct dma_device dma
DMA device.
static void atl_ring_next_dx(unsigned int *val)
static void atl_close(struct net_device *netdev)
Close network device.
#define ATL_DESC_TX_CMD_VALUE
#define ATL_RPB0_CTRL1_SIZE
#define ATL_DESC_TX_BUF_LEN_MASK
void atl_check_link(struct net_device *netdev)
#define ATL_TX_DMA_DESC_ADDR
int(* open)(struct net_device *netdev)
Open network device.
#define ATL_IRQ_CTRL_COR_EN
#define ATL_IRQ_CTRL_REG_RST_DIS
#define ATL_RPF_CTRL2_VLAN_PROMISC
#define ATL_TX_DESC_STATUS_DD
void atl_rx_ring_fill(struct atl_nic *nic)
#define ATL_RX_DMA_DESC_ADDR
unsigned long driver_data
Arbitrary driver data.
static void netdev_tx_complete_next(struct net_device *netdev)
Complete network transmission.
struct pci_device_id * ids
PCI ID table.
uint64_t address
Base address.
static void atl_ring_free(struct atl_ring *ring)
#define ATL_DESC_TX_DX_EOP_VALUE
unsigned long long uint64_t
#define ATL2_RPF_NEW_EN_ADR_EN
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
static int atl_open(struct net_device *netdev)
Open network device.
static struct pci_device_id atl_nics[]
Marvell PCI device IDs.
#define ATL_IRQ_MAP_REG1_TX0
int atl_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
#define ATL_IRQ_MAP_REG1_TX0_EN
#define ATL_DESC_TX_EOP_MASK
struct device dev
Generic device.
Dynamic memory allocation.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void atl_remove(struct pci_device *pci)
Remove PCI device.
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define ATL2_RPF_NEW_EN_ADR
#define ENOMEM
Not enough space.
#define ATL_RPF_CTRL1_BRC_EN
static void atl_poll(struct net_device *netdev)
Poll for completed and received packets.
void atl_poll_rx(struct net_device *netdev)
Poll for received packets.
void dma_free(struct dma_mapping *map, void *addr, size_t len)
Unmap and free DMA-coherent buffer.
#define ATL_RPF_CTRL1_L2_PROMISC
#define ATL_DESC_TX_BUF_LEN_OFFSET
#define ATL_TPB0_CTRL2_LOW_TSH
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define ATL_DESC_TX_PAY_LEN_OFFSET
void * priv
Driver private data.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static struct net_device * netdev
static __always_inline physaddr_t iob_dma(struct io_buffer *iobuf)
Get I/O buffer DMA address.
#define ATL_RX_DESC_STATUS_DD
void unregister_netdev(struct net_device *netdev)
Unregister network device.
#define ATL_WRITE_REG(VAL, REG)
#define cpu_to_le32(value)
struct dma_mapping map
Descriptor ring DMA mapping.
#define ATL_TPB_CTRL_PAD_EN
struct io_buffer * alloc_rx_iob(size_t len, struct dma_device *dma)
Allocate and map I/O buffer for receive DMA.
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define ENODEV
No such device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define ATL_RING_TAIL_PTR
#define ATL_READ_REG(REG)
A PCI device ID list entry.
#define ATL_TPB0_CTRL1_SIZE
#define le16_to_cpu(value)
static int atl_ring_alloc(const struct atl_nic *nic, struct atl_ring *ring, uint32_t desc_size, uint32_t reg_base)
static struct xen_remove_from_physmap * remove
struct atl_hw_ops atl2_hw
#define ATL_IRQ_MAP_REG1_RX0
#define ATL_IRQ_MAP_REG1_RX0_EN
Marvell AQtion family network card driver definitions.
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
struct device * dev
Underlying hardware device.
void * dma_alloc(struct dma_device *dma, struct dma_mapping *map, size_t len, size_t align)
Allocate and map DMA-coherent buffer.
Network device management.
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
#define ATL_RPF_CTRL1_ACTION
#define ATL_DESC_TX_EOP_OFFSET
void atl_poll_tx(struct net_device *netdev)
Poll for completed packets.
static int atl_probe(struct pci_device *pci)
Probe PCI device.
#define ATL_DESC_TX_CMD_OFFSET
#define ATL_RX_DMA_DESC_BUF_SIZE
#define ENOBUFS
No buffer space available.
int(* probe)(struct pci_device *pci)
Probe device.
#define ATL_DESC_TX_PAY_LEN_MASK
#define ATL_RING_RX_CTRL_EN
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.
struct pci_device_id * id
Driver device ID.
#define ATL_TX_IRQ_CTRL_WB_EN
#define cpu_to_le16(value)
void iounmap(volatile const void *io_addr)
Unmap I/O address.
#define ATL_DESC_TX_CMD_MASK
static void atl_irq(struct net_device *netdev, int enable)
Enable or disable interrupts.
#define ENOERR
Operation completed successfully.
#define ATL_RPB0_CTRL2_FC_EN
struct pci_driver atl_driver __pci_driver
Marvell PCI driver.
static struct net_device_operations atl_operations
Marvell network device operations.
#define ATL_RING_TX_CTRL_EN
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.
#define ATL_RPB0_CTRL2_LOW_TSH
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
int atl_ring_full(const struct atl_ring *ring)
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define ATL_RPB0_CTRL2_HIGH_TSH
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
#define ATL_RPF_CTRL1_BRC_TSH
if(natsemi->flags &NATSEMI_64BIT) return 1
#define ATL_RX_IRQ_CTRL_WB_EN
void * memset(void *dest, int character, size_t len) __nonnull