if_aereg.h revision 1.4 1 1.3 cgd /* $NetBSD: if_aereg.h,v 1.4 1994/12/03 23:30:47 briggs Exp $ */
2 1.3 cgd
3 1.1 briggs /*
4 1.1 briggs * National Semiconductor DS8390 NIC register definitions
5 1.4 briggs *
6 1.4 briggs * $Id: if_aereg.h,v 1.4 1994/12/03 23:30:47 briggs Exp $
7 1.4 briggs *
8 1.4 briggs * Modification history
9 1.4 briggs *
10 1.4 briggs * $Log: if_aereg.h,v $
11 1.4 briggs * Revision 1.4 1994/12/03 23:30:47 briggs
12 1.4 briggs * At least somewhat functional ethernet driver from Brad Parker
13 1.4 briggs * (brad (at) fcr.com). Requires changes to via.c which are coming with
14 1.4 briggs * other changes in a moment...
15 1.4 briggs *
16 1.4 briggs * Revision 1.2 1994/03/01 15:24:26 briggs
17 1.4 briggs * More Dayna separation.
18 1.4 briggs *
19 1.4 briggs * Revision 1.1 1993/11/29 00:32:46 briggs
20 1.4 briggs * Update to current work in progress. This includes an update to
21 1.4 briggs * use config.new.
22 1.1 briggs * Numerous updates to console so it works better on the SE/30 screen.
23 1.1 briggs * Some nice changes from Brad Parker for handling NuBUS and an ethernet
24 1.1 briggs * driver that I haven't worked on, yet.
25 1.1 briggs *
26 1.1 briggs *
27 1.1 briggs */
28 1.1 briggs
29 1.1 briggs /*
30 1.1 briggs * Page 0 register offsets
31 1.1 briggs */
32 1.1 briggs #define AE_P0_CR 0x00 /* Command Register */
33 1.1 briggs
34 1.1 briggs #define AE_P0_CLDA0 0x01 /* Current Local DMA Addr low (read) */
35 1.1 briggs #define AE_P0_PSTART 0x01 /* Page Start register (write) */
36 1.1 briggs
37 1.1 briggs #define AE_P0_CLDA1 0x02 /* Current Local DMA Addr high (read) */
38 1.1 briggs #define AE_P0_PSTOP 0x02 /* Page Stop register (write) */
39 1.1 briggs
40 1.1 briggs #define AE_P0_BNRY 0x03 /* Boundary Pointer */
41 1.1 briggs
42 1.1 briggs #define AE_P0_TSR 0x04 /* Transmit Status Register (read) */
43 1.1 briggs #define AE_P0_TPSR 0x04 /* Transmit Page Start (write) */
44 1.1 briggs
45 1.1 briggs #define AE_P0_NCR 0x05 /* Number of Collisions Reg (read) */
46 1.1 briggs #define AE_P0_TBCR0 0x05 /* Transmit Byte count, low (write) */
47 1.1 briggs
48 1.1 briggs #define AE_P0_FIFO 0x06 /* FIFO register (read) */
49 1.1 briggs #define AE_P0_TBCR1 0x06 /* Transmit Byte count, high (write) */
50 1.1 briggs
51 1.1 briggs #define AE_P0_ISR 0x07 /* Interrupt Status Register */
52 1.1 briggs
53 1.1 briggs #define AE_P0_CRDA0 0x08 /* Current Remote DMA Addr low (read) */
54 1.1 briggs #define AE_P0_RSAR0 0x08 /* Remote Start Address low (write) */
55 1.1 briggs
56 1.1 briggs #define AE_P0_CRDA1 0x09 /* Current Remote DMA Addr high (read) */
57 1.1 briggs #define AE_P0_RSAR1 0x09 /* Remote Start Address high (write) */
58 1.1 briggs
59 1.1 briggs #define AE_P0_RBCR0 0x0a /* Remote Byte Count low (write) */
60 1.1 briggs
61 1.1 briggs #define AE_P0_RBCR1 0x0b /* Remote Byte Count high (write) */
62 1.1 briggs
63 1.1 briggs #define AE_P0_RSR 0x0c /* Receive Status (read) */
64 1.1 briggs #define AE_P0_RCR 0x0c /* Receive Configuration Reg (write) */
65 1.1 briggs
66 1.1 briggs #define AE_P0_CNTR0 0x0d /* frame alignment error counter (read) */
67 1.1 briggs #define AE_P0_TCR 0x0d /* Transmit Configuration Reg (write) */
68 1.1 briggs
69 1.1 briggs #define AE_P0_CNTR1 0x0e /* CRC error counter (read) */
70 1.1 briggs #define AE_P0_DCR 0x0e /* Data Configuration Reg (write) */
71 1.1 briggs
72 1.1 briggs #define AE_P0_CNTR2 0x0f /* missed packet counter (read) */
73 1.1 briggs #define AE_P0_IMR 0x0f /* Interrupt Mask Register (write) */
74 1.1 briggs
75 1.1 briggs /*
76 1.1 briggs * Page 1 register offsets
77 1.1 briggs */
78 1.1 briggs #define AE_P1_CR 0x00 /* Command Register */
79 1.1 briggs #define AE_P1_PAR0 0x01 /* Physical Address Register 0 */
80 1.1 briggs #define AE_P1_PAR1 0x02 /* Physical Address Register 1 */
81 1.1 briggs #define AE_P1_PAR2 0x03 /* Physical Address Register 2 */
82 1.1 briggs #define AE_P1_PAR3 0x04 /* Physical Address Register 3 */
83 1.1 briggs #define AE_P1_PAR4 0x05 /* Physical Address Register 4 */
84 1.1 briggs #define AE_P1_PAR5 0x06 /* Physical Address Register 5 */
85 1.1 briggs #define AE_P1_CURR 0x07 /* Current RX ring-buffer page */
86 1.1 briggs #define AE_P1_MAR0 0x08 /* Multicast Address Register 0 */
87 1.1 briggs #define AE_P1_MAR1 0x09 /* Multicast Address Register 1 */
88 1.1 briggs #define AE_P1_MAR2 0x0a /* Multicast Address Register 2 */
89 1.1 briggs #define AE_P1_MAR3 0x0b /* Multicast Address Register 3 */
90 1.1 briggs #define AE_P1_MAR4 0x0c /* Multicast Address Register 4 */
91 1.1 briggs #define AE_P1_MAR5 0x0d /* Multicast Address Register 5 */
92 1.1 briggs #define AE_P1_MAR6 0x0e /* Multicast Address Register 6 */
93 1.1 briggs #define AE_P1_MAR7 0x0f /* Multicast Address Register 7 */
94 1.1 briggs
95 1.1 briggs /*
96 1.1 briggs * Page 2 register offsets
97 1.1 briggs */
98 1.1 briggs #define AE_P2_CR 0x00 /* Command Register */
99 1.1 briggs #define AE_P2_PSTART 0x01 /* Page Start (read) */
100 1.1 briggs #define AE_P2_CLDA0 0x01 /* Current Local DMA Addr 0 (write) */
101 1.1 briggs #define AE_P2_PSTOP 0x02 /* Page Stop (read) */
102 1.1 briggs #define AE_P2_CLDA1 0x02 /* Current Local DMA Addr 1 (write) */
103 1.1 briggs #define AE_P2_RNPP 0x03 /* Remote Next Packet Pointer */
104 1.1 briggs #define AE_P2_TPSR 0x04 /* Transmit Page Start (read) */
105 1.1 briggs #define AE_P2_LNPP 0x05 /* Local Next Packet Pointer */
106 1.1 briggs #define AE_P2_ACU 0x06 /* Address Counter Upper */
107 1.1 briggs #define AE_P2_ACL 0x07 /* Address Counter Lower */
108 1.1 briggs #define AE_P2_RCR 0x0c /* Receive Configuration Register (read) */
109 1.1 briggs #define AE_P2_TCR 0x0d /* Transmit Configuration Register (read) */
110 1.1 briggs #define AE_P2_DCR 0x0e /* Data Configuration Register (read) */
111 1.1 briggs #define AE_P2_IMR 0x0f /* Interrupt Mask Register (read) */
112 1.1 briggs
113 1.1 briggs /*
114 1.1 briggs * Command Register (CR) definitions
115 1.1 briggs */
116 1.1 briggs
117 1.1 briggs /*
118 1.1 briggs * STP: SToP. Software reset command. Takes the controller offline. No
119 1.1 briggs * packets will be received or transmitted. Any reception or
120 1.1 briggs * transmission in progress will continue to completion before
121 1.1 briggs * entering reset state. To exit this state, the STP bit must
122 1.1 briggs * reset and the STA bit must be set. The software reset has
123 1.1 briggs * executed only when indicated by the RST bit in the ISR being
124 1.1 briggs * set.
125 1.1 briggs */
126 1.1 briggs #define AE_CR_STP 0x01
127 1.1 briggs
128 1.1 briggs /*
129 1.1 briggs * STA: STArt. This bit is used to activate the NIC after either power-up,
130 1.1 briggs * or when the NIC has been put in reset mode by software command
131 1.1 briggs * or error.
132 1.1 briggs */
133 1.1 briggs #define AE_CR_STA 0x02
134 1.1 briggs
135 1.1 briggs /*
136 1.1 briggs * TXP: Transmit Packet. This bit must be set to indicate transmission of
137 1.1 briggs * a packet. TXP is internally reset either after the transmission is
138 1.1 briggs * completed or aborted. This bit should be set only after the Transmit
139 1.1 briggs * Byte Count and Transmit Page Start register have been programmed.
140 1.1 briggs */
141 1.1 briggs #define AE_CR_TXP 0x04
142 1.1 briggs
143 1.1 briggs /*
144 1.1 briggs * RD0, RD1, RD2: Remote DMA Command. These three bits control the operation
145 1.1 briggs * of the remote DMA channel. RD2 can be set to abort any remote DMA
146 1.1 briggs * command in progress. The Remote Byte Count registers should be cleared
147 1.1 briggs * when a remote DMA has been aborted. The Remote Start Addresses are not
148 1.1 briggs * restored to the starting address if the remote DMA is aborted.
149 1.1 briggs *
150 1.1 briggs * RD2 RD1 RD0 function
151 1.1 briggs * 0 0 0 not allowed
152 1.1 briggs * 0 0 1 remote read
153 1.1 briggs * 0 1 0 remote write
154 1.1 briggs * 0 1 1 send packet
155 1.1 briggs * 1 X X abort
156 1.1 briggs */
157 1.1 briggs #define AE_CR_RD0 0x08
158 1.1 briggs #define AE_CR_RD1 0x10
159 1.1 briggs #define AE_CR_RD2 0x20
160 1.1 briggs
161 1.1 briggs /*
162 1.1 briggs * PS0, PS1: Page Select. The two bits select which register set or 'page' to
163 1.1 briggs * access.
164 1.1 briggs *
165 1.1 briggs * PS1 PS0 page
166 1.1 briggs * 0 0 0
167 1.1 briggs * 0 1 1
168 1.1 briggs * 1 0 2
169 1.1 briggs * 1 1 reserved
170 1.1 briggs */
171 1.1 briggs #define AE_CR_PS0 0x40
172 1.1 briggs #define AE_CR_PS1 0x80
173 1.1 briggs /* bit encoded aliases */
174 1.1 briggs #define AE_CR_PAGE_0 0x00 /* (for consistency) */
175 1.1 briggs #define AE_CR_PAGE_1 0x40
176 1.1 briggs #define AE_CR_PAGE_2 0x80
177 1.1 briggs
178 1.1 briggs /*
179 1.1 briggs * Interrupt Status Register (ISR) definitions
180 1.1 briggs */
181 1.1 briggs
182 1.1 briggs /*
183 1.1 briggs * PRX: Packet Received. Indicates packet received with no errors.
184 1.1 briggs */
185 1.1 briggs #define AE_ISR_PRX 0x01
186 1.1 briggs
187 1.1 briggs /*
188 1.1 briggs * PTX: Packet Transmitted. Indicates packet transmitted with no errors.
189 1.1 briggs */
190 1.1 briggs #define AE_ISR_PTX 0x02
191 1.1 briggs
192 1.1 briggs /*
193 1.1 briggs * RXE: Receive Error. Indicates that a packet was received with one or more
194 1.1 briggs * the following errors: CRC error, frame alignment error, FIFO overrun,
195 1.1 briggs * missed packet.
196 1.1 briggs */
197 1.1 briggs #define AE_ISR_RXE 0x04
198 1.1 briggs
199 1.1 briggs /*
200 1.1 briggs * TXE: Transmission Error. Indicates that an attempt to transmit a packet
201 1.1 briggs * resulted in one or more of the following errors: excessive
202 1.1 briggs * collisions, FIFO underrun.
203 1.1 briggs */
204 1.1 briggs #define AE_ISR_TXE 0x08
205 1.1 briggs
206 1.1 briggs /*
207 1.1 briggs * OVW: OverWrite. Indicates a receive ring-buffer overrun. Incoming network
208 1.1 briggs * would exceed (has exceeded?) the boundry pointer, resulting in data
209 1.1 briggs * that was previously received and not yet read from the buffer to be
210 1.1 briggs * overwritten.
211 1.1 briggs */
212 1.1 briggs #define AE_ISR_OVW 0x10
213 1.1 briggs
214 1.1 briggs /*
215 1.1 briggs * CNT: Counter Overflow. Set when the MSB of one or more of the Network Talley
216 1.1 briggs * Counters has been set.
217 1.1 briggs */
218 1.1 briggs #define AE_ISR_CNT 0x20
219 1.1 briggs
220 1.1 briggs /*
221 1.1 briggs * RDC: Remote Data Complete. Indicates that a Remote DMA operation has completed.
222 1.1 briggs */
223 1.1 briggs #define AE_ISR_RDC 0x40
224 1.1 briggs
225 1.1 briggs /*
226 1.1 briggs * RST: Reset status. Set when the NIC enters the reset state and cleared when a
227 1.1 briggs * Start Command is issued to the CR. This bit is also set when a receive
228 1.1 briggs * ring-buffer overrun (OverWrite) occurs and is cleared when one or more
229 1.1 briggs * packets have been removed from the ring. This is a read-only bit.
230 1.1 briggs */
231 1.1 briggs #define AE_ISR_RST 0x80
232 1.1 briggs
233 1.1 briggs /*
234 1.1 briggs * Interrupt Mask Register (IMR) definitions
235 1.1 briggs */
236 1.1 briggs
237 1.1 briggs /*
238 1.1 briggs * PRXE: Packet Received interrupt Enable. If set, a received packet will cause
239 1.1 briggs * an interrupt.
240 1.1 briggs */
241 1.1 briggs #define AE_IMR_PRXE 0x01
242 1.1 briggs
243 1.1 briggs /*
244 1.1 briggs * PTXE: Packet Transmit interrupt Enable. If set, an interrupt is generated when
245 1.1 briggs * a packet transmission completes.
246 1.1 briggs */
247 1.1 briggs #define AE_IMR_PTXE 0x02
248 1.1 briggs
249 1.1 briggs /*
250 1.1 briggs * RXEE: Receive Error interrupt Enable. If set, an interrupt will occur whenever a
251 1.1 briggs * packet is received with an error.
252 1.1 briggs */
253 1.1 briggs #define AE_IMR_RXEE 0x04
254 1.1 briggs
255 1.1 briggs /*
256 1.1 briggs * TXEE: Transmit Error interrupt Enable. If set, an interrupt will occur whenever
257 1.1 briggs * a transmission results in an error.
258 1.1 briggs */
259 1.1 briggs #define AE_IMR_TXEE 0x08
260 1.1 briggs
261 1.1 briggs /*
262 1.1 briggs * OVWE: OverWrite error interrupt Enable. If set, an interrupt is generated whenever
263 1.1 briggs * the receive ring-buffer is overrun. i.e. when the boundry pointer is exceeded.
264 1.1 briggs */
265 1.1 briggs #define AE_IMR_OVWE 0x10
266 1.1 briggs
267 1.1 briggs /*
268 1.1 briggs * CNTE: Counter overflow interrupt Enable. If set, an interrupt is generated whenever
269 1.1 briggs * the MSB of one or more of the Network Statistics counters has been set.
270 1.1 briggs */
271 1.1 briggs #define AE_IMR_CNTE 0x20
272 1.1 briggs
273 1.1 briggs /*
274 1.1 briggs * RDCE: Remote DMA Complete interrupt Enable. If set, an interrupt is generated
275 1.1 briggs * when a remote DMA transfer has completed.
276 1.1 briggs */
277 1.1 briggs #define AE_IMR_RDCE 0x40
278 1.1 briggs
279 1.1 briggs /*
280 1.1 briggs * bit 7 is unused/reserved
281 1.1 briggs */
282 1.1 briggs
283 1.1 briggs /*
284 1.1 briggs * Data Configuration Register (DCR) definitions
285 1.1 briggs */
286 1.1 briggs
287 1.1 briggs /*
288 1.1 briggs * WTS: Word Transfer Select. WTS establishes byte or word transfers for
289 1.1 briggs * both remote and local DMA transfers
290 1.1 briggs */
291 1.1 briggs #define AE_DCR_WTS 0x01
292 1.1 briggs
293 1.1 briggs /*
294 1.1 briggs * BOS: Byte Order Select. BOS sets the byte order for the host.
295 1.1 briggs * Should be 0 for 80x86, and 1 for 68000 series processors
296 1.1 briggs */
297 1.1 briggs #define AE_DCR_BOS 0x02
298 1.1 briggs
299 1.1 briggs /*
300 1.1 briggs * LAS: Long Address Select. When LAS is 1, the contents of the remote
301 1.1 briggs * DMA registers RSAR0 and RSAR1 are used to provide A16-A31
302 1.1 briggs */
303 1.1 briggs #define AE_DCR_LAS 0x04
304 1.1 briggs
305 1.1 briggs #ifdef huh
306 1.1 briggs /*
307 1.1 briggs * LS: Loopback Select. When 0, loopback mode is selected. Bits D1 and D2
308 1.1 briggs * of the TCR must also be programmed for loopback operation.
309 1.1 briggs * When 1, normal operation is selected.
310 1.1 briggs */
311 1.1 briggs #define AE_DCR_LS 0x08
312 1.1 briggs #endif
313 1.1 briggs /*
314 1.1 briggs * BMS: Burst Mode Select
315 1.1 briggs */
316 1.1 briggs #define AE_DCR_BMS 0x08
317 1.1 briggs
318 1.1 briggs /*
319 1.1 briggs * AR: Auto-initialize Remote. When 0, data must be removed from ring-buffer
320 1.1 briggs * under program control. When 1, remote DMA is automatically initiated
321 1.1 briggs * and the boundry pointer is automatically updated
322 1.1 briggs */
323 1.1 briggs #define AE_DCR_AR 0x10
324 1.1 briggs
325 1.1 briggs /*
326 1.1 briggs * FT0, FT1: Fifo Threshold select.
327 1.1 briggs * FT1 FT0 Word-width Byte-width
328 1.1 briggs * 0 0 1 word 2 bytes
329 1.1 briggs * 0 1 2 words 4 bytes
330 1.1 briggs * 1 0 4 words 8 bytes
331 1.1 briggs * 1 1 8 words 12 bytes
332 1.1 briggs *
333 1.1 briggs * During transmission, the FIFO threshold indicates the number of bytes
334 1.1 briggs * or words that the FIFO has filled from the local DMA before BREQ is
335 1.1 briggs * asserted. The transmission threshold is 16 bytes minus the receiver
336 1.1 briggs * threshold.
337 1.1 briggs */
338 1.1 briggs #define AE_DCR_FT0 0x20
339 1.1 briggs #define AE_DCR_FT1 0x40
340 1.1 briggs
341 1.1 briggs /*
342 1.1 briggs * bit 7 (0x80) is unused/reserved
343 1.1 briggs */
344 1.1 briggs
345 1.1 briggs /*
346 1.1 briggs * Transmit Configuration Register (TCR) definitions
347 1.1 briggs */
348 1.1 briggs
349 1.1 briggs /*
350 1.1 briggs * CRC: Inhibit CRC. If 0, CRC will be appended by the transmitter, if 0, CRC
351 1.1 briggs * is not appended by the transmitter.
352 1.1 briggs */
353 1.1 briggs #define AE_TCR_CRC 0x01
354 1.1 briggs
355 1.1 briggs /*
356 1.1 briggs * LB0, LB1: Loopback control. These two bits set the type of loopback that is
357 1.1 briggs * to be performed.
358 1.1 briggs *
359 1.1 briggs * LB1 LB0 mode
360 1.1 briggs * 0 0 0 - normal operation (DCR_LS = 0)
361 1.1 briggs * 0 1 1 - internal loopback (DCR_LS = 0)
362 1.1 briggs * 1 0 2 - external loopback (DCR_LS = 1)
363 1.1 briggs * 1 1 3 - external loopback (DCR_LS = 0)
364 1.1 briggs */
365 1.1 briggs #define AE_TCR_LB0 0x02
366 1.1 briggs #define AE_TCR_LB1 0x04
367 1.1 briggs
368 1.1 briggs /*
369 1.1 briggs * ATD: Auto Transmit Disable. Clear for normal operation. When set, allows
370 1.1 briggs * another station to disable the NIC's transmitter by transmitting to
371 1.1 briggs * a multicast address hashing to bit 62. Reception of a multicast address
372 1.1 briggs * hashing to bit 63 enables the transmitter.
373 1.1 briggs */
374 1.1 briggs #define AE_TCR_ATD 0x08
375 1.1 briggs
376 1.1 briggs /*
377 1.1 briggs * OFST: Collision Offset enable. This bit when set modifies the backoff
378 1.1 briggs * algorithm to allow prioritization of nodes.
379 1.1 briggs */
380 1.1 briggs #define AE_TCR_OFST 0x10
381 1.1 briggs
382 1.1 briggs /*
383 1.1 briggs * bits 5, 6, and 7 are unused/reserved
384 1.1 briggs */
385 1.1 briggs
386 1.1 briggs /*
387 1.1 briggs * Transmit Status Register (TSR) definitions
388 1.1 briggs */
389 1.1 briggs
390 1.1 briggs /*
391 1.1 briggs * PTX: Packet Transmitted. Indicates successful transmission of packet.
392 1.1 briggs */
393 1.1 briggs #define AE_TSR_PTX 0x01
394 1.1 briggs
395 1.1 briggs /*
396 1.1 briggs * bit 1 (0x02) is unused/reserved
397 1.1 briggs */
398 1.1 briggs
399 1.1 briggs /*
400 1.1 briggs * COL: Transmit Collided. Indicates that the transmission collided at least
401 1.1 briggs * once with another station on the network.
402 1.1 briggs */
403 1.1 briggs #define AE_TSR_COL 0x04
404 1.1 briggs
405 1.1 briggs /*
406 1.1 briggs * ABT: Transmit aborted. Indicates that the transmission was aborted due to
407 1.1 briggs * excessive collisions.
408 1.1 briggs */
409 1.1 briggs #define AE_TSR_ABT 0x08
410 1.1 briggs
411 1.1 briggs /*
412 1.1 briggs * CRS: Carrier Sense Lost. Indicates that carrier was lost during the
413 1.1 briggs * transmission of the packet. (Transmission is not aborted because
414 1.1 briggs * of a loss of carrier)
415 1.1 briggs */
416 1.1 briggs #define AE_TSR_CRS 0x10
417 1.1 briggs
418 1.1 briggs /*
419 1.1 briggs * FU: FIFO Underrun. Indicates that the NIC wasn't able to access bus/
420 1.1 briggs * transmission memory before the FIFO emptied. Transmission of the
421 1.1 briggs * packet was aborted.
422 1.1 briggs */
423 1.1 briggs #define AE_TSR_FU 0x20
424 1.1 briggs
425 1.1 briggs /*
426 1.1 briggs * CDH: CD Heartbeat. Indicates that the collision detection circuitry
427 1.1 briggs * isn't working correctly during a collision heartbeat test.
428 1.1 briggs */
429 1.1 briggs #define AE_TSR_CDH 0x40
430 1.1 briggs
431 1.1 briggs /*
432 1.1 briggs * OWC: Out of Window Collision: Indicates that a collision occurred after
433 1.1 briggs * a slot time (51.2us). The transmission is rescheduled just as in
434 1.1 briggs * normal collisions.
435 1.1 briggs */
436 1.1 briggs #define AE_TSR_OWC 0x80
437 1.1 briggs
438 1.1 briggs /*
439 1.1 briggs * Receiver Configuration Register (RCR) definitions
440 1.1 briggs */
441 1.1 briggs
442 1.1 briggs /*
443 1.1 briggs * SEP: Save Errored Packets. If 0, error packets are discarded. If set to 1,
444 1.1 briggs * packets with CRC and frame errors are not discarded.
445 1.1 briggs */
446 1.1 briggs #define AE_RCR_SEP 0x01
447 1.1 briggs
448 1.1 briggs /*
449 1.1 briggs * AR: Accept Runt packet. If 0, packet with less than 64 byte are discarded.
450 1.1 briggs * If set to 1, packets with less than 64 byte are not discarded.
451 1.1 briggs */
452 1.1 briggs #define AE_RCR_AR 0x02
453 1.1 briggs
454 1.1 briggs /*
455 1.1 briggs * AB: Accept Broadcast. If set, packets sent to the broadcast address will be
456 1.1 briggs * accepted.
457 1.1 briggs */
458 1.1 briggs #define AE_RCR_AB 0x04
459 1.1 briggs
460 1.1 briggs /*
461 1.1 briggs * AM: Accept Multicast. If set, packets sent to a multicast address are checked
462 1.1 briggs * for a match in the hashing array. If clear, multicast packets are ignored.
463 1.1 briggs */
464 1.1 briggs #define AE_RCR_AM 0x08
465 1.1 briggs
466 1.1 briggs /*
467 1.1 briggs * PRO: Promiscuous Physical. If set, all packets with a physical addresses are
468 1.1 briggs * accepted. If clear, a physical destination address must match this
469 1.1 briggs * station's address. Note: for full promiscuous mode, RCR_AB and RCR_AM
470 1.1 briggs * must also be set. In addition, the multicast hashing array must be set
471 1.1 briggs * to all 1's so that all multicast addresses are accepted.
472 1.1 briggs */
473 1.1 briggs #define AE_RCR_PRO 0x10
474 1.1 briggs
475 1.1 briggs /*
476 1.1 briggs * MON: Monitor Mode. If set, packets will be checked for good CRC and framing,
477 1.1 briggs * but are not stored in the ring-buffer. If clear, packets are stored (normal
478 1.1 briggs * operation).
479 1.1 briggs */
480 1.1 briggs #define AE_RCR_MON 0x20
481 1.1 briggs
482 1.1 briggs /*
483 1.1 briggs * bits 6 and 7 are unused/reserved.
484 1.1 briggs */
485 1.1 briggs
486 1.1 briggs /*
487 1.1 briggs * Receiver Status Register (RSR) definitions
488 1.1 briggs */
489 1.1 briggs
490 1.1 briggs /*
491 1.1 briggs * PRX: Packet Received without error.
492 1.1 briggs */
493 1.1 briggs #define AE_RSR_PRX 0x01
494 1.1 briggs
495 1.1 briggs /*
496 1.1 briggs * CRC: CRC error. Indicates that a packet has a CRC error. Also set for frame
497 1.1 briggs * alignment errors.
498 1.1 briggs */
499 1.1 briggs #define AE_RSR_CRC 0x02
500 1.1 briggs
501 1.1 briggs /*
502 1.1 briggs * FAE: Frame Alignment Error. Indicates that the incoming packet did not end on
503 1.1 briggs * a byte boundry and the CRC did not match at the last byte boundry.
504 1.1 briggs */
505 1.1 briggs #define AE_RSR_FAE 0x04
506 1.1 briggs
507 1.1 briggs /*
508 1.1 briggs * FO: FIFO Overrun. Indicates that the FIFO was not serviced (during local DMA)
509 1.1 briggs * causing it to overrun. Reception of the packet is aborted.
510 1.1 briggs */
511 1.1 briggs #define AE_RSR_FO 0x08
512 1.1 briggs
513 1.1 briggs /*
514 1.1 briggs * MPA: Missed Packet. Indicates that the received packet couldn't be stored in
515 1.1 briggs * the ring-buffer because of insufficient buffer space (exceeding the
516 1.1 briggs * boundry pointer), or because the transfer to the ring-buffer was inhibited
517 1.1 briggs * by RCR_MON - monitor mode.
518 1.1 briggs */
519 1.1 briggs #define AE_RSR_MPA 0x10
520 1.1 briggs
521 1.1 briggs /*
522 1.1 briggs * PHY: Physical address. If 0, the packet received was sent to a physical address.
523 1.1 briggs * If 1, the packet was accepted because of a multicast/broadcast address
524 1.1 briggs * match.
525 1.1 briggs */
526 1.1 briggs #define AE_RSR_PHY 0x20
527 1.1 briggs
528 1.1 briggs /*
529 1.1 briggs * DIS: Receiver Disabled. Set to indicate that the receiver has enetered monitor
530 1.1 briggs * mode. Cleared when the receiver exits monitor mode.
531 1.1 briggs */
532 1.1 briggs #define AE_RSR_DIS 0x40
533 1.1 briggs
534 1.1 briggs /*
535 1.1 briggs * DFR: Deferring. Set to indicate a 'jabber' condition. The CRS and COL inputs
536 1.1 briggs * are active, and the transceiver has set the CD line as a result of the
537 1.1 briggs * jabber.
538 1.1 briggs */
539 1.1 briggs #define AE_RSR_DFR 0x80
540 1.1 briggs
541 1.1 briggs /*
542 1.1 briggs * receive ring discriptor
543 1.1 briggs *
544 1.1 briggs * The National Semiconductor DS8390 Network interface controller uses
545 1.1 briggs * the following receive ring headers. The way this works is that the
546 1.1 briggs * memory on the interface card is chopped up into 256 bytes blocks.
547 1.1 briggs * A contiguous portion of those blocks are marked for receive packets
548 1.1 briggs * by setting start and end block #'s in the NIC. For each packet that
549 1.1 briggs * is put into the receive ring, one of these headers (4 bytes each) is
550 1.1 briggs * tacked onto the front.
551 1.1 briggs */
552 1.1 briggs struct ae_ring {
553 1.1 briggs u_char rcv_status; /* received packet status */
554 1.1 briggs u_char next_packet; /* pointer to next packet */
555 1.1 briggs u_char count[2]; /* bytes in packet (length + 4) */
556 1.1 briggs };
557 1.1 briggs
558 1.1 briggs /*
559 1.1 briggs * Common constants
560 1.1 briggs */
561 1.1 briggs #define AE_PAGE_SIZE 256 /* Size of RAM pages in bytes */
562 1.2 briggs #define AE_TXBUF_SIZE 6 /* Size of TX buffer in pages */
563 1.1 briggs
564 1.1 briggs /*
565 1.2 briggs * Vendor types
566 1.4 briggs */
567 1.1 briggs #define AE_VENDOR_UNKNOWN 0xFF /* Unknown network card */
568 1.1 briggs #define AE_VENDOR_APPLE 0x00 /* Apple Ethernet card */
569 1.1 briggs #define AE_VENDOR_INTERLAN 0x01 /* Interlan A310 card (GatorCard) */
570 1.1 briggs #define AE_VENDOR_DAYNA 0x02 /* DaynaPORT E/30s (and others?) */
571 1.1 briggs #define AE_VENDOR_ASANTE 0x03 /* Asante MacCon II/E */
572 1.1 briggs
573 1.1 briggs /*
574 1.1 briggs * Compile-time config flags
575 1.1 briggs */
576 1.1 briggs /*
577 1.1 briggs * this sets the default for enabling/disablng the tranceiver
578 1.1 briggs */
579 1.1 briggs #define AE_FLAGS_DISABLE_TRANCEIVER 0x01
580 1.1 briggs
581 1.1 briggs /*
582 1.1 briggs * This disables the use of double transmit buffers.
583 1.1 briggs */
584 1.1 briggs #define AE_FLAGS_NO_DOUBLE_BUFFERING 0x08
585 1.1 briggs
586 1.2 briggs /* */
587 1.2 briggs #define GC_RESET_OFFSET 0x000c0000 /* writes here reset NIC */
588 1.2 briggs #define GC_ROM_OFFSET 0x000c0000 /* address prom */
589 1.2 briggs #define GC_DATA_OFFSET 0x000d0000 /* Offset to NIC memory */
590 1.1 briggs #define GC_NIC_OFFSET 0x000e0000 /* Offset to NIC registers */
591 1.1 briggs
592 1.1 briggs #define DP_ROM_OFFSET 0x000f0000
593 1.1 briggs #define DP_DATA_OFFSET 0x000d0000 /* Offset to SONIC memory */
594 #define DP_NIC_OFFSET 0x000e0000 /* Offset to SONIC registers */
595
596 #define AE_ROM_OFFSET 0x000f0000
597 #define AE_DATA_OFFSET 0x000d0000 /* Offset to NIC memory */
598 #define AE_NIC_OFFSET 0x000e0000 /* Offset to NIC registers */
599