]> git.saurik.com Git - apple/xnu.git/blob - bsd/if/ppc/mace.h
xnu-344.21.73.tar.gz
[apple/xnu.git] / bsd / if / ppc / mace.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
27 * All Rights Reserved
28 *
29 * Permission to use, copy, modify, and distribute this software and
30 * its documentation for any purpose and without fee is hereby granted,
31 * provided that the above copyright notice appears in all copies and
32 * that both the copyright notice and this permission notice appear in
33 * supporting documentation.
34 *
35 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
36 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37 * FOR A PARTICULAR PURPOSE.
38 *
39 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
40 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
42 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
43 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 *
45 */
46 /*
47 * Copyright 1996 1995 by Apple Computer, Inc. 1997 1996 1995 1994 1993 1992 1991
48 * All Rights Reserved
49 *
50 * Permission to use, copy, modify, and distribute this software and
51 * its documentation for any purpose and without fee is hereby granted,
52 * provided that the above copyright notice appears in all copies and
53 * that both the copyright notice and this permission notice appear in
54 * supporting documentation.
55 *
56 * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
57 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
58 * FOR A PARTICULAR PURPOSE.
59 *
60 * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
61 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
62 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
63 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
64 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
65 */
66 /*
67 * MKLINUX-1.0DR2
68 */
69 /*
70 * PMach Operating System
71 * Copyright (c) 1995 Santa Clara University
72 * All Rights Reserved.
73 */
74 /*
75 * Mach Operating System
76 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
77 * All Rights Reserved.
78 *
79 * Permission to use, copy, modify and distribute this software and its
80 * documentation is hereby granted, provided that both the copyright
81 * notice and this permission notice appear in all copies of the
82 * software, derivative works or modified versions, and any portions
83 * thereof, and that both notices appear in supporting documentation.
84 *
85 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
86 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
87 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
88 *
89 * Carnegie Mellon requests users of this software to return to
90 *
91 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
92 * School of Computer Science
93 * Carnegie Mellon University
94 * Pittsburgh PA 15213-3890
95 *
96 * any improvements or extensions that they make and grant Carnegie Mellon
97 * the rights to redistribute these changes.
98 */
99 /*
100 * File: if_3c501.h
101 * Author: Philippe Bernadat
102 * Date: 1989
103 * Copyright (c) 1989 OSF Research Institute
104 *
105 * 3COM Etherlink 3C501 Mach Ethernet drvier
106 */
107 /*
108 Copyright 1990 by Open Software Foundation,
109 Cambridge, MA.
110
111 All Rights Reserved
112
113 Permission to use, copy, modify, and distribute this software and
114 its documentation for any purpose and without fee is hereby granted,
115 provided that the above copyright notice appears in all copies and
116 that both the copyright notice and this permission notice appear in
117 supporting documentation, and that the name of OSF or Open Software
118 Foundation not be used in advertising or publicity pertaining to
119 distribution of the software without specific, written prior
120 permission.
121
122 OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
123 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
124 IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
125 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
126 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
127 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
128 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
129 */
130
131 #ifdef KERNEL
132 #include <sys/cdefs.h>
133 #endif
134
135
136 #define ENETPAD(n) char n[15]
137
138 /* 0x50f0a000 */
139 struct mace_board {
140 volatile unsigned char rcvfifo; /* 00 receive fifo */
141 ENETPAD(epad0);
142 volatile unsigned char xmtfifo; /* 01 transmit fifo */
143 ENETPAD(epad1);
144 volatile unsigned char xmtfc; /* 02 transmit frame control */
145 ENETPAD(epad2);
146 volatile unsigned char xmtfs; /* 03 transmit frame status */
147 ENETPAD(epad3);
148 volatile unsigned char xmtrc; /* 04 transmit retry count */
149 ENETPAD(epad4);
150 volatile unsigned char rcvfc; /* 05 receive frame control -- 4 bytes */
151 ENETPAD(epad5);
152 volatile unsigned char rcvfs; /* 06 receive frame status */
153 ENETPAD(epad6);
154 volatile unsigned char fifofc; /* 07 fifo frame count */
155 ENETPAD(epad7);
156 volatile unsigned char ir; /* 08 interrupt */
157 ENETPAD(epad8);
158 volatile unsigned char imr; /* 09 interrupt mask */
159 ENETPAD(epad9);
160 volatile unsigned char pr; /* 10 poll */
161 ENETPAD(epad10);
162 volatile unsigned char biucc; /* 11 bus interface unit configuration control */
163 ENETPAD(epad11);
164 volatile unsigned char fifocc; /* 12 fifo configuration control */
165 ENETPAD(epad12);
166 volatile unsigned char maccc; /* 13 media access control configuration control */
167 ENETPAD(epad13);
168 volatile unsigned char plscc; /* 14 physical layer signalling configuration control */
169 ENETPAD(epad14);
170 volatile unsigned char phycc; /* 15 physical layer configuration control */
171 ENETPAD(epad15);
172 volatile unsigned char chipid1; /* 16 chip identification LSB */
173 ENETPAD(epad16);
174 volatile unsigned char chipid2; /* 17 chip identification MSB */
175 ENETPAD(epad17);
176 volatile unsigned char iac; /* 18 internal address configuration */
177 ENETPAD(epad18);
178 volatile unsigned char res1; /* 19 */
179 ENETPAD(epad19);
180 volatile unsigned char ladrf; /* 20 logical address filter -- 8 bytes */
181 ENETPAD(epad20);
182 volatile unsigned char padr; /* 21 physical address -- 6 bytes */
183 ENETPAD(epad21);
184 volatile unsigned char res2; /* 22 */
185 ENETPAD(epad22);
186 volatile unsigned char res3; /* 23 */
187 ENETPAD(epad23);
188 volatile unsigned char mpc; /* 24 missed packet count */
189 ENETPAD(epad24);
190 volatile unsigned char res4; /* 25 */
191 ENETPAD(epad25);
192 volatile unsigned char rntpc; /* 26 runt packet count */
193 ENETPAD(epad26);
194 volatile unsigned char rcvcc; /* 27 receive collision count */
195 ENETPAD(epad27);
196 volatile unsigned char res5; /* 28 */
197 ENETPAD(epad28);
198 volatile unsigned char utr; /* 29 user test */
199 ENETPAD(epad29);
200 volatile unsigned char res6; /* 30 */
201 ENETPAD(epad30);
202 volatile unsigned char res7; /* 31 */
203 };
204
205 /*
206 * Chip Revisions..
207 */
208
209 #define MACE_REVISION_B0 0x0940
210 #define MACE_REVISION_A2 0x0941
211
212 /* xmtfc */
213 #define XMTFC_DRTRY 0X80
214 #define XMTFC_DXMTFCS 0x08
215 #define XMTFC_APADXNT 0x01
216
217 /* xmtfs */
218 #define XMTFS_XNTSV 0x80
219 #define XMTFS_XMTFS 0x40
220 #define XMTFS_LCOL 0x20
221 #define XMTFS_MORE 0x10
222 #define XMTFS_ONE 0x08
223 #define XMTFS_DEFER 0x04
224 #define XMTFS_LCAR 0x02
225 #define XMTFS_RTRY 0x01
226
227 /* xmtrc */
228 #define XMTRC_EXDEF 0x80
229
230 /* rcvfc */
231 #define RCVFC_LLRCV 0x08
232 #define RCVFC_M_R 0x04
233 #define RCVFC_ASTRPRCV 0x01
234
235 /* rcvfs */
236 #define RCVFS_OFLO 0x80
237 #define RCVFS_CLSN 0x40
238 #define RCVFS_FRAM 0x20
239 #define RCVFS_FCS 0x10
240 #define RCVFS_REVCNT 0x0f
241
242 /* fifofc */
243 #define FIFOCC_XFW_8 0x00
244 #define FIFOCC_XFW_16 0x40
245 #define FIFOCC_XFW_32 0x80
246 #define FIFOCC_XFW_XX 0xc0
247 #define FIFOCC_RFW_16 0x00
248 #define FIFOCC_RFW_32 0x10
249 #define FIFOCC_RFW_64 0x20
250 #define FIFOCC_RFW_XX 0x30
251 #define FIFOCC_XFWU 0x08
252 #define FIFOCC_RFWU 0x04
253 #define FIFOCC_XBRST 0x02
254 #define FIFOCC_RBRST 0x01
255
256
257 /* ir */
258 #define IR_JAB 0x80
259 #define IR_BABL 0x40
260 #define IR_CERR 0x20
261 #define IR_RCVCCO 0x10
262 #define IR_RNTPCO 0x08
263 #define IR_MPCO 0x04
264 #define IR_RCVINT 0x02
265 #define IR_XMTINT 0x01
266
267 /* imr */
268 #define IMR_MJAB 0x80
269 #define IMR_MBABL 0x40
270 #define IMR_MCERR 0x20
271 #define IMR_MRCVCCO 0x10
272 #define IMR_MRNTPCO 0x08
273 #define IMR_MMPCO 0x04
274 #define IMR_MRCVINT 0x02
275 #define IMR_MXMTINT 0x01
276
277 /* pr */
278 #define PR_XMTSV 0x80
279 #define PR_TDTREQ 0x40
280 #define PR_RDTREQ 0x20
281
282 /* biucc */
283 #define BIUCC_BSWP 0x40
284 #define BIUCC_XMTSP04 0x00
285 #define BIUCC_XMTSP16 0x10
286 #define BIUCC_XMTSP64 0x20
287 #define BIUCC_XMTSP112 0x30
288 #define BIUCC_SWRST 0x01
289
290 /* fifocc */
291 #define FIFOCC_XMTFW08W 0x00
292 #define FIFOCC_XMTFW16W 0x40
293 #define FIFOCC_XMTFW32W 0x80
294
295 #define FIFOCC_RCVFW16 0x00
296 #define FIFOCC_RCVFW32 0x10
297 #define FIFOCC_RCVFW64 0x20
298
299 #define FIFOCC_XMTFWU 0x08
300 #define FIFOCC_RCVFWU 0x04
301 #define FIFOCC_XMTBRST 0x02
302 #define FIFOCC_RCVBRST 0x01
303
304 /* maccc */
305 #define MACCC_PROM 0x80
306 #define MACCC_DXMT2PD 0x40
307 #define MACCC_EMBA 0x20
308 #define MACCC_DRCVPA 0x08
309 #define MACCC_DRCVBC 0x04
310 #define MACCC_ENXMT 0x02
311 #define MACCC_ENRCV 0x01
312
313 /* plscc */
314 #define PLSCC_XMTSEL 0x08
315 #define PLSCC_AUI 0x00
316 #define PLSCC_TENBASE 0x02
317 #define PLSCC_DAI 0x04
318 #define PLSCC_GPSI 0x06
319 #define PLSCC_ENPLSIO 0x01
320
321 /* phycc */
322 #define PHYCC_LNKFL 0x80
323 #define PHYCC_DLNKTST 0x40
324 #define PHYCC_REVPOL 0x20
325 #define PHYCC_DAPC 0x10
326 #define PHYCC_LRT 0x08
327 #define PHYCC_ASEL 0x04
328 #define PHYCC_RWAKE 0x02
329 #define PHYCC_AWAKE 0x01
330
331 /* iac */
332 #define IAC_ADDRCHG 0x80
333 #define IAC_PHYADDR 0x04
334 #define IAC_LOGADDR 0x02
335
336 /* utr */
337 #define UTR_RTRE 0x80
338 #define UTR_RTRD 0x40
339 #define UTR_RPA 0x20
340 #define UTR_FCOLL 0x10
341 #define UTR_RCVFCSE 0x08
342
343 #define UTR_NOLOOP 0x00
344 #define UTR_EXTLOOP 0x02
345 #define UTR_INLOOP 0x04
346 #define UTR_INLOOP_M 0x06
347
348 #define ENET_PHYADDR_LEN 6
349 #define ENET_HEADER 14
350
351 #define BFRSIZ 2048
352 #define ETHER_ADD_SIZE 6 /* size of a MAC address */
353 #define DSF_LOCK 1
354 #define DSF_RUNNING 2
355 #define MOD_ENAL 1
356 #define MOD_PROM 2
357
358 /*
359 * MACE Chip revision codes
360 */
361 #define MACERevA2 0x0941
362 #define MACERevB0 0x0940
363
364 #ifdef KERNEL
365 int mace_delmulti __P((register struct ifreq *, register struct arpcom *,
366 struct ether_addr *));
367 int mace_addmulti __P((register struct ifreq *, register struct arpcom *));
368 void mace_sync_mcast __P((register struct ifnet *));
369 void mace_sync_promisc __P((register struct ifnet *));
370 #endif /* KERNEL */
371