19#define INTEL_BAR_SIZE ( 128 * 1024 )
36#define INTEL_DESC_FL_DTYP( dtyp ) ( (dtyp) << 4 )
37#define INTEL_DESC_FL_DTYP_DATA INTEL_DESC_FL_DTYP ( 0x03 )
40#define INTEL_DESC_CMD_DEXT 0x20
43#define INTEL_DESC_CMD_RS 0x08
46#define INTEL_DESC_CMD_IFCS 0x02
49#define INTEL_DESC_CMD_EOP 0x01
52#define INTEL_DESC_STATUS_DD 0x00000001UL
55#define INTEL_DESC_STATUS_RXE 0x00000100UL
58#define INTEL_DESC_STATUS_PAYLEN( len ) ( (len) << 14 )
61#define INTEL_CTRL 0x00000UL
62#define INTEL_CTRL_LRST 0x00000008UL
63#define INTEL_CTRL_ASDE 0x00000020UL
64#define INTEL_CTRL_SLU 0x00000040UL
65#define INTEL_CTRL_FRCSPD 0x00000800UL
66#define INTEL_CTRL_FRCDPLX 0x00001000UL
67#define INTEL_CTRL_RST 0x04000000UL
68#define INTEL_CTRL_PHY_RST 0x80000000UL
71#define INTEL_RESET_DELAY_MS 20
74#define INTEL_STATUS 0x00008UL
75#define INTEL_STATUS_LU 0x00000002UL
78#define INTEL_EERD 0x00014UL
79#define INTEL_EERD_START 0x00000001UL
80#define INTEL_EERD_DONE_SMALL 0x00000010UL
81#define INTEL_EERD_DONE_LARGE 0x00000002UL
82#define INTEL_EERD_ADDR_SHIFT_SMALL 8
83#define INTEL_EERD_ADDR_SHIFT_LARGE 2
84#define INTEL_EERD_DATA(value) ( (value) >> 16 )
87#define INTEL_EEPROM_MAX_WAIT_MS 100
90#define INTEL_EEPROM_WORD_LEN_LOG2 1
93#define INTEL_EEPROM_MIN_SIZE_WORDS 64
96#define INTEL_EEPROM_MAC 0x00
99#define INTEL_ICR 0x000c0UL
100#define INTEL_IRQ_TXDW 0x00000001UL
101#define INTEL_IRQ_TXQE 0x00000002UL
102#define INTEL_IRQ_LSC 0x00000004UL
103#define INTEL_IRQ_RXDMT0 0x00000010UL
104#define INTEL_IRQ_RXO 0x00000040UL
105#define INTEL_IRQ_RXT0 0x00000080UL
108#define INTEL_IMS 0x000d0UL
111#define INTEL_IMC 0x000d8UL
114#define INTEL_RCTL 0x00100UL
115#define INTEL_RCTL_EN 0x00000002UL
116#define INTEL_RCTL_UPE 0x00000008UL
117#define INTEL_RCTL_MPE 0x00000010UL
118#define INTEL_RCTL_BAM 0x00008000UL
119#define INTEL_RCTL_BSIZE_BSEX(bsex,bsize) \
120 ( ( (bsize) << 16 ) | ( (bsex) << 25 ) )
121#define INTEL_RCTL_BSIZE_2048 INTEL_RCTL_BSIZE_BSEX ( 0, 0 )
122#define INTEL_RCTL_BSIZE_BSEX_MASK INTEL_RCTL_BSIZE_BSEX ( 1, 3 )
123#define INTEL_RCTL_SECRC 0x04000000UL
126#define INTEL_TCTL 0x00400UL
127#define INTEL_TCTL_EN 0x00000002UL
128#define INTEL_TCTL_PSP 0x00000008UL
129#define INTEL_TCTL_CT(x) ( (x) << 4 )
130#define INTEL_TCTL_CT_DEFAULT INTEL_TCTL_CT ( 0x0f )
131#define INTEL_TCTL_CT_MASK INTEL_TCTL_CT ( 0xff )
132#define INTEL_TCTL_COLD(x) ( (x) << 12 )
133#define INTEL_TCTL_COLD_DEFAULT INTEL_TCTL_COLD ( 0x040 )
134#define INTEL_TCTL_COLD_MASK INTEL_TCTL_COLD ( 0x3ff )
137#define INTEL_PBA 0x01000UL
140#define INTEL_PBS 0x01008UL
143#define INTEL_RXPBS 0x02404UL
144#define INTEL_RXPBS_I210 0x000000a2UL
147#define INTEL_RD 0x02800UL
154#define INTEL_NUM_RX_DESC 16
157#define INTEL_RX_FILL 8
160#define INTEL_RX_MAX_LEN 2048
163#define INTEL_TXPBS 0x03404UL
164#define INTEL_TXPBS_I210 0x04000014UL
167#define INTEL_TD 0x03800UL
174#define INTEL_NUM_TX_DESC 16
177#define INTEL_TX_FILL ( INTEL_NUM_TX_DESC - 1 )
180#define INTEL_xDBAL 0x00
183#define INTEL_xDBAH 0x04
186#define INTEL_xDLEN 0x08
189#define INTEL_xDH 0x10
192#define INTEL_xDT 0x18
195#define INTEL_xDCTL 0x28
196#define INTEL_xDCTL_ENABLE 0x02000000UL
199#define INTEL_DISABLE_MAX_WAIT_MS 100
202#define INTEL_RAL0 0x05400UL
205#define INTEL_RAH0 0x05404UL
206#define INTEL_RAH0_AV 0x80000000UL
209#define INTEL_FEXTNVM11 0x05bbcUL
210#define INTEL_FEXTNVM11_WTF 0x00002000UL
336#define INTEL_I219 ( INTEL_NO_PHY_RST | INTEL_RST_HANG )
345 DBGC ( intel,
"INTEL %p TX %04x(%02x)/%04x(%02x) "
346 "RX %04x(%02x)/%04x(%02x)\n", intel,
347 ( intel->
tx.
cons & 0xffff ),
349 ( intel->
tx.
prod & 0xffff ),
351 ( intel->
rx.
cons & 0xffff ),
353 ( intel->
rx.
prod & 0xffff ),
unsigned long long uint64_t
uint8_t ctrl
Ring control.
uint32_t addr
Buffer address.
struct ena_llq_option desc
Descriptor counts.
static struct net_device * netdev
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
void intel_describe_rx(struct intel_descriptor *rx, physaddr_t addr, size_t len)
Populate receive descriptor.
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.
static void intel_diag(struct intel_nic *intel)
Dump diagnostic information.
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.
void intel_poll_rx(struct net_device *netdev)
Poll for received packets.
#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.
@ INTEL_PBS_ERRATA
PBS/PBA errata workaround required.
@ INTEL_VMWARE
VMware missing interrupt workaround required.
@ INTEL_NO_ASDE
ASDE is broken.
@ INTEL_PBSIZE_RST
PBSIZE registers must be explicitly reset.
@ INTEL_NO_PHY_RST
PHY reset is broken.
@ INTEL_RST_HANG
Reset may cause a complete device hang.
#define INTEL_xDT
Receive/Transmit Descriptor Tail (offset)
void intel_poll_tx(struct net_device *netdev)
Poll for completed packets.
#define INTEL_NUM_RX_DESC
Number of receive descriptors.
void intel_describe_tx(struct intel_descriptor *tx, physaddr_t addr, size_t len)
Populate transmit descriptor.
void intel_destroy_ring(struct intel_nic *intel, struct intel_ring *ring)
Destroy descriptor ring.
void intel_reset_ring(struct intel_nic *intel, unsigned int reg)
Reset descriptor ring.
void intel_refill_rx(struct intel_nic *intel)
Refill receive descriptor ring.
void intel_describe_tx_adv(struct intel_descriptor *tx, physaddr_t addr, size_t len)
Populate advanced transmit descriptor.
int intel_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
static unsigned int unsigned int reg
uint64_t address
Buffer address.
An Intel virtual function mailbox.
unsigned int ctrl
Mailbox control register.
unsigned int mem
Mailbox memory base.
unsigned int port
Port number (for multi-port devices)
struct intel_ring tx
Transmit descriptor ring.
struct io_buffer * rx_iobuf[INTEL_NUM_RX_DESC]
Receive I/O buffers.
struct nvs_device eeprom
EEPROM.
struct intel_ring rx
Receive descriptor ring.
unsigned int eerd_addr_shift
EEPROM address shift.
uint32_t eerd_done
EEPROM done flag.
unsigned int force_icr
Forced interrupts.
struct intel_mailbox mbox
Mailbox.
struct dma_device * dma
DMA device.
An Intel descriptor ring.
void(* describe)(struct intel_descriptor *desc, physaddr_t addr, size_t len)
Populate descriptor.
struct dma_mapping map
Descriptor ring DMA mapping.
size_t len
Length (in bytes)
unsigned int cons
Consumer index.
struct intel_descriptor * desc
Descriptors.
unsigned int reg
Register block.
unsigned int prod
Producer index.
A non-volatile storage device.
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.