dp8390reg.h revision 1.3 1 1.3 scottr /* $NetBSD: dp8390reg.h,v 1.3 1997/04/29 04:32:08 scottr Exp $ */
2 1.1 mycroft
3 1.1 mycroft /*
4 1.1 mycroft * National Semiconductor DS8390 NIC register definitions.
5 1.1 mycroft *
6 1.1 mycroft * Copyright (C) 1993, David Greenman. This software may be used, modified,
7 1.1 mycroft * copied, distributed, and sold, in both source and binary form provided that
8 1.1 mycroft * the above copyright and these terms are retained. Under no circumstances is
9 1.1 mycroft * the author responsible for the proper functioning of this software, nor does
10 1.1 mycroft * the author assume any responsibility for damages incurred with its use.
11 1.1 mycroft */
12 1.1 mycroft
13 1.1 mycroft /*
14 1.1 mycroft * Page 0 register offsets
15 1.1 mycroft */
16 1.1 mycroft #define ED_P0_CR 0x00 /* Command Register */
17 1.1 mycroft
18 1.1 mycroft #define ED_P0_CLDA0 0x01 /* Current Local DMA Addr low (read) */
19 1.1 mycroft #define ED_P0_PSTART 0x01 /* Page Start register (write) */
20 1.1 mycroft
21 1.1 mycroft #define ED_P0_CLDA1 0x02 /* Current Local DMA Addr high (read) */
22 1.1 mycroft #define ED_P0_PSTOP 0x02 /* Page Stop register (write) */
23 1.1 mycroft
24 1.1 mycroft #define ED_P0_BNRY 0x03 /* Boundary Pointer */
25 1.1 mycroft
26 1.1 mycroft #define ED_P0_TSR 0x04 /* Transmit Status Register (read) */
27 1.1 mycroft #define ED_P0_TPSR 0x04 /* Transmit Page Start (write) */
28 1.1 mycroft
29 1.1 mycroft #define ED_P0_NCR 0x05 /* Number of Collisions Reg (read) */
30 1.1 mycroft #define ED_P0_TBCR0 0x05 /* Transmit Byte count, low (write) */
31 1.1 mycroft
32 1.1 mycroft #define ED_P0_FIFO 0x06 /* FIFO register (read) */
33 1.1 mycroft #define ED_P0_TBCR1 0x06 /* Transmit Byte count, high (write) */
34 1.1 mycroft
35 1.1 mycroft #define ED_P0_ISR 0x07 /* Interrupt Status Register */
36 1.1 mycroft
37 1.1 mycroft #define ED_P0_CRDA0 0x08 /* Current Remote DMA Addr low (read) */
38 1.1 mycroft #define ED_P0_RSAR0 0x08 /* Remote Start Address low (write) */
39 1.1 mycroft
40 1.1 mycroft #define ED_P0_CRDA1 0x09 /* Current Remote DMA Addr high (read) */
41 1.1 mycroft #define ED_P0_RSAR1 0x09 /* Remote Start Address high (write) */
42 1.1 mycroft
43 1.1 mycroft #define ED_P0_RBCR0 0x0a /* Remote Byte Count low (write) */
44 1.1 mycroft
45 1.1 mycroft #define ED_P0_RBCR1 0x0b /* Remote Byte Count high (write) */
46 1.1 mycroft
47 1.1 mycroft #define ED_P0_RSR 0x0c /* Receive Status (read) */
48 1.1 mycroft #define ED_P0_RCR 0x0c /* Receive Configuration Reg (write) */
49 1.1 mycroft
50 1.1 mycroft #define ED_P0_CNTR0 0x0d /* frame alignment error counter (read) */
51 1.1 mycroft #define ED_P0_TCR 0x0d /* Transmit Configuration Reg (write) */
52 1.1 mycroft
53 1.1 mycroft #define ED_P0_CNTR1 0x0e /* CRC error counter (read) */
54 1.1 mycroft #define ED_P0_DCR 0x0e /* Data Configuration Reg (write) */
55 1.1 mycroft
56 1.1 mycroft #define ED_P0_CNTR2 0x0f /* missed packet counter (read) */
57 1.1 mycroft #define ED_P0_IMR 0x0f /* Interrupt Mask Register (write) */
58 1.1 mycroft
59 1.1 mycroft /*
60 1.1 mycroft * Page 1 register offsets
61 1.1 mycroft */
62 1.1 mycroft #define ED_P1_CR 0x00 /* Command Register */
63 1.1 mycroft #define ED_P1_PAR0 0x01 /* Physical Address Register 0 */
64 1.1 mycroft #define ED_P1_PAR1 0x02 /* Physical Address Register 1 */
65 1.1 mycroft #define ED_P1_PAR2 0x03 /* Physical Address Register 2 */
66 1.1 mycroft #define ED_P1_PAR3 0x04 /* Physical Address Register 3 */
67 1.1 mycroft #define ED_P1_PAR4 0x05 /* Physical Address Register 4 */
68 1.1 mycroft #define ED_P1_PAR5 0x06 /* Physical Address Register 5 */
69 1.1 mycroft #define ED_P1_CURR 0x07 /* Current RX ring-buffer page */
70 1.1 mycroft #define ED_P1_MAR0 0x08 /* Multicast Address Register 0 */
71 1.1 mycroft #define ED_P1_MAR1 0x09 /* Multicast Address Register 1 */
72 1.1 mycroft #define ED_P1_MAR2 0x0a /* Multicast Address Register 2 */
73 1.1 mycroft #define ED_P1_MAR3 0x0b /* Multicast Address Register 3 */
74 1.1 mycroft #define ED_P1_MAR4 0x0c /* Multicast Address Register 4 */
75 1.1 mycroft #define ED_P1_MAR5 0x0d /* Multicast Address Register 5 */
76 1.1 mycroft #define ED_P1_MAR6 0x0e /* Multicast Address Register 6 */
77 1.1 mycroft #define ED_P1_MAR7 0x0f /* Multicast Address Register 7 */
78 1.1 mycroft
79 1.1 mycroft /*
80 1.1 mycroft * Page 2 register offsets
81 1.1 mycroft */
82 1.1 mycroft #define ED_P2_CR 0x00 /* Command Register */
83 1.1 mycroft #define ED_P2_PSTART 0x01 /* Page Start (read) */
84 1.1 mycroft #define ED_P2_CLDA0 0x01 /* Current Local DMA Addr 0 (write) */
85 1.1 mycroft #define ED_P2_PSTOP 0x02 /* Page Stop (read) */
86 1.1 mycroft #define ED_P2_CLDA1 0x02 /* Current Local DMA Addr 1 (write) */
87 1.1 mycroft #define ED_P2_RNPP 0x03 /* Remote Next Packet Pointer */
88 1.1 mycroft #define ED_P2_TPSR 0x04 /* Transmit Page Start (read) */
89 1.1 mycroft #define ED_P2_LNPP 0x05 /* Local Next Packet Pointer */
90 1.1 mycroft #define ED_P2_ACU 0x06 /* Address Counter Upper */
91 1.1 mycroft #define ED_P2_ACL 0x07 /* Address Counter Lower */
92 1.1 mycroft #define ED_P2_RCR 0x0c /* Receive Configuration Register (read) */
93 1.1 mycroft #define ED_P2_TCR 0x0d /* Transmit Configuration Register (read) */
94 1.1 mycroft #define ED_P2_DCR 0x0e /* Data Configuration Register (read) */
95 1.1 mycroft #define ED_P2_IMR 0x0f /* Interrupt Mask Register (read) */
96 1.1 mycroft
97 1.1 mycroft /*
98 1.1 mycroft * Command Register (CR) definitions
99 1.1 mycroft */
100 1.1 mycroft
101 1.1 mycroft /*
102 1.1 mycroft * STP: SToP. Software reset command. Takes the controller offline. No
103 1.1 mycroft * packets will be received or transmitted. Any reception or transmission in
104 1.1 mycroft * progress will continue to completion before entering reset state. To exit
105 1.1 mycroft * this state, the STP bit must reset and the STA bit must be set. The
106 1.1 mycroft * software reset has executed only when indicated by the RST bit in the ISR
107 1.1 mycroft * being set.
108 1.1 mycroft */
109 1.1 mycroft #define ED_CR_STP 0x01
110 1.1 mycroft
111 1.1 mycroft /*
112 1.1 mycroft * STA: STArt. This bit is used to activate the NIC after either power-up, or
113 1.1 mycroft * when the NIC has been put in reset mode by software command or error.
114 1.1 mycroft */
115 1.1 mycroft #define ED_CR_STA 0x02
116 1.1 mycroft
117 1.1 mycroft /*
118 1.1 mycroft * TXP: Transmit Packet. This bit must be set to indicate transmission of a
119 1.1 mycroft * packet. TXP is internally reset either after the transmission is completed
120 1.1 mycroft * or aborted. This bit should be set only after the Transmit Byte Count and
121 1.1 mycroft * Transmit Page Start register have been programmed.
122 1.1 mycroft */
123 1.1 mycroft #define ED_CR_TXP 0x04
124 1.1 mycroft
125 1.1 mycroft /*
126 1.1 mycroft * RD0, RD1, RD2: Remote DMA Command. These three bits control the operation
127 1.1 mycroft * of the remote DMA channel. RD2 can be set to abort any remote DMA command
128 1.1 mycroft * in progress. The Remote Byte Count registers should be cleared when a
129 1.1 mycroft * remote DMA has been aborted. The Remote Start Addresses are not restored
130 1.1 mycroft * to the starting address if the remote DMA is aborted.
131 1.1 mycroft *
132 1.1 mycroft * RD2 RD1 RD0 function
133 1.1 mycroft * 0 0 0 not allowed
134 1.1 mycroft * 0 0 1 remote read
135 1.1 mycroft * 0 1 0 remote write
136 1.1 mycroft * 0 1 1 send packet
137 1.1 mycroft * 1 X X abort
138 1.1 mycroft */
139 1.1 mycroft #define ED_CR_RD0 0x08
140 1.1 mycroft #define ED_CR_RD1 0x10
141 1.1 mycroft #define ED_CR_RD2 0x20
142 1.1 mycroft
143 1.1 mycroft /*
144 1.1 mycroft * PS0, PS1: Page Select. The two bits select which register set or 'page' to
145 1.1 mycroft * access.
146 1.1 mycroft *
147 1.1 mycroft * PS1 PS0 page
148 1.1 mycroft * 0 0 0
149 1.1 mycroft * 0 1 1
150 1.1 mycroft * 1 0 2
151 1.1 mycroft * 1 1 reserved
152 1.1 mycroft */
153 1.1 mycroft #define ED_CR_PS0 0x40
154 1.1 mycroft #define ED_CR_PS1 0x80
155 1.1 mycroft /* bit encoded aliases */
156 1.1 mycroft #define ED_CR_PAGE_0 0x00 /* (for consistency) */
157 1.1 mycroft #define ED_CR_PAGE_1 0x40
158 1.1 mycroft #define ED_CR_PAGE_2 0x80
159 1.1 mycroft
160 1.1 mycroft /*
161 1.1 mycroft * Interrupt Status Register (ISR) definitions
162 1.1 mycroft */
163 1.1 mycroft
164 1.1 mycroft /*
165 1.1 mycroft * PRX: Packet Received. Indicates packet received with no errors.
166 1.1 mycroft */
167 1.1 mycroft #define ED_ISR_PRX 0x01
168 1.1 mycroft
169 1.1 mycroft /*
170 1.1 mycroft * PTX: Packet Transmitted. Indicates packet transmitted with no errors.
171 1.1 mycroft */
172 1.1 mycroft #define ED_ISR_PTX 0x02
173 1.1 mycroft
174 1.1 mycroft /*
175 1.1 mycroft * RXE: Receive Error. Indicates that a packet was received with one or more
176 1.1 mycroft * the following errors: CRC error, frame alignment error, FIFO overrun,
177 1.1 mycroft * missed packet.
178 1.1 mycroft */
179 1.1 mycroft #define ED_ISR_RXE 0x04
180 1.1 mycroft
181 1.1 mycroft /*
182 1.1 mycroft * TXE: Transmission Error. Indicates that an attempt to transmit a packet
183 1.1 mycroft * resulted in one or more of the following errors: excessive collisions, FIFO
184 1.1 mycroft * underrun.
185 1.1 mycroft */
186 1.1 mycroft #define ED_ISR_TXE 0x08
187 1.1 mycroft
188 1.1 mycroft /*
189 1.1 mycroft * OVW: OverWrite. Indicates a receive ring-buffer overrun. Incoming network
190 1.1 mycroft * would exceed (has exceeded?) the boundary pointer, resulting in data that
191 1.1 mycroft * was previously received and not yet read from the buffer to be overwritten.
192 1.1 mycroft */
193 1.1 mycroft #define ED_ISR_OVW 0x10
194 1.1 mycroft
195 1.1 mycroft /*
196 1.1 mycroft * CNT: Counter Overflow. Set when the MSB of one or more of the Network Tally
197 1.1 mycroft * Counters has been set.
198 1.1 mycroft */
199 1.1 mycroft #define ED_ISR_CNT 0x20
200 1.1 mycroft
201 1.1 mycroft /*
202 1.1 mycroft * RDC: Remote Data Complete. Indicates that a Remote DMA operation has
203 1.1 mycroft * completed.
204 1.1 mycroft */
205 1.1 mycroft #define ED_ISR_RDC 0x40
206 1.1 mycroft
207 1.1 mycroft /*
208 1.1 mycroft * RST: Reset status. Set when the NIC enters the reset state and cleared when
209 1.1 mycroft * a Start Command is issued to the CR. This bit is also set when a receive
210 1.1 mycroft * ring-buffer overrun (OverWrite) occurs and is cleared when one or more
211 1.1 mycroft * packets have been removed from the ring. This is a read-only bit.
212 1.1 mycroft */
213 1.1 mycroft #define ED_ISR_RST 0x80
214 1.1 mycroft
215 1.1 mycroft /*
216 1.1 mycroft * Interrupt Mask Register (IMR) definitions
217 1.1 mycroft */
218 1.1 mycroft
219 1.1 mycroft /*
220 1.1 mycroft * PRXE: Packet Received interrupt Enable. If set, a received packet will
221 1.1 mycroft * cause an interrupt.
222 1.1 mycroft */
223 1.1 mycroft #define ED_IMR_PRXE 0x01
224 1.1 mycroft
225 1.1 mycroft /*
226 1.1 mycroft * PTXE: Packet Transmit interrupt Enable. If set, an interrupt is generated
227 1.1 mycroft * when a packet transmission completes.
228 1.1 mycroft */
229 1.1 mycroft #define ED_IMR_PTXE 0x02
230 1.1 mycroft
231 1.1 mycroft /*
232 1.1 mycroft * RXEE: Receive Error interrupt Enable. If set, an interrupt will occur
233 1.1 mycroft * whenever a packet is received with an error.
234 1.1 mycroft */
235 1.1 mycroft #define ED_IMR_RXEE 0x04
236 1.1 mycroft
237 1.1 mycroft /*
238 1.1 mycroft * TXEE: Transmit Error interrupt Enable. If set, an interrupt will occur
239 1.1 mycroft * whenever a transmission results in an error.
240 1.1 mycroft */
241 1.1 mycroft #define ED_IMR_TXEE 0x08
242 1.1 mycroft
243 1.1 mycroft /*
244 1.1 mycroft * OVWE: OverWrite error interrupt Enable. If set, an interrupt is generated
245 1.1 mycroft * whenever the receive ring-buffer is overrun. i.e. when the boundary pointer
246 1.1 mycroft * is exceeded.
247 1.1 mycroft */
248 1.1 mycroft #define ED_IMR_OVWE 0x10
249 1.1 mycroft
250 1.1 mycroft /*
251 1.1 mycroft * CNTE: Counter overflow interrupt Enable. If set, an interrupt is generated
252 1.1 mycroft * whenever the MSB of one or more of the Network Statistics counters has been
253 1.1 mycroft * set.
254 1.1 mycroft */
255 1.1 mycroft #define ED_IMR_CNTE 0x20
256 1.1 mycroft
257 1.1 mycroft /*
258 1.1 mycroft * RDCE: Remote DMA Complete interrupt Enable. If set, an interrupt is
259 1.1 mycroft * generated when a remote DMA transfer has completed.
260 1.1 mycroft */
261 1.1 mycroft #define ED_IMR_RDCE 0x40
262 1.1 mycroft
263 1.1 mycroft /*
264 1.1 mycroft * Bit 7 is unused/reserved.
265 1.1 mycroft */
266 1.1 mycroft
267 1.1 mycroft /*
268 1.1 mycroft * Data Configuration Register (DCR) definitions
269 1.1 mycroft */
270 1.1 mycroft
271 1.1 mycroft /*
272 1.1 mycroft * WTS: Word Transfer Select. WTS establishes byte or word transfers for both
273 1.1 mycroft * remote and local DMA transfers
274 1.1 mycroft */
275 1.1 mycroft #define ED_DCR_WTS 0x01
276 1.1 mycroft
277 1.1 mycroft /*
278 1.1 mycroft * BOS: Byte Order Select. BOS sets the byte order for the host. Should be 0
279 1.1 mycroft * for 80x86, and 1 for 68000 series processors
280 1.1 mycroft */
281 1.1 mycroft #define ED_DCR_BOS 0x02
282 1.1 mycroft
283 1.1 mycroft /*
284 1.1 mycroft * LAS: Long Address Select. When LAS is 1, the contents of the remote DMA
285 1.1 mycroft * registers RSAR0 and RSAR1 are used to provide A16-A31.
286 1.1 mycroft */
287 1.1 mycroft #define ED_DCR_LAS 0x04
288 1.1 mycroft
289 1.1 mycroft /*
290 1.1 mycroft * LS: Loopback Select. When 0, loopback mode is selected. Bits D1 and D2 of
291 1.1 mycroft * the TCR must also be programmed for loopback operation. When 1, normal
292 1.1 mycroft * operation is selected.
293 1.1 mycroft */
294 1.1 mycroft #define ED_DCR_LS 0x08
295 1.1 mycroft
296 1.1 mycroft /*
297 1.1 mycroft * AR: Auto-initialize Remote. When 0, data must be removed from ring-buffer
298 1.1 mycroft * under program control. When 1, remote DMA is automatically initiated and
299 1.1 mycroft * the boundary pointer is automatically updated.
300 1.1 mycroft */
301 1.1 mycroft #define ED_DCR_AR 0x10
302 1.1 mycroft
303 1.1 mycroft /*
304 1.1 mycroft * FT0, FT1: Fifo Threshold select.
305 1.1 mycroft *
306 1.1 mycroft * FT1 FT0 Word-width Byte-width
307 1.1 mycroft * 0 0 1 word 2 bytes
308 1.1 mycroft * 0 1 2 words 4 bytes
309 1.1 mycroft * 1 0 4 words 8 bytes
310 1.1 mycroft * 1 1 8 words 12 bytes
311 1.1 mycroft *
312 1.1 mycroft * During transmission, the FIFO threshold indicates the number of bytes or
313 1.1 mycroft * words that the FIFO has filled from the local DMA before BREQ is asserted.
314 1.1 mycroft * The transmission threshold is 16 bytes minus the receiver threshold.
315 1.1 mycroft */
316 1.1 mycroft #define ED_DCR_FT0 0x20
317 1.1 mycroft #define ED_DCR_FT1 0x40
318 1.1 mycroft
319 1.1 mycroft /*
320 1.1 mycroft * bit 7 (0x80) is unused/reserved
321 1.1 mycroft */
322 1.1 mycroft
323 1.1 mycroft /*
324 1.1 mycroft * Transmit Configuration Register (TCR) definitions
325 1.1 mycroft */
326 1.1 mycroft
327 1.1 mycroft /*
328 1.1 mycroft * CRC: Inhibit CRC. If 0, CRC will be appended by the transmitter, if 0, CRC
329 1.1 mycroft * is not appended by the transmitter.
330 1.1 mycroft */
331 1.1 mycroft #define ED_TCR_CRC 0x01
332 1.1 mycroft
333 1.1 mycroft /*
334 1.1 mycroft * LB0, LB1: Loopback control. These two bits set the type of loopback that is
335 1.1 mycroft * to be performed.
336 1.1 mycroft *
337 1.1 mycroft * LB1 LB0 mode
338 1.1 mycroft * 0 0 0 - normal operation (DCR_LS = 0)
339 1.1 mycroft * 0 1 1 - internal loopback (DCR_LS = 0)
340 1.1 mycroft * 1 0 2 - external loopback (DCR_LS = 1)
341 1.1 mycroft * 1 1 3 - external loopback (DCR_LS = 0)
342 1.1 mycroft */
343 1.1 mycroft #define ED_TCR_LB0 0x02
344 1.1 mycroft #define ED_TCR_LB1 0x04
345 1.1 mycroft
346 1.1 mycroft /*
347 1.1 mycroft * ATD: Auto Transmit Disable. Clear for normal operation. When set, allows
348 1.1 mycroft * another station to disable the NIC's transmitter by transmitting to a
349 1.1 mycroft * multicast address hashing to bit 62. Reception of a multicast address
350 1.1 mycroft * hashing to bit 63 enables the transmitter.
351 1.1 mycroft */
352 1.1 mycroft #define ED_TCR_ATD 0x08
353 1.1 mycroft
354 1.1 mycroft /*
355 1.1 mycroft * OFST: Collision Offset enable. This bit when set modifies the backoff
356 1.1 mycroft * algorithm to allow prioritization of nodes.
357 1.1 mycroft */
358 1.1 mycroft #define ED_TCR_OFST 0x10
359 1.1 mycroft
360 1.1 mycroft /*
361 1.1 mycroft * bits 5, 6, and 7 are unused/reserved
362 1.1 mycroft */
363 1.1 mycroft
364 1.1 mycroft /*
365 1.1 mycroft * Transmit Status Register (TSR) definitions
366 1.1 mycroft */
367 1.1 mycroft
368 1.1 mycroft /*
369 1.1 mycroft * PTX: Packet Transmitted. Indicates successful transmission of packet.
370 1.1 mycroft */
371 1.1 mycroft #define ED_TSR_PTX 0x01
372 1.1 mycroft
373 1.1 mycroft /*
374 1.1 mycroft * bit 1 (0x02) is unused/reserved
375 1.1 mycroft */
376 1.1 mycroft
377 1.1 mycroft /*
378 1.1 mycroft * COL: Transmit Collided. Indicates that the transmission collided at least
379 1.1 mycroft * once with another station on the network.
380 1.1 mycroft */
381 1.1 mycroft #define ED_TSR_COL 0x04
382 1.1 mycroft
383 1.1 mycroft /*
384 1.1 mycroft * ABT: Transmit aborted. Indicates that the transmission was aborted due to
385 1.1 mycroft * excessive collisions.
386 1.1 mycroft */
387 1.1 mycroft #define ED_TSR_ABT 0x08
388 1.1 mycroft
389 1.1 mycroft /*
390 1.1 mycroft * CRS: Carrier Sense Lost. Indicates that carrier was lost during the
391 1.1 mycroft * transmission of the packet. (Transmission is not aborted because of a loss
392 1.1 mycroft * of carrier).
393 1.1 mycroft */
394 1.1 mycroft #define ED_TSR_CRS 0x10
395 1.1 mycroft
396 1.1 mycroft /*
397 1.1 mycroft * FU: FIFO Underrun. Indicates that the NIC wasn't able to access bus/
398 1.1 mycroft * transmission memory before the FIFO emptied. Transmission of the packet was
399 1.1 mycroft * aborted.
400 1.1 mycroft */
401 1.1 mycroft #define ED_TSR_FU 0x20
402 1.1 mycroft
403 1.1 mycroft /*
404 1.1 mycroft * CDH: CD Heartbeat. Indicates that the collision detection circuitry isn't
405 1.1 mycroft * working correctly during a collision heartbeat test.
406 1.1 mycroft */
407 1.1 mycroft #define ED_TSR_CDH 0x40
408 1.1 mycroft
409 1.1 mycroft /*
410 1.1 mycroft * OWC: Out of Window Collision: Indicates that a collision occurred after a
411 1.1 mycroft * slot time (51.2us). The transmission is rescheduled just as in normal
412 1.1 mycroft * collisions.
413 1.1 mycroft */
414 1.1 mycroft #define ED_TSR_OWC 0x80
415 1.1 mycroft
416 1.1 mycroft /*
417 1.1 mycroft * Receiver Configuration Register (RCR) definitions
418 1.1 mycroft */
419 1.1 mycroft
420 1.1 mycroft /*
421 1.1 mycroft * SEP: Save Errored Packets. If 0, error packets are discarded. If set to 1,
422 1.1 mycroft * packets with CRC and frame errors are not discarded.
423 1.1 mycroft */
424 1.1 mycroft #define ED_RCR_SEP 0x01
425 1.1 mycroft
426 1.1 mycroft /*
427 1.1 mycroft * AR: Accept Runt packet. If 0, packet with less than 64 byte are discarded.
428 1.1 mycroft * If set to 1, packets with less than 64 byte are not discarded.
429 1.1 mycroft */
430 1.1 mycroft #define ED_RCR_AR 0x02
431 1.1 mycroft
432 1.1 mycroft /*
433 1.1 mycroft * AB: Accept Broadcast. If set, packets sent to the broadcast address will be
434 1.1 mycroft * accepted.
435 1.1 mycroft */
436 1.1 mycroft #define ED_RCR_AB 0x04
437 1.1 mycroft
438 1.1 mycroft /*
439 1.1 mycroft * AM: Accept Multicast. If set, packets sent to a multicast address are
440 1.1 mycroft * checked for a match in the hashing array. If clear, multicast packets are
441 1.1 mycroft * ignored.
442 1.1 mycroft */
443 1.1 mycroft #define ED_RCR_AM 0x08
444 1.1 mycroft
445 1.1 mycroft /*
446 1.1 mycroft * PRO: Promiscuous Physical. If set, all packets with a physical addresses
447 1.1 mycroft * are accepted. If clear, a physical destination address must match this
448 1.1 mycroft * station's address. Note: for full promiscuous mode, RCR_AB and RCR_AM must
449 1.1 mycroft * also be set. In addition, the multicast hashing array must be set to all
450 1.1 mycroft * 1's so that all multicast addresses are accepted.
451 1.1 mycroft */
452 1.1 mycroft #define ED_RCR_PRO 0x10
453 1.1 mycroft
454 1.1 mycroft /*
455 1.1 mycroft * MON: Monitor Mode. If set, packets will be checked for good CRC and
456 1.1 mycroft * framing, but are not stored in the ring-buffer. If clear, packets are
457 1.1 mycroft * stored (normal operation).
458 1.1 mycroft */
459 1.1 mycroft #define ED_RCR_MON 0x20
460 1.1 mycroft
461 1.1 mycroft /*
462 1.1 mycroft * Bits 6 and 7 are unused/reserved.
463 1.1 mycroft */
464 1.1 mycroft
465 1.1 mycroft /*
466 1.1 mycroft * Receiver Status Register (RSR) definitions
467 1.1 mycroft */
468 1.1 mycroft
469 1.1 mycroft /*
470 1.1 mycroft * PRX: Packet Received without error.
471 1.1 mycroft */
472 1.1 mycroft #define ED_RSR_PRX 0x01
473 1.1 mycroft
474 1.1 mycroft /*
475 1.1 mycroft * CRC: CRC error. Indicates that a packet has a CRC error. Also set for
476 1.1 mycroft * frame alignment errors.
477 1.1 mycroft */
478 1.1 mycroft #define ED_RSR_CRC 0x02
479 1.1 mycroft
480 1.1 mycroft /*
481 1.1 mycroft * FAE: Frame Alignment Error. Indicates that the incoming packet did not end
482 1.1 mycroft * on a byte boundary and the CRC did not match at the last byte boundary.
483 1.1 mycroft */
484 1.1 mycroft #define ED_RSR_FAE 0x04
485 1.1 mycroft
486 1.1 mycroft /*
487 1.1 mycroft * FO: FIFO Overrun. Indicates that the FIFO was not serviced (during local
488 1.1 mycroft * DMA) causing it to overrun. Reception of the packet is aborted.
489 1.1 mycroft */
490 1.1 mycroft #define ED_RSR_FO 0x08
491 1.1 mycroft
492 1.1 mycroft /*
493 1.1 mycroft * MPA: Missed Packet. Indicates that the received packet couldn't be stored
494 1.1 mycroft * in the ring-buffer because of insufficient buffer space (exceeding the
495 1.1 mycroft * boundary pointer), or because the transfer to the ring-buffer was inhibited
496 1.1 mycroft * by RCR_MON - monitor mode.
497 1.1 mycroft */
498 1.1 mycroft #define ED_RSR_MPA 0x10
499 1.1 mycroft
500 1.1 mycroft /*
501 1.1 mycroft * PHY: Physical address. If 0, the packet received was sent to a physical
502 1.1 mycroft * address. If 1, the packet was accepted because of a multicast/broadcast
503 1.1 mycroft * address match.
504 1.1 mycroft */
505 1.1 mycroft #define ED_RSR_PHY 0x20
506 1.1 mycroft
507 1.1 mycroft /*
508 1.1 mycroft * DIS: Receiver Disabled. Set to indicate that the receiver has enetered
509 1.1 mycroft * monitor mode. Cleared when the receiver exits monitor mode.
510 1.1 mycroft */
511 1.1 mycroft #define ED_RSR_DIS 0x40
512 1.1 mycroft
513 1.1 mycroft /*
514 1.1 mycroft * DFR: Deferring. Set to indicate a 'jabber' condition. The CRS and COL
515 1.1 mycroft * inputs are active, and the transceiver has set the CD line as a result of
516 1.1 mycroft * the jabber.
517 1.1 mycroft */
518 1.1 mycroft #define ED_RSR_DFR 0x80
519 1.1 mycroft
520 1.1 mycroft /*
521 1.3 scottr * receive ring descriptor
522 1.1 mycroft *
523 1.1 mycroft * The National Semiconductor DS8390 Network interface controller uses the
524 1.1 mycroft * following receive ring headers. The way this works is that the memory on
525 1.1 mycroft * the interface card is chopped up into 256 bytes blocks. A contiguous
526 1.1 mycroft * portion of those blocks are marked for receive packets by setting start and
527 1.1 mycroft * end block #'s in the NIC. For each packet that is put into the receive
528 1.1 mycroft * ring, one of these headers (4 bytes each) is tacked onto the front. The
529 1.1 mycroft * first byte is a copy of the receiver status register at the time the packet
530 1.1 mycroft * was received.
531 1.3 scottr */
532 1.3 scottr struct dp8390_ring {
533 1.3 scottr u_int8_t rsr; /* receiver status */
534 1.3 scottr u_int8_t next_packet; /* pointer to next packet */
535 1.3 scottr u_int16_t count; /* bytes in packet (length + 4) */
536 1.3 scottr };
537 1.3 scottr
538 1.3 scottr /*
539 1.3 scottr * XXX For compatibility only! This needs to die when all drivers have
540 1.3 scottr * been converted to be front ends to the MI driver.
541 1.1 mycroft */
542 1.1 mycroft struct ed_ring {
543 1.2 mycroft #if BYTE_ORDER == BIG_ENDIAN
544 1.2 mycroft u_char next_packet; /* pointer to next packet */
545 1.2 mycroft u_char rsr; /* receiver status */
546 1.2 mycroft #else
547 1.1 mycroft u_char rsr; /* receiver status */
548 1.1 mycroft u_char next_packet; /* pointer to next packet */
549 1.2 mycroft #endif
550 1.1 mycroft u_short count; /* bytes in packet (length + 4) */
551 1.1 mycroft };
552 1.1 mycroft
553 1.1 mycroft /*
554 1.1 mycroft * Common constants
555 1.1 mycroft */
556 1.1 mycroft #define ED_PAGE_SIZE 256 /* Size of RAM pages in bytes */
557 1.1 mycroft #define ED_PAGE_MASK 255
558 1.1 mycroft #define ED_PAGE_SHIFT 8
559 1.1 mycroft
560 1.1 mycroft #define ED_TXBUF_SIZE 6 /* Size of TX buffer in pages */
561