1 /* $NetBSD: lance.h,v 1.2 2008/12/14 18:46:33 christos Exp $ */
4 * source in this file came from
5 * the Mach ethernet boot written by Leendert van Doorn.
8 /* RAP functions as a select for RDP */
14 /* contents of csr0 */
15 #define CSR_ERR 0x8000
16 #define CSR_BABL 0x4000
17 #define CSR_CERR 0x2000
18 #define CSR_MISS 0x1000
19 #define CSR_MERR 0x0800
20 #define CSR_RINT 0x0400
21 #define CSR_TINT 0x0200
22 #define CSR_IDON 0x0100
23 #define CSR_INTR 0x0080
24 #define CSR_INEA 0x0040
25 #define CSR_RXON 0x0020
26 #define CSR_TXON 0x0010
27 #define CSR_TDMD 0x0008
28 #define CSR_STOP 0x0004
29 #define CSR_STRT 0x0002
30 #define CSR_INIT 0x0001
32 /* csr1 contains low 16 bits of address of Initialization Block */
34 /* csr2 contains in low byte high 8 bits of address of InitBlock */
36 /* contents of csr3 */
37 #define CSR3_BSWP 0x04 /* byte swap (for big endian) */
38 #define CSR3_ACON 0x02 /* ALE control */
39 #define CSR3_BCON 0x01 /* byte control */
42 * The initialization block
45 u_short ib_mode
; /* modebits, see below */
46 char ib_padr
[6]; /* physical 48bit Ether-address */
47 u_short ib_ladrf
[4]; /* 64bit hashtable for "logical" addresses */
48 u_short ib_rdralow
; /* low 16 bits of Receiver Descr. Ring addr */
49 u_char ib_rdrahigh
; /* high 8 bits of Receiver Descr. Ring addr */
50 u_char ib_rlen
; /* upper 3 bits are 2log Rec. Ring Length */
51 u_short ib_tdralow
; /* low 16 bits of Transm. Descr. Ring addr */
52 u_char ib_tdrahigh
; /* high 8 bits of Transm. Descr. Ring addr */
53 u_char ib_tlen
; /* upper 3 bits are 2log Transm. Ring Length */
57 #define IB_PROM 0x8000
58 #define IB_INTL 0x0040
59 #define IB_DRTY 0x0020
60 #define IB_COLL 0x0010
61 #define IB_DTCR 0x0008
62 #define IB_LOOP 0x0004
67 * A receive message descriptor entry
70 u_short rmd_ladr
; /* low 16 bits of bufaddr */
71 char rmd_hadr
; /* high 8 bits of bufaddr */
72 char rmd_flags
; /* see below */
73 short rmd_bcnt
; /* two's complement of buffer byte count */
74 u_short rmd_mcnt
; /* message byte count */
88 * A transmit message descriptor entry
91 u_short tmd_ladr
; /* low 16 bits of bufaddr */
92 u_char tmd_hadr
; /* high 8 bits of bufaddr */
93 u_char tmd_flags
; /* see below */
94 short tmd_bcnt
; /* two's complement of buffer byte count */
95 u_short tmd_err
; /* more error bits + TDR */
101 #define TMD_MORE 0x10
107 /* bits in tmd_err */
108 #define TMDE_BUFF 0x8000
109 #define TMDE_UFLO 0x4000
110 #define TMDE_LCOL 0x1000
111 #define TMDE_LCAR 0x0800
112 #define TMDE_RTRY 0x0400
113 #define TMDE_TDR 0x003F /* mask for TDR */