FreeBSD/Linux Kernel Cross Reference
sys/i386at/if_3c501.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: if_3c501.h,v $
29 * Revision 2.5 91/05/14 16:24:31 mrt
30 * Correcting copyright
31 *
32 * Revision 2.4 91/02/05 17:17:41 mrt
33 * Added OSF permision and disclaimer clause per instructions
34 * of Philippe Bernadat.
35 * [91/02/04 mrt]
36 * Changed to new Mach copyright
37 * [91/02/01 17:43:49 mrt]
38 *
39 * Revision 2.3 90/11/26 14:49:56 rvb
40 * jsb bet me to XMK34, sigh ...
41 * [90/11/26 rvb]
42 * Synched 2.5 & 3.0 at I386q (r2.1.1.2) & XMK35 (r2.3)
43 * [90/11/15 rvb]
44 *
45 * Revision 2.2 90/05/03 15:44:05 dbg
46 * First checkin.
47 *
48 * Revision 2.1.1.1 90/03/16 18:15:44 rvb
49 * installed
50 * [90/03/13 rvb]
51 *
52 * Created by Philippe Bernadat
53 */
54 /*
55 * File: if_3c501.h
56 * Author: Philippe Bernadat
57 * Date: 1989
58 * Copyright (c) 1989 OSF Research Institute
59 *
60 * 3COM Etherlink 3C501 Mach Ethernet drvier
61 */
62 /*
63 Copyright 1990 by Open Software Foundation,
64 Cambridge, MA.
65
66 All Rights Reserved
67
68 Permission to use, copy, modify, and distribute this software and
69 its documentation for any purpose and without fee is hereby granted,
70 provided that the above copyright notice appears in all copies and
71 that both the copyright notice and this permission notice appear in
72 supporting documentation, and that the name of OSF or Open Software
73 Foundation not be used in advertising or publicity pertaining to
74 distribution of the software without specific, written prior
75 permission.
76
77 OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
78 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
79 IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
80 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
81 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
82 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
83 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
84 */
85
86 /* The various IE command registers */
87
88 #define EDLC_ADDR(base) (base) /* EDLC station address, 6 bytes*/
89 #define EDLC_RCV(base) ((base)+0x6) /* EDLC receive cmd. & stat. */
90 #define EDLC_XMT(base) ((base)+0x7) /* EDLC transmit cmd. & stat. */
91 #define IE_GP(base) ((base)+0x8) /* General Purpose pointer */
92 #define IE_RP(base) ((base)+0xa) /* Receive buffer pointer */
93 #define IE_SAPROM(base) ((base)+0xc) /* station addr prom window */
94 #define IE_CSR(base) ((base)+0xe) /* IE command and status */
95 #define IE_BFR(base) ((base)+0xf) /* 1 byte window on packet buffer*/
96
97 /* CSR Status Register (read)
98 *
99 * _______________________________________________________________________
100 * | | | | | | | | |
101 * | XMTBSY | RIDE | DMA | EDMA | BUFCTL | | RCVBSY |
102 * |________|________|________|________|________|________|________|________|
103 *
104 */
105
106 /* CSR Command Register (write)
107 *
108 * _______________________________________________________________________
109 * | | | | | | | | |
110 * | RESET | RIDE | DMA | | BUFCTL | | IRE |
111 * |________|________|________|________|________|________|________|________|
112 *
113 */
114
115 #define IE_XMTBSY 0x80 /* Transmitter busy (ro) */
116 #define IE_RESET 0x80 /* reset the controller (wo) */
117 #define IE_RIDE 0x40 /* request interrupt/DMA enable (rw) */
118 #define IE_DMA 0x20 /* DMA request (rw) */
119 #define IE_EDMA 0x10 /* DMA done (ro) */
120 #define IE_BUFCTL 0x0c /* mask for buffer control field (rw) */
121 #define IE_RCVBSY 0x01 /* receive in progress (ro) */
122 #define IE_IRE 0x01 /* Interrupt request enable */
123
124 /* BUFCTL values */
125
126 #define IE_LOOP 0x0c /* 2 bit field in bits 2,3, loopback */
127 #define IE_RCVEDLC 0x08 /* gives buffer to receiver */
128 #define IE_XMTEDLC 0x04 /* gives buffer to transmit */
129 #define IE_SYSBFR 0x00 /* gives buffer to processor */
130
131 /* XMTCSR Transmit Status Register (read)
132 *
133 * _______________________________________________________________________
134 * | | | | | | | | |
135 * | | | | | IDLE | 16 | JAM | UNDER |
136 * |________|________|________|________|________|________|________|________|
137 *
138 */
139
140 /* XMTCSR Transmit Command Register (write) enables interrupts when written
141 *
142 * _______________________________________________________________________
143 * | | | | | | | | |
144 * | | | | | | | | |
145 * |________|________|________|________|________|________|________|________|
146 *
147 */
148
149 #define EDLC_IDLE 0x08 /* transmit idle */
150 #define EDLC_16 0x04 /* packet experienced 16 collisions */
151 #define EDLC_JAM 0x02 /* packet experienced a collision */
152 #define EDLC_UNDER 0x01 /* data underflow */
153
154 /* RCVCSR Receive Status Register (read)
155 *
156 * _______________________________________________________________________
157 * | | | | | | | | |
158 * | STALE | | GOOD | ANY | SHORT | DRIBBLE| FCS | OVER |
159 * |________|________|________|________|________|________|________|________|
160 *
161 */
162
163 /* RCVCSR Receive Command Register (write) enables interrupt when written
164 *
165 * _______________________________________________________________________
166 * | | | | | | | | |
167 * | ADDR MATCH MODE | GOOD | ANY | SHORT | DRIBBLE| FCS | OVER |
168 * |________|________|________|________|________|________|________|________|
169 *
170 */
171
172 #define EDLC_STALE 0x80 /* receive CSR status previously read */
173 #define EDLC_GOOD 0x20 /* well formed packets only */
174 #define EDLC_ANY 0x10 /* any packet, even those with errors */
175 #define EDLC_SHORT 0x08 /* short frame */
176 #define EDLC_DRIBBLE 0x04 /* dribble error */
177 #define EDLC_FCS 0x02 /* CRC error */
178 #define EDLC_OVER 0x01 /* data overflow */
179
180 /* Address Match Mode */
181
182 #define EDLC_NONE 0x00 /* match mode in bits 5-6, write only */
183 #define EDLC_ALL 0x40 /* promiscuous receive, write only */
184 #define EDLC_BROAD 0x80 /* station address plus broadcast */
185 #define EDLC_MULTI 0xc0 /* station address plus multicast */
186
187 /* Packet Buffer size */
188
189 #define BFRSIZ 2048
190
191 #define NAT3C501 1
192 #define ETHER_ADD_SIZE 6 /* size of a MAC address */
193
194 #ifndef TRUE
195 #define TRUE 1
196 #endif TRUE
197 #define HZ 100
198
199 #define DSF_LOCK 1
200 #define DSF_RUNNING 2
201
202 #define MOD_ENAL 1
203 #define MOD_PROM 2
Cache object: 48e5db55ee70394537a966b4170bc325
|