unstack - fix ipcvecs
[minix.git] / sys / arch / i386 / stand / lib / netif / lance.h
blobf71dd14e1fa5fb06441809319a3cfac80082ba51
1 /* $NetBSD: lance.h,v 1.2 2008/12/14 18:46:33 christos Exp $ */
3 /*
4 * source in this file came from
5 * the Mach ethernet boot written by Leendert van Doorn.
6 */
8 /* RAP functions as a select for RDP */
9 #define RDP_CSR0 0
10 #define RDP_CSR1 1
11 #define RDP_CSR2 2
12 #define RDP_CSR3 3
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
44 typedef struct {
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 */
54 } initblock_t;
56 /* bits in mode */
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
63 #define IB_DTX 0x0002
64 #define IB_DRX 0x0001
67 * A receive message descriptor entry
69 typedef struct {
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 */
75 } rmde_t;
77 /* bits in flags */
78 #define RMD_OWN 0x80
79 #define RMD_ERR 0x40
80 #define RMD_FRAM 0x20
81 #define RMD_OFLO 0x10
82 #define RMD_CRC 0x08
83 #define RMD_BUFF 0x04
84 #define RMD_STP 0x02
85 #define RMD_ENP 0x01
88 * A transmit message descriptor entry
90 typedef struct {
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 */
96 } tmde_t;
98 /* bits in flags */
99 #define TMD_OWN 0x80
100 #define TMD_ERR 0x40
101 #define TMD_MORE 0x10
102 #define TMD_ONE 0x08
103 #define TMD_DEF 0x04
104 #define TMD_STP 0x02
105 #define TMD_ENP 0x01
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 */