30 #define SONIC_CMD 0x00
31 #define SONIC_DCR 0x01
32 #define SONIC_RCR 0x02
33 #define SONIC_TCR 0x03
34 #define SONIC_IMR 0x04
35 #define SONIC_ISR 0x05
37 #define SONIC_UTDA 0x06
38 #define SONIC_CTDA 0x07
40 #define SONIC_URDA 0x0d
41 #define SONIC_CRDA 0x0e
42 #define SONIC_EOBC 0x13
43 #define SONIC_URRA 0x14
44 #define SONIC_RSA 0x15
45 #define SONIC_REA 0x16
46 #define SONIC_RRP 0x17
47 #define SONIC_RWP 0x18
48 #define SONIC_RSC 0x2b
50 #define SONIC_CEP 0x21
51 #define SONIC_CAP2 0x22
52 #define SONIC_CAP1 0x23
53 #define SONIC_CAP0 0x24
55 #define SONIC_CDP 0x26
56 #define SONIC_CDC 0x27
58 #define SONIC_WT0 0x29
59 #define SONIC_WT1 0x2a
66 #define SONIC_TPS 0x08
67 #define SONIC_TFC 0x09
68 #define SONIC_TSA0 0x0a
69 #define SONIC_TSA1 0x0b
70 #define SONIC_TFS 0x0c
72 #define SONIC_CRBA0 0x0f
73 #define SONIC_CRBA1 0x10
74 #define SONIC_RBWC0 0x11
75 #define SONIC_RBWC1 0x12
76 #define SONIC_TTDA 0x20
77 #define SONIC_MDT 0x2f
79 #define SONIC_TRBA0 0x19
80 #define SONIC_TRBA1 0x1a
81 #define SONIC_TBWC0 0x1b
82 #define SONIC_TBWC1 0x1c
83 #define SONIC_LLFA 0x1f
85 #define SONIC_ADDR0 0x1d
86 #define SONIC_ADDR1 0x1e
92 #define SONIC_CRCT 0x2c
93 #define SONIC_FAET 0x2d
94 #define SONIC_MPT 0x2e
96 #define SONIC_DCR2 0x3f
102 #define SONIC_CR_LCAM 0x0200
103 #define SONIC_CR_RRRA 0x0100
104 #define SONIC_CR_RST 0x0080
105 #define SONIC_CR_ST 0x0020
106 #define SONIC_CR_STP 0x0010
107 #define SONIC_CR_RXEN 0x0008
108 #define SONIC_CR_RXDIS 0x0004
109 #define SONIC_CR_TXP 0x0002
110 #define SONIC_CR_HTX 0x0001
116 #define SONIC_DCR_EXBUS 0x8000
117 #define SONIC_DCR_LBR 0x2000
118 #define SONIC_DCR_PO1 0x1000
119 #define SONIC_DCR_PO0 0x0800
120 #define SONIC_DCR_SBUS 0x0400
121 #define SONIC_DCR_USR1 0x0200
122 #define SONIC_DCR_USR0 0x0100
123 #define SONIC_DCR_WC1 0x0080
124 #define SONIC_DCR_WC0 0x0040
125 #define SONIC_DCR_DW 0x0020
126 #define SONIC_DCR_BMS 0x0010
127 #define SONIC_DCR_RFT1 0x0008
128 #define SONIC_DCR_RFT0 0x0004
129 #define SONIC_DCR_TFT1 0x0002
130 #define SONIC_DCR_TFT0 0x0001
136 #define SONIC_RCR_ERR 0x8000
137 #define SONIC_RCR_RNT 0x4000
138 #define SONIC_RCR_BRD 0x2000
139 #define SONIC_RCR_PRO 0x1000
140 #define SONIC_RCR_AMC 0x0800
141 #define SONIC_RCR_LB1 0x0400
142 #define SONIC_RCR_LB0 0x0200
144 #define SONIC_RCR_MC 0x0100
145 #define SONIC_RCR_BC 0x0080
146 #define SONIC_RCR_LPKT 0x0040
147 #define SONIC_RCR_CRS 0x0020
148 #define SONIC_RCR_COL 0x0010
149 #define SONIC_RCR_CRCR 0x0008
150 #define SONIC_RCR_FAER 0x0004
151 #define SONIC_RCR_LBK 0x0002
152 #define SONIC_RCR_PRX 0x0001
154 #define SONIC_RCR_LB_OFF 0
155 #define SONIC_RCR_LB_MAC SONIC_RCR_LB0
156 #define SONIC_RCR_LB_ENDEC SONIC_RCR_LB1
157 #define SONIC_RCR_LB_TRANS (SONIC_RCR_LB0 | SONIC_RCR_LB1)
161 #define SONIC_RCR_DEFAULT (SONIC_RCR_BRD)
168 #define SONIC_TCR_PINTR 0x8000
169 #define SONIC_TCR_POWC 0x4000
170 #define SONIC_TCR_CRCI 0x2000
171 #define SONIC_TCR_EXDIS 0x1000
172 #define SONIC_TCR_EXD 0x0400
173 #define SONIC_TCR_DEF 0x0200
174 #define SONIC_TCR_NCRS 0x0100
175 #define SONIC_TCR_CRLS 0x0080
176 #define SONIC_TCR_EXC 0x0040
177 #define SONIC_TCR_PMB 0x0008
178 #define SONIC_TCR_FU 0x0004
179 #define SONIC_TCR_BCM 0x0002
180 #define SONIC_TCR_PTX 0x0001
182 #define SONIC_TCR_DEFAULT 0x0000
189 #define SONIC_INT_BR 0x4000
190 #define SONIC_INT_HBL 0x2000
191 #define SONIC_INT_LCD 0x1000
192 #define SONIC_INT_PINT 0x0800
193 #define SONIC_INT_PKTRX 0x0400
194 #define SONIC_INT_TXDN 0x0200
195 #define SONIC_INT_TXER 0x0100
196 #define SONIC_INT_TC 0x0080
197 #define SONIC_INT_RDE 0x0040
198 #define SONIC_INT_RBE 0x0020
199 #define SONIC_INT_RBAE 0x0010
200 #define SONIC_INT_CRC 0x0008
201 #define SONIC_INT_FAE 0x0004
202 #define SONIC_INT_MP 0x0002
203 #define SONIC_INT_RFO 0x0001
210 #define SONIC_IMR_DEFAULT ( SONIC_INT_BR | \
223 #define SONIC_EOL 0x0001
224 #define CAM_DESCRIPTORS 16
228 #define SONIC_BITMODE16 0
229 #define SONIC_BITMODE32 1
230 #define SONIC_BUS_SCALE(bitmode) ((bitmode) ? 4 : 2)
232 #define SIZEOF_SONIC_RR 4
233 #define SONIC_RR_BUFADR_L 0
234 #define SONIC_RR_BUFADR_H 1
235 #define SONIC_RR_BUFSIZE_L 2
236 #define SONIC_RR_BUFSIZE_H 3
238 #define SIZEOF_SONIC_RD 7
239 #define SONIC_RD_STATUS 0
240 #define SONIC_RD_PKTLEN 1
241 #define SONIC_RD_PKTPTR_L 2
242 #define SONIC_RD_PKTPTR_H 3
243 #define SONIC_RD_SEQNO 4
244 #define SONIC_RD_LINK 5
245 #define SONIC_RD_IN_USE 6
247 #define SIZEOF_SONIC_TD 8
248 #define SONIC_TD_STATUS 0
249 #define SONIC_TD_CONFIG 1
250 #define SONIC_TD_PKTSIZE 2
251 #define SONIC_TD_FRAG_COUNT 3
252 #define SONIC_TD_FRAG_PTR_L 4
253 #define SONIC_TD_FRAG_PTR_H 5
254 #define SONIC_TD_FRAG_SIZE 6
255 #define SONIC_TD_LINK 7
257 #define SIZEOF_SONIC_CD 4
258 #define SONIC_CD_ENTRY_POINTER 0
259 #define SONIC_CD_CAP0 1
260 #define SONIC_CD_CAP1 2
261 #define SONIC_CD_CAP2 3
263 #define SIZEOF_SONIC_CDA ((CAM_DESCRIPTORS * SIZEOF_SONIC_CD) + 1)
264 #define SONIC_CDA_CAM_ENABLE (CAM_DESCRIPTORS * SIZEOF_SONIC_CD)
272 #define SONIC_NUM_RRS 16
273 #define SONIC_NUM_RDS SONIC_NUM_RRS
274 #define SONIC_NUM_TDS 16
276 #define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
277 #define SONIC_TDS_MASK (SONIC_NUM_TDS-1)
279 #define SONIC_RBSIZE 1520
282 #define SIZEOF_SONIC_DESC (SIZEOF_SONIC_CDA \
283 + (SIZEOF_SONIC_TD * SONIC_NUM_TDS) \
284 + (SIZEOF_SONIC_RD * SONIC_NUM_RDS) \
285 + (SIZEOF_SONIC_RR * SONIC_NUM_RRS))
325 #define TX_TIMEOUT (3 * HZ)
344 static inline void sonic_buf_put(
void* base,
int bitmode,
349 ((
__u16 *) base + (offset*2))[1] = val;
351 ((
__u16 *) base + (offset*2))[0] = val;
354 ((
__u16 *) base)[offset] = val;
357 static inline __u16 sonic_buf_get(
void* base,
int bitmode,
362 return ((
volatile __u16 *) base + (offset*2))[1];
364 return ((
volatile __u16 *) base + (offset*2))[0];
372 int offset,
__u16 val)
400 int offset,
__u16 val)
416 int offset,
__u16 val)
432 int offset,
__u16 val)