17#define NATSEMI_BAR_SIZE 0x100
70#define NATSEMI_DESC_SIZE_MASK 0xfff
83#define NATSEMI_CR 0x0000
84#define NATSEMI_CR_RST 0x00000100UL
85#define NATSEMI_CR_RXR 0x00000020UL
86#define NATSEMI_CR_TXR 0x00000010UL
87#define NATSEMI_CR_RXE 0x00000004UL
88#define NATSEMI_CR_TXE 0x00000001UL
91#define NATSEMI_RESET_MAX_WAIT_MS 100
94#define NATSEMI_CFG 0x0004
95#define NATSEMI_CFG_LNKSTS 0x80000000UL
96#define NATSEMI_CFG_SPDSTS1 0x40000000UL
97#define NATSEMI_CFG_MODE_1000 0x00400000UL
98#define NATSEMI_CFG_PCI64_DET 0x00002000UL
99#define NATSEMI_CFG_DATA64_EN 0x00001000UL
100#define NATSEMI_CFG_M64ADDR 0x00000800UL
101#define NATSEMI_CFG_EXTSTS_EN 0x00000100UL
104#define NATSEMI_MEAR 0x0008
105#define NATSEMI_MEAR_EESEL 0x00000008UL
106#define NATSEMI_MEAR_EECLK 0x00000004UL
107#define NATSEMI_MEAR_EEDO 0x00000002UL
108#define NATSEMI_MEAR_EEDI 0x00000001UL
111#define NATSEMI_EEPROM_SIZE 32
114#define NATSEMI_EEPROM_MAC_SANE 0x0a
117#define NATSEMI_EEPROM_MAC_INSANE 0x06
120#define NATSEMI_PTSCR 0x000c
121#define NATSEMI_PTSCR_EELOAD_EN 0x00000004UL
124#define NATSEMI_EELOAD_MAX_WAIT_MS 100
127#define NATSEMI_ISR 0x0010
128#define NATSEMI_IRQ_TXDESC 0x00000080UL
129#define NATSEMI_IRQ_RXDESC 0x00000002UL
132#define NATSEMI_IMR 0x0014
135#define NATSEMI_IER 0x0018
136#define NATSEMI_IER_IE 0x00000001UL
139#define NATSEMI_TXDP 0x0020
142#define NATSEMI_TXDP_HI_64 0x0024
145#define NATSEMI_NUM_TX_DESC 4
148#define NATSEMI_TXCFG_32 0x24
151#define NATSEMI_TXCFG_64 0x28
152#define NATSEMI_TXCFG_CSI 0x80000000UL
153#define NATSEMI_TXCFG_HBI 0x40000000UL
154#define NATSEMI_TXCFG_ATP 0x10000000UL
155#define NATSEMI_TXCFG_ECRETRY 0x00800000UL
156#define NATSEMI_TXCFG_MXDMA(x) ( (x) << 20 )
157#define NATSEMI_TXCFG_FLTH(x) ( (x) << 8 )
158#define NATSEMI_TXCFG_DRTH(x) ( (x) << 0 )
165#define NATSEMI_TXCFG_MXDMA_DEFAULT NATSEMI_TXCFG_MXDMA ( 0x7 )
172#define NATSEMI_TXCFG_FLTH_DEFAULT NATSEMI_TXCFG_FLTH ( 512 / 32 )
183#define NATSEMI_TXCFG_DRTH_DEFAULT NATSEMI_TXCFG_DRTH ( 1024 / 32 )
186#define NATSEMI_RXDP 0x0030
189#define NATSEMI_RXDP_HI_64 0x0034
192#define NATSEMI_NUM_RX_DESC 4
195#define NATSEMI_RX_MAX_LEN ( ETH_FRAME_LEN + 4 + 4 )
198#define NATSEMI_RXCFG_32 0x34
201#define NATSEMI_RXCFG_64 0x38
202#define NATSEMI_RXCFG_ARP 0x40000000UL
203#define NATSEMI_RXCFG_ATX 0x10000000UL
204#define NATSEMI_RXCFG_ALP 0x08000000UL
205#define NATSEMI_RXCFG_MXDMA(x) ( (x) << 20 )
206#define NATSEMI_RXCFG_DRTH(x) ( (x) << 1 )
213#define NATSEMI_RXCFG_MXDMA_DEFAULT NATSEMI_RXCFG_MXDMA ( 0x7 )
222#define NATSEMI_RXCFG_DRTH_DEFAULT NATSEMI_RXCFG_DRTH ( 64 / 8 )
225#define NATSEMI_RFCR 0x0048
226#define NATSEMI_RFCR_RFEN 0x80000000UL
227#define NATSEMI_RFCR_AAB 0x40000000UL
228#define NATSEMI_RFCR_AAM 0x20000000UL
229#define NATSEMI_RFCR_AAU 0x10000000UL
230#define NATSEMI_RFCR_RFADDR( addr ) ( (addr) << 0 )
231#define NATSEMI_RFCR_RFADDR_MASK NATSEMI_RFCR_RFADDR ( 0x3ff )
234#define NATSEMI_RFADDR_PMATCH_BASE 0x000
237#define NATSEMI_RFDR 0x004c
238#define NATSEMI_RFDR_BMASK 0x00030000UL
239#define NATSEMI_RFDR_DATA( value ) ( (value) & 0xffff )
unsigned long long uint64_t
uint64_t address
Base address.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
union natsemi_descriptor __attribute__
struct ib_cm_common common
static unsigned int unsigned int reg
natsemi_descriptor_flags
Packet descriptor flags.
@ NATSEMI_DESC_INTR
Request descriptor interrupt.
@ NATSEMI_DESC_OWN
Descriptor is owned by NIC.
@ NATSEMI_DESC_OK
Packet OK.
#define NATSEMI_NUM_RX_DESC
Number of receive descriptors.
natsemi_nic_flags
National Semiconductor network card flags.
@ NATSEMI_EEPROM_LITTLE_ENDIAN
EEPROM is little-endian.
@ NATSEMI_1000
Card supports 1000Mbps link.
@ NATSEMI_EEPROM_INSANE
EEPROM layout is insane.
@ NATSEMI_64BIT
Card supports 64-bit operation.
SPI bit-bashing interface.
A 32-bit packet descriptor.
uint32_t bufptr
Buffer pointer.
uint32_t link
Link to next descriptor.
uint32_t cmdsts
Command / status.
A 64-bit packet descriptor.
uint64_t bufptr
Buffer pointer.
uint64_t link
Link to next descriptor.
uint32_t cmdsts
Command / status.
uint32_t extsts
Extended status.
A National Semiconductor network card.
struct spi_device eeprom
EEPROM.
struct spi_bit_basher spibit
SPI bit-bashing interface.
uint32_t cfg
Link status (cache)
struct io_buffer * rx_iobuf[NATSEMI_NUM_RX_DESC]
Receive I/O buffers.
struct natsemi_ring tx
Transmit descriptor ring.
struct natsemi_ring rx
Receive descriptor ring.
A National Semiconductor descriptor ring.
unsigned int reg
Descriptor start address register.
unsigned int count
Number of descriptors.
union natsemi_descriptor * desc
Descriptors.
unsigned int prod
Producer index.
unsigned int cons
Consumer index.
uint8_t reserved_a[16]
Reserved.
uint8_t reserved_b[12]
Reserved.
uint32_t cmdsts
Command / status.
struct natsemi_descriptor_32 d32
Descriptor.
uint8_t reserved[12]
Reserved.
struct natsemi_descriptor_64 d64
64-bit descriptor