]>
git.saurik.com Git - apple/xnu.git/blob - bsd/if/ppc/mace.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
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.
35 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
36 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37 * FOR A PARTICULAR PURPOSE.
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.
47 * Copyright 1996 1995 by Apple Computer, Inc. 1997 1996 1995 1994 1993 1992 1991
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.
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.
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.
70 * PMach Operating System
71 * Copyright (c) 1995 Santa Clara University
72 * All Rights Reserved.
75 * Mach Operating System
76 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
77 * All Rights Reserved.
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.
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.
89 * Carnegie Mellon requests users of this software to return to
91 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
92 * School of Computer Science
93 * Carnegie Mellon University
94 * Pittsburgh PA 15213-3890
96 * any improvements or extensions that they make and grant Carnegie Mellon
97 * the rights to redistribute these changes.
101 * Author: Philippe Bernadat
103 * Copyright (c) 1989 OSF Research Institute
105 * 3COM Etherlink 3C501 Mach Ethernet drvier
108 Copyright 1990 by Open Software Foundation,
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
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.
132 #include <sys/cdefs.h>
136 #define ENETPAD(n) char n[15]
140 volatile unsigned char rcvfifo
; /* 00 receive fifo */
142 volatile unsigned char xmtfifo
; /* 01 transmit fifo */
144 volatile unsigned char xmtfc
; /* 02 transmit frame control */
146 volatile unsigned char xmtfs
; /* 03 transmit frame status */
148 volatile unsigned char xmtrc
; /* 04 transmit retry count */
150 volatile unsigned char rcvfc
; /* 05 receive frame control -- 4 bytes */
152 volatile unsigned char rcvfs
; /* 06 receive frame status */
154 volatile unsigned char fifofc
; /* 07 fifo frame count */
156 volatile unsigned char ir
; /* 08 interrupt */
158 volatile unsigned char imr
; /* 09 interrupt mask */
160 volatile unsigned char pr
; /* 10 poll */
162 volatile unsigned char biucc
; /* 11 bus interface unit configuration control */
164 volatile unsigned char fifocc
; /* 12 fifo configuration control */
166 volatile unsigned char maccc
; /* 13 media access control configuration control */
168 volatile unsigned char plscc
; /* 14 physical layer signalling configuration control */
170 volatile unsigned char phycc
; /* 15 physical layer configuration control */
172 volatile unsigned char chipid1
; /* 16 chip identification LSB */
174 volatile unsigned char chipid2
; /* 17 chip identification MSB */
176 volatile unsigned char iac
; /* 18 internal address configuration */
178 volatile unsigned char res1
; /* 19 */
180 volatile unsigned char ladrf
; /* 20 logical address filter -- 8 bytes */
182 volatile unsigned char padr
; /* 21 physical address -- 6 bytes */
184 volatile unsigned char res2
; /* 22 */
186 volatile unsigned char res3
; /* 23 */
188 volatile unsigned char mpc
; /* 24 missed packet count */
190 volatile unsigned char res4
; /* 25 */
192 volatile unsigned char rntpc
; /* 26 runt packet count */
194 volatile unsigned char rcvcc
; /* 27 receive collision count */
196 volatile unsigned char res5
; /* 28 */
198 volatile unsigned char utr
; /* 29 user test */
200 volatile unsigned char res6
; /* 30 */
202 volatile unsigned char res7
; /* 31 */
209 #define MACE_REVISION_B0 0x0940
210 #define MACE_REVISION_A2 0x0941
213 #define XMTFC_DRTRY 0X80
214 #define XMTFC_DXMTFCS 0x08
215 #define XMTFC_APADXNT 0x01
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
228 #define XMTRC_EXDEF 0x80
231 #define RCVFC_LLRCV 0x08
232 #define RCVFC_M_R 0x04
233 #define RCVFC_ASTRPRCV 0x01
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
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
261 #define IR_RCVCCO 0x10
262 #define IR_RNTPCO 0x08
264 #define IR_RCVINT 0x02
265 #define IR_XMTINT 0x01
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
278 #define PR_XMTSV 0x80
279 #define PR_TDTREQ 0x40
280 #define PR_RDTREQ 0x20
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
291 #define FIFOCC_XMTFW08W 0x00
292 #define FIFOCC_XMTFW16W 0x40
293 #define FIFOCC_XMTFW32W 0x80
295 #define FIFOCC_RCVFW16 0x00
296 #define FIFOCC_RCVFW32 0x10
297 #define FIFOCC_RCVFW64 0x20
299 #define FIFOCC_XMTFWU 0x08
300 #define FIFOCC_RCVFWU 0x04
301 #define FIFOCC_XMTBRST 0x02
302 #define FIFOCC_RCVBRST 0x01
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
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
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
332 #define IAC_ADDRCHG 0x80
333 #define IAC_PHYADDR 0x04
334 #define IAC_LOGADDR 0x02
337 #define UTR_RTRE 0x80
338 #define UTR_RTRD 0x40
340 #define UTR_FCOLL 0x10
341 #define UTR_RCVFCSE 0x08
343 #define UTR_NOLOOP 0x00
344 #define UTR_EXTLOOP 0x02
345 #define UTR_INLOOP 0x04
346 #define UTR_INLOOP_M 0x06
348 #define ENET_PHYADDR_LEN 6
349 #define ENET_HEADER 14
352 #define ETHER_ADD_SIZE 6 /* size of a MAC address */
354 #define DSF_RUNNING 2
359 * MACE Chip revision codes
361 #define MACERevA2 0x0941
362 #define MACERevB0 0x0940
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
*));