18 #define INTEL_BAR_SIZE ( 128 * 1024 ) 35 #define INTEL_DESC_FL_DTYP( dtyp ) ( (dtyp) << 4 ) 36 #define INTEL_DESC_FL_DTYP_DATA INTEL_DESC_FL_DTYP ( 0x03 ) 39 #define INTEL_DESC_CMD_DEXT 0x20 42 #define INTEL_DESC_CMD_RS 0x08 45 #define INTEL_DESC_CMD_IFCS 0x02 48 #define INTEL_DESC_CMD_EOP 0x01 51 #define INTEL_DESC_STATUS_DD 0x00000001UL 54 #define INTEL_DESC_STATUS_RXE 0x00000100UL 57 #define INTEL_DESC_STATUS_PAYLEN( len ) ( (len) << 14 ) 60 #define INTEL_CTRL 0x00000UL 61 #define INTEL_CTRL_LRST 0x00000008UL 62 #define INTEL_CTRL_ASDE 0x00000020UL 63 #define INTEL_CTRL_SLU 0x00000040UL 64 #define INTEL_CTRL_FRCSPD 0x00000800UL 65 #define INTEL_CTRL_FRCDPLX 0x00001000UL 66 #define INTEL_CTRL_RST 0x04000000UL 67 #define INTEL_CTRL_PHY_RST 0x80000000UL 70 #define INTEL_RESET_DELAY_MS 20 73 #define INTEL_STATUS 0x00008UL 74 #define INTEL_STATUS_LU 0x00000002UL 77 #define INTEL_EERD 0x00014UL 78 #define INTEL_EERD_START 0x00000001UL 79 #define INTEL_EERD_DONE_SMALL 0x00000010UL 80 #define INTEL_EERD_DONE_LARGE 0x00000002UL 81 #define INTEL_EERD_ADDR_SHIFT_SMALL 8 82 #define INTEL_EERD_ADDR_SHIFT_LARGE 2 83 #define INTEL_EERD_DATA(value) ( (value) >> 16 ) 86 #define INTEL_EEPROM_MAX_WAIT_MS 100 89 #define INTEL_EEPROM_WORD_LEN_LOG2 1 92 #define INTEL_EEPROM_MIN_SIZE_WORDS 64 95 #define INTEL_EEPROM_MAC 0x00 98 #define INTEL_ICR 0x000c0UL 99 #define INTEL_IRQ_TXDW 0x00000001UL 100 #define INTEL_IRQ_TXQE 0x00000002UL 101 #define INTEL_IRQ_LSC 0x00000004UL 102 #define INTEL_IRQ_RXDMT0 0x00000010UL 103 #define INTEL_IRQ_RXO 0x00000040UL 104 #define INTEL_IRQ_RXT0 0x00000080UL 107 #define INTEL_IMS 0x000d0UL 110 #define INTEL_IMC 0x000d8UL 113 #define INTEL_RCTL 0x00100UL 114 #define INTEL_RCTL_EN 0x00000002UL 115 #define INTEL_RCTL_UPE 0x00000008UL 116 #define INTEL_RCTL_MPE 0x00000010UL 117 #define INTEL_RCTL_BAM 0x00008000UL 118 #define INTEL_RCTL_BSIZE_BSEX(bsex,bsize) \ 119 ( ( (bsize) << 16 ) | ( (bsex) << 25 ) ) 120 #define INTEL_RCTL_BSIZE_2048 INTEL_RCTL_BSIZE_BSEX ( 0, 0 ) 121 #define INTEL_RCTL_BSIZE_BSEX_MASK INTEL_RCTL_BSIZE_BSEX ( 1, 3 ) 122 #define INTEL_RCTL_SECRC 0x04000000UL 125 #define INTEL_TCTL 0x00400UL 126 #define INTEL_TCTL_EN 0x00000002UL 127 #define INTEL_TCTL_PSP 0x00000008UL 128 #define INTEL_TCTL_CT(x) ( (x) << 4 ) 129 #define INTEL_TCTL_CT_DEFAULT INTEL_TCTL_CT ( 0x0f ) 130 #define INTEL_TCTL_CT_MASK INTEL_TCTL_CT ( 0xff ) 131 #define INTEL_TCTL_COLD(x) ( (x) << 12 ) 132 #define INTEL_TCTL_COLD_DEFAULT INTEL_TCTL_COLD ( 0x040 ) 133 #define INTEL_TCTL_COLD_MASK INTEL_TCTL_COLD ( 0x3ff ) 136 #define INTEL_PBA 0x01000UL 139 #define INTEL_PBS 0x01008UL 142 #define INTEL_RXPBS 0x02404UL 143 #define INTEL_RXPBS_I210 0x000000a2UL 146 #define INTEL_RD 0x02800UL 153 #define INTEL_NUM_RX_DESC 16 156 #define INTEL_RX_FILL 8 159 #define INTEL_RX_MAX_LEN 2048 162 #define INTEL_TXPBS 0x03404UL 163 #define INTEL_TXPBS_I210 0x04000014UL 166 #define INTEL_TD 0x03800UL 173 #define INTEL_NUM_TX_DESC 16 176 #define INTEL_TX_FILL ( INTEL_NUM_TX_DESC - 1 ) 179 #define INTEL_xDBAL 0x00 182 #define INTEL_xDBAH 0x04 185 #define INTEL_xDLEN 0x08 188 #define INTEL_xDH 0x10 191 #define INTEL_xDT 0x18 194 #define INTEL_xDCTL 0x28 195 #define INTEL_xDCTL_ENABLE 0x02000000UL 198 #define INTEL_DISABLE_MAX_WAIT_MS 100 201 #define INTEL_RAL0 0x05400UL 204 #define INTEL_RAH0 0x05404UL 205 #define INTEL_RAH0_AV 0x80000000UL 208 #define INTEL_FEXTNVM11 0x05bbcUL 209 #define INTEL_FEXTNVM11_WTF 0x00002000UL 335 #define INTEL_I219 ( INTEL_NO_PHY_RST | INTEL_RST_HANG ) 344 DBGC ( intel,
"INTEL %p TX %04x(%02x)/%04x(%02x) " 345 "RX %04x(%02x)/%04x(%02x)\n", intel,
346 ( intel->
tx.
cons & 0xffff ),
348 ( intel->
tx.
prod & 0xffff ),
350 ( intel->
rx.
cons & 0xffff ),
352 ( intel->
rx.
prod & 0xffff ),
unsigned int force_icr
Forced interrupts.
void intel_describe_tx_adv(struct intel_descriptor *tx, physaddr_t addr, size_t len)
Populate advanced transmit descriptor.
#define INTEL_NUM_RX_DESC
Number of receive descriptors.
static unsigned int unsigned int reg
void intel_poll_tx(struct net_device *netdev)
Poll for completed packets.
VMware missing interrupt workaround required.
struct dma_mapping map
Descriptor ring DMA mapping.
A non-volatile storage device.
void intel_describe_rx(struct intel_descriptor *rx, physaddr_t addr, size_t len)
Populate receive descriptor.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
struct intel_ring rx
Receive descriptor ring.
uint64_t desc
Microcode descriptor list physical address.
#define INTEL_xDT
Receive/Transmit Descriptor Tail (offset)
size_t len
Length (in bytes)
unsigned long long uint64_t
PBS/PBA errata workaround required.
An Intel descriptor ring.
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.
unsigned int cons
Consumer index.
unsigned int reg
Register block.
unsigned int port
Port number (for multi-port devices)
#define INTEL_xDH
Receive/Transmit Descriptor Head (offset)
static void intel_init_mbox(struct intel_mailbox *mbox, unsigned int ctrl, unsigned int mem)
Initialise mailbox.
int intel_create_ring(struct intel_nic *intel, struct intel_ring *ring)
Create descriptor ring.
PBSIZE registers must be explicitly reset.
uint32_t eerd_done
EEPROM done flag.
static struct net_device * netdev
struct io_buffer * rx_iobuf[INTEL_NUM_RX_DESC]
Receive I/O buffers.
uint16_t count
Number of entries.
uint64_t address
Buffer address.
static void intel_diag(struct intel_nic *intel)
Dump diagnostic information.
int intel_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
void intel_refill_rx(struct intel_nic *intel)
Refill receive descriptor ring.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void intel_destroy_ring(struct intel_nic *intel, struct intel_ring *ring)
Destroy descriptor ring.
An Intel virtual function mailbox.
struct intel_receive_address::@65 reg
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.
void(* describe)(struct intel_descriptor *desc, physaddr_t addr, size_t len)
Populate descriptor.
unsigned int mem
Mailbox memory base.
struct dma_device * dma
DMA device.
unsigned int ctrl
Mailbox control register.
unsigned int prod
Producer index.
void intel_empty_rx(struct intel_nic *intel)
Discard unused receive I/O buffers.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
struct intel_descriptor * desc
Descriptors.
struct intel_ring tx
Transmit descriptor ring.
Reset may cause a complete device hang.
unsigned int eerd_addr_shift
EEPROM address shift.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
void intel_describe_tx(struct intel_descriptor *tx, physaddr_t addr, size_t len)
Populate transmit descriptor.