25#ifndef _SONIC_DP83932_
26#define _SONIC_DP83932_
34#define SONIC_DEBUG_NONE 0x0000
35#define SONIC_DEBUG_ALL 0xFFFF
36#define SONIC_DEBUG_PRINT_REGISTERS 0x0001
37#define SONIC_DEBUG_MEMORY 0x0002
38#define SONIC_DEBUG_MEMORY_ALLOCATE 0x0004
39#define SONIC_DEBUG_MEMORY_DESCRIPTORS 0x0008
40#define SONIC_DEBUG_FRAGMENTS 0x0008
41#define SONIC_DEBUG_CAM 0x0010
42#define SONIC_DEBUG_DESCRIPTORS 0x0020
43#define SONIC_DEBUG_ERRORS 0x0040
44#define SONIC_DEBUG_DUMP_TX_MBUFS 0x0080
45#define SONIC_DEBUG_DUMP_RX_MBUFS 0x0100
47#define SONIC_DEBUG_DUMP_MBUFS \
48 (SONIC_DEBUG_DUMP_TX_MBUFS|SONIC_DEBUG_DUMP_RX_MBUFS)
50#define SONIC_DEBUG (SONIC_DEBUG_NONE)
61#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
62extern char SONIC_Reg_name[64][6];
70typedef void (*sonic_write_register_t)(
76typedef uint32_t (*sonic_read_register_t)(
88 sonic_write_register_t write_register;
89 sonic_read_register_t read_register;
99#define SONIC_REG_CR 0x00
100#define SONIC_REG_DCR 0x01
101#define SONIC_REG_RCR 0x02
102#define SONIC_REG_TCR 0x03
103#define SONIC_REG_IMR 0x04
104#define SONIC_REG_ISR 0x05
105#define SONIC_REG_UTDA 0x06
106#define SONIC_REG_CTDA 0x07
107#define SONIC_REG_URDA 0x0D
108#define SONIC_REG_CRDA 0x0E
109#define SONIC_REG_EOBC 0x13
110#define SONIC_REG_URRA 0x14
111#define SONIC_REG_RSA 0x15
112#define SONIC_REG_REA 0x16
113#define SONIC_REG_RRP 0x17
114#define SONIC_REG_RWP 0x18
115#define SONIC_REG_CEP 0x21
116#define SONIC_REG_CAP2 0x22
117#define SONIC_REG_CAP1 0x23
118#define SONIC_REG_CAP0 0x24
119#define SONIC_REG_CE 0x25
120#define SONIC_REG_CDP 0x26
121#define SONIC_REG_CDC 0x27
122#define SONIC_REG_SR 0x28
123#define SONIC_REG_WT0 0x29
124#define SONIC_REG_WT1 0x2A
125#define SONIC_REG_RSC 0x2B
126#define SONIC_REG_CRCT 0x2C
127#define SONIC_REG_FAET 0x2D
128#define SONIC_REG_MPT 0x2E
129#define SONIC_REG_MDT 0x2F
130#define SONIC_REG_DCR2 0x3F
135#define CR_LCAM 0x0200
136#define CR_RRRA 0x0100
140#define CR_RXEN 0x0008
141#define CR_RXDIS 0x0004
148#define DCR_EXBUS 0x8000
149#define DCR_LBR 0x2000
150#define DCR_PO1 0x1000
151#define DCR_PO0 0x0800
152#define DCR_SBUS 0x0400
153#define DCR_USR1 0x0200
154#define DCR_USR0 0x0100
155#define DCR_WC1 0x0080
156#define DCR_WC0 0x0040
158#define DCR_BMS 0x0010
159#define DCR_RFT1 0x0008
160#define DCR_RFT0 0x0004
161#define DCR_TFT1 0x0002
162#define DCR_TFT0 0x0001
165#define DCR_SYNC DCR_SBUS
169#define DCR_WAIT1 DCR_WC0
170#define DCR_WAIT2 DCR_WC1
171#define DCR_WAIT3 (DCR_WC1|DCR_WC0)
174#define DCR_DW32 DCR_DW
177#define DCR_DMABLOCK DCR_BMS
180#define DCR_RFT8 DCR_RFT0
181#define DCR_RFT16 DCR_RFT1
182#define DCR_RFT24 (DCR_RFT1|DCR_RFT0)
185#define DCR_TFT16 DCR_TFT0
186#define DCR_TFT24 DCR_TFT1
187#define DCR_TFT28 (DCR_TFT1|DCR_TFT0)
192#define RCR_ERR 0x8000
193#define RCR_RNT 0x4000
194#define RCR_BRD 0x2000
195#define RCR_PRO 0x1000
196#define RCR_AMC 0x0800
197#define RCR_LB1 0x0400
198#define RCR_LB0 0x0200
201#define RCR_LPKT 0x0040
202#define RCR_CRS 0x0020
203#define RCR_COL 0x0010
204#define RCR_CRCR 0x0008
205#define RCR_FAER 0x0004
206#define RCR_LBK 0x0002
207#define RCR_PRX 0x0001
212#define TCR_PINT 0x8000
213#define TCR_POWC 0x4000
214#define TCR_CRCI 0x2000
215#define TCR_EXDIS 0x1000
216#define TCR_EXD 0x0400
217#define TCR_DEF 0x0200
218#define TCR_NCRS 0x0100
219#define TCR_CRSL 0x0080
220#define TCR_EXC 0x0040
221#define TCR_OWC 0x0020
222#define TCR_PMB 0x0008
224#define TCR_BCM 0x0002
225#define TCR_PTX 0x0001
230#define IMR_BREN 0x4000
231#define IMR_HBLEN 0x2000
232#define IMR_LCDEN 0x1000
233#define IMR_PINTEN 0x0800
234#define IMR_PRXEN 0x0400
235#define IMR_PTXEN 0x0200
236#define IMR_TXEREN 0x0100
237#define IMR_TCEN 0x0080
238#define IMR_RDEEN 0x0040
239#define IMR_RBEEN 0x0020
240#define IMR_RBAEEN 0x0010
241#define IMR_CRCEN 0x0008
242#define IMR_FAEEN 0x0004
243#define IMR_MPEN 0x0002
244#define IMR_RFOEN 0x0001
250#define ISR_HBL 0x2000
251#define ISR_LCD 0x1000
252#define ISR_PINT 0x0800
253#define ISR_PKTRX 0x0400
254#define ISR_TXDN 0x0200
255#define ISR_TXER 0x0100
257#define ISR_RDE 0x0040
258#define ISR_RBE 0x0020
259#define ISR_RBAE 0x0010
260#define ISR_CRC 0x0008
261#define ISR_FAE 0x0004
263#define ISR_RFO 0x0001
268#define DCR2_EXPO3 0x8000
269#define DCR2_EXPO2 0x4000
270#define DCR2_EXPO1 0x2000
271#define DCR2_EXPO0 0x1000
272#define DCR2_HBDIS 0x0800
273#define DCR2_PH 0x0010
274#define DCR2_PCM 0x0004
275#define DCR2_PCNM 0x0002
276#define DCR2_RJCM 0x0001
283#define SONIC_REVISION_B 4
284#define SONIC_REVISION_DP83934 5
285#define SONIC_REVISION_C 6
301#define MAXIMUM_FRAGS_PER_DESCRIPTOR 6
313#define frag_link frag_lsw
316 } frag[MAXIMUM_FRAGS_PER_DESCRIPTOR];
328 volatile uint32_t *linkp;
338#define TDA_CONFIG_PINT 0x8000
339#define TDA_CONFIG_POWC 0x4000
340#define TDA_CONFIG_CRCI 0x2000
341#define TDA_CONFIG_EXDIS 0x1000
346#define TDA_STATUS_COLLISION_MASK 0xF800
347#define TDA_STATUS_COLLISION_SHIFT 11
348#define TDA_STATUS_EXD 0x0400
349#define TDA_STATUS_DEF 0x0200
350#define TDA_STATUS_NCRS 0x0100
351#define TDA_STATUS_CRSL 0x0080
352#define TDA_STATUS_EXC 0x0040
353#define TDA_STATUS_OWC 0x0020
354#define TDA_STATUS_PMB 0x0008
355#define TDA_STATUS_FU 0x0004
356#define TDA_STATUS_BCM 0x0002
357#define TDA_STATUS_PTX 0x0001
359#define TDA_LINK_EOL 0x0001
360#define TDA_LINK_EOL_MASK 0xFFFE
379 uint32_t buff_ptr_lsw;
380 uint32_t buff_ptr_msw;
381 uint32_t buff_wc_lsw;
382 uint32_t buff_wc_msw;
422#define RDA_STATUS_ERR 0x8800
423#define RDA_STATUS_RNT 0x4000
424#define RDA_STATUS_BRD 0x2000
425#define RDA_STATUS_PRO 0x1000
426#define RDA_STATUS_AMC 0x0800
427#define RDA_STATUS_LB1 0x0400
428#define RDA_STATUS_LB0 0x0200
429#define RDA_STATUS_MC 0x0100
430#define RDA_STATUS_BC 0x0080
431#define RDA_STATUS_LPKT 0x0040
432#define RDA_STATUS_CRS 0x0020
433#define RDA_STATUS_COL 0x0010
434#define RDA_STATUS_CRCR 0x0008
435#define RDA_STATUS_FAER 0x0004
436#define RDA_STATUS_LBK 0x0002
437#define RDA_STATUS_PRX 0x0001
439#define RDA_LINK_EOL 0x0001
440#define RDA_LINK_EOL_MASK 0xFFFE
441#define RDA_IN_USE 0x0000
443#define RDA_FREE 0xFFFF
449int rtems_sonic_driver_attach (
450 struct rtems_bsdnet_ifconfig *
config,
455void ipalign(
struct mbuf *m);
Definition: deflate.c:115