|
|
1.1 root 1: /*-
2: *
3: * This software may be used and distributed according to the terms
4: * of the GNU Public License, incorporated herein by reference.
5: *
6: * Module : sk_g16.h
7: * Version : $Revision: 1.1 $
8: *
9: * Author : M.Hipp ([email protected])
10: * changes by : Patrick J.D. Weichmann
11: *
12: * Date Created : 94/05/25
13: *
14: * Description : In here are all necessary definitions of
15: * the am7990 (LANCE) chip used for writing a
16: * network device driver which uses this chip
17: *
18: * $Log: sk_g16.h,v $
19: * Revision 1.1 1999/04/26 05:52:37 tb
20: * 1998-11-30 OKUJI Yoshinori <[email protected]>
21: *
22: * Clean up linux emulation code to make it architecture-independent
23: * as much as possible.
24: *
25: * * linux: Renamed from linuxdev.
26: * * Makefile.in (objfiles): Add linux.o instead of linuxdev.o.
27: * (MAKE): New variable. Used for the linux.o target.
28: * * configure.in: Add AC_CHECK_TOOL(MAKE, make).
29: * * i386/i386/spl.h: Include <i386/ipl.h>, for compatibility with
30: * OSF Mach 3.0. Suggested by Elgin Lee <[email protected]>.
31: * * linux/src: Renamed from linux/linux.
32: * * linux/dev: Renamed from linux/mach.
33: * * linux/Drivers.in (AC_INIT): Use dev/include/linux/autoconf.h,
34: * instead of mach/include/linux/autoconf.h.
35: * * Makefile.in (all): Target ../linux.o instead of ../linuxdev.o.
36: * * linux/dev/drivers/block/genhd.c: Include <machine/spl.h> instead
37: * of <i386/ipl.h>.
38: * * linux/dev/drivers/net/auto_irq.c: Remove unneeded header files,
39: * <i386/ipl.h> and <i386/pic.h>.
40: * * linux/dev/init/main.c: Many i386-dependent codes moved to ...
41: * * linux/dev/arch/i386/irq.c: ... here.
42: * * linux/dev/arch/i386/setup.c: New file.
43: * * linux/dev/arch/i386/linux_emul.h: Likewise.
44: * * linux/dev/arch/i386/glue/timer.c: Merged into sched.c.
45: * * linux/dev/arch/i386/glue/sched.c: Include <machine/spl.h> instead
46: * of <i386/ipl.h>, and moved to ...
47: * * linux/dev/kernel/sched.c: ... here.
48: * * linux/dev/arch/i386/glue/block.c: Include <machine/spl.h> and
49: * <linux_emul.h>, instead of i386-dependent header files, and
50: * moved to ...
51: * * linux/dev/glue/blocl.c: ... here.
52: * * linux/dev/arch/i386/glue/net.c: Include <machine/spl.h> and
53: * <linux_emul.h>, instead of i386-dependent header files, and
54: * moved to ...
55: * * linux/dev/glue/net.c: ... here.
56: * * linux/dev/arch/i386/glue/misc.c: Remove `x86' and moved to ...
57: * * linux/dev/glue/misc.c: ... here.
58: * * linux/dev/arch/i386/glue/kmem.c: Moved to ...
59: * * linux/dev/glue/kmem.c: ... here.
60: *
61: -*/
62:
63: #ifndef SK_G16_H
64:
65: #define SK_G16_H
66:
67:
68: /*
69: * Control and Status Register 0 (CSR0) bit definitions
70: *
71: * (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write)
72: *
73: */
74:
75: #define CSR0_ERR 0x8000 /* Error summary (R) */
76: #define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */
77: #define CSR0_CERR 0x2000 /* Collision Error (RC) */
78: #define CSR0_MISS 0x1000 /* Missed packet (RC) */
79: #define CSR0_MERR 0x0800 /* Memory Error (RC) */
80: #define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */
81: #define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */
82: #define CSR0_IDON 0x0100 /* Initialization Done (RC) */
83: #define CSR0_INTR 0x0080 /* Interrupt Flag (R) */
84: #define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */
85: #define CSR0_RXON 0x0020 /* Receiver on (R) */
86: #define CSR0_TXON 0x0010 /* Transmitter on (R) */
87: #define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */
88: #define CSR0_STOP 0x0004 /* Stop (RS) */
89: #define CSR0_STRT 0x0002 /* Start (RS) */
90: #define CSR0_INIT 0x0001 /* Initialize (RS) */
91:
92: #define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */
93:
94: /*
95: * Control and Status Register 3 (CSR3) bit definitions
96: *
97: */
98:
99: #define CSR3_BSWAP 0x0004 /* Byte Swap (RW) */
100: #define CSR3_ACON 0x0002 /* ALE Control (RW) */
101: #define CSR3_BCON 0x0001 /* Byte Control (RW) */
102:
103: /*
104: * Initialization Block Mode operation Bit Definitions.
105: */
106:
107: #define MODE_PROM 0x8000 /* Promiscuous Mode */
108: #define MODE_INTL 0x0040 /* Internal Loopback */
109: #define MODE_DRTY 0x0020 /* Disable Retry */
110: #define MODE_COLL 0x0010 /* Force Collision */
111: #define MODE_DTCR 0x0008 /* Disable Transmit CRC) */
112: #define MODE_LOOP 0x0004 /* Loopback */
113: #define MODE_DTX 0x0002 /* Disable the Transmitter */
114: #define MODE_DRX 0x0001 /* Disable the Receiver */
115:
116: #define MODE_NORMAL 0x0000 /* Normal operation mode */
117:
118: /*
119: * Receive message descriptor status bit definitions.
120: */
121:
122: #define RX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
123: #define RX_ERR 0x40 /* Error Summary */
124: #define RX_FRAM 0x20 /* Framing Error */
125: #define RX_OFLO 0x10 /* Overflow Error */
126: #define RX_CRC 0x08 /* CRC Error */
127: #define RX_BUFF 0x04 /* Buffer Error */
128: #define RX_STP 0x02 /* Start of Packet */
129: #define RX_ENP 0x01 /* End of Packet */
130:
131:
132: /*
133: * Transmit message descriptor status bit definitions.
134: */
135:
136: #define TX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
137: #define TX_ERR 0x40 /* Error Summary */
138: #define TX_MORE 0x10 /* More the 1 retry needed to Xmit */
139: #define TX_ONE 0x08 /* One retry needed to Xmit */
140: #define TX_DEF 0x04 /* Deferred */
141: #define TX_STP 0x02 /* Start of Packet */
142: #define TX_ENP 0x01 /* End of Packet */
143:
144: /*
145: * Transmit status (2) (valid if TX_ERR == 1)
146: */
147:
148: #define TX_BUFF 0x8000 /* Buffering error (no ENP) */
149: #define TX_UFLO 0x4000 /* Underflow (late memory) */
150: #define TX_LCOL 0x1000 /* Late collision */
151: #define TX_LCAR 0x0400 /* Loss of Carrier */
152: #define TX_RTRY 0x0200 /* Failed after 16 retransmissions */
153: #define TX_TDR 0x003f /* Time-domain-reflectometer-value */
154:
155:
156: /*
157: * Structures used for Communication with the LANCE
158: */
159:
160: /* LANCE Initialize Block */
161:
162: struct init_block
163: {
164: unsigned short mode; /* Mode Register */
165: unsigned char paddr[6]; /* Physical Address (MAC) */
166: unsigned char laddr[8]; /* Logical Filter Address (not used) */
167: unsigned int rdrp; /* Receive Descriptor Ring pointer */
168: unsigned int tdrp; /* Transmit Descriptor Ring pointer */
169: };
170:
171:
172: /* Receive Message Descriptor Entry */
173:
174: struct rmd
175: {
176: union
177: {
178: unsigned long buffer; /* Address of buffer */
179: struct
180: {
181: unsigned char unused[3];
182: unsigned volatile char status; /* Status Bits */
183: } s;
184: } u;
185: volatile short blen; /* Buffer Length (two's complement) */
186: unsigned short mlen; /* Message Byte Count */
187: };
188:
189:
190: /* Transmit Message Descriptor Entry */
191:
192: struct tmd
193: {
194: union
195: {
196: unsigned long buffer; /* Address of buffer */
197: struct
198: {
199: unsigned char unused[3];
200: unsigned volatile char status; /* Status Bits */
201: } s;
202: } u;
203: unsigned short blen; /* Buffer Length (two's complement) */
204: unsigned volatile short status2; /* Error Status Bits */
205: };
206:
207: #endif /* End of SK_G16_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.