xref: /openbsd-src/sys/dev/ic/am7990reg.h (revision 0ec3b04ce6c76de719551ca76f5cf8ca111dd7f4)
1*0ec3b04cSmiod /*	$OpenBSD: am7990reg.h,v 1.9 2013/09/24 20:10:57 miod Exp $	*/
2*0ec3b04cSmiod /*	$NetBSD: am7990reg.h,v 1.13 2008/04/28 20:23:49 martin Exp $	*/
3df930be7Sderaadt 
4df930be7Sderaadt /*-
5*0ec3b04cSmiod  * Copyright (c) 1998 The NetBSD Foundation, Inc.
6*0ec3b04cSmiod  * All rights reserved.
7*0ec3b04cSmiod  *
8*0ec3b04cSmiod  * This code is derived from software contributed to The NetBSD Foundation
9*0ec3b04cSmiod  * by Charles M. Hannum.
10*0ec3b04cSmiod  *
11*0ec3b04cSmiod  * Redistribution and use in source and binary forms, with or without
12*0ec3b04cSmiod  * modification, are permitted provided that the following conditions
13*0ec3b04cSmiod  * are met:
14*0ec3b04cSmiod  * 1. Redistributions of source code must retain the above copyright
15*0ec3b04cSmiod  *    notice, this list of conditions and the following disclaimer.
16*0ec3b04cSmiod  * 2. Redistributions in binary form must reproduce the above copyright
17*0ec3b04cSmiod  *    notice, this list of conditions and the following disclaimer in the
18*0ec3b04cSmiod  *    documentation and/or other materials provided with the distribution.
19*0ec3b04cSmiod  *
20*0ec3b04cSmiod  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21*0ec3b04cSmiod  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22*0ec3b04cSmiod  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23*0ec3b04cSmiod  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24*0ec3b04cSmiod  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25*0ec3b04cSmiod  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26*0ec3b04cSmiod  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27*0ec3b04cSmiod  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28*0ec3b04cSmiod  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29*0ec3b04cSmiod  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30*0ec3b04cSmiod  * POSSIBILITY OF SUCH DAMAGE.
31*0ec3b04cSmiod  */
32*0ec3b04cSmiod 
33*0ec3b04cSmiod /*-
34df930be7Sderaadt  * Copyright (c) 1992, 1993
35df930be7Sderaadt  *	The Regents of the University of California.  All rights reserved.
36df930be7Sderaadt  *
37df930be7Sderaadt  * This code is derived from software contributed to Berkeley by
38df930be7Sderaadt  * Ralph Campbell and Rick Macklem.
39df930be7Sderaadt  *
40df930be7Sderaadt  * Redistribution and use in source and binary forms, with or without
41df930be7Sderaadt  * modification, are permitted provided that the following conditions
42df930be7Sderaadt  * are met:
43df930be7Sderaadt  * 1. Redistributions of source code must retain the above copyright
44df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer.
45df930be7Sderaadt  * 2. Redistributions in binary form must reproduce the above copyright
46df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer in the
47df930be7Sderaadt  *    documentation and/or other materials provided with the distribution.
4829295d1cSmillert  * 3. Neither the name of the University nor the names of its contributors
49df930be7Sderaadt  *    may be used to endorse or promote products derived from this software
50df930be7Sderaadt  *    without specific prior written permission.
51df930be7Sderaadt  *
52df930be7Sderaadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53df930be7Sderaadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54df930be7Sderaadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55df930be7Sderaadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56df930be7Sderaadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57df930be7Sderaadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58df930be7Sderaadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59df930be7Sderaadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60df930be7Sderaadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61df930be7Sderaadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62df930be7Sderaadt  * SUCH DAMAGE.
63df930be7Sderaadt  *
64df930be7Sderaadt  *	@(#)if_lereg.h	8.1 (Berkeley) 6/10/93
65df930be7Sderaadt  */
66df930be7Sderaadt 
67dbd2dcc9Sjason /*
68df930be7Sderaadt  * Receive message descriptor
69df930be7Sderaadt  */
70df930be7Sderaadt struct lermd {
71df930be7Sderaadt 	u_int16_t rmd0;
72df930be7Sderaadt #if BYTE_ORDER == BIG_ENDIAN
73df930be7Sderaadt 	u_int8_t  rmd1_bits;
74df930be7Sderaadt 	u_int8_t  rmd1_hadr;
75df930be7Sderaadt #else
76df930be7Sderaadt 	u_int8_t  rmd1_hadr;
77df930be7Sderaadt 	u_int8_t  rmd1_bits;
78df930be7Sderaadt #endif
79df930be7Sderaadt 	int16_t	  rmd2;
80df930be7Sderaadt 	u_int16_t rmd3;
81*0ec3b04cSmiod } __packed;
82df930be7Sderaadt 
83df930be7Sderaadt /*
84df930be7Sderaadt  * Transmit message descriptor
85df930be7Sderaadt  */
86df930be7Sderaadt struct letmd {
87df930be7Sderaadt 	u_int16_t tmd0;
88df930be7Sderaadt #if BYTE_ORDER == BIG_ENDIAN
89df930be7Sderaadt 	u_int8_t  tmd1_bits;
90df930be7Sderaadt 	u_int8_t  tmd1_hadr;
91df930be7Sderaadt #else
92df930be7Sderaadt 	u_int8_t  tmd1_hadr;
93df930be7Sderaadt 	u_int8_t  tmd1_bits;
94df930be7Sderaadt #endif
95df930be7Sderaadt 	int16_t	  tmd2;
96df930be7Sderaadt 	u_int16_t tmd3;
97*0ec3b04cSmiod } __packed;
98df930be7Sderaadt 
99df930be7Sderaadt /*
100df930be7Sderaadt  * Initialization block
101df930be7Sderaadt  */
102df930be7Sderaadt struct leinit {
103df930be7Sderaadt 	u_int16_t init_mode;		/* +0x0000 */
104df930be7Sderaadt 	u_int16_t init_padr[3];		/* +0x0002 */
105df930be7Sderaadt 	u_int16_t init_ladrf[4];	/* +0x0008 */
106df930be7Sderaadt 	u_int16_t init_rdra;		/* +0x0010 */
107df930be7Sderaadt 	u_int16_t init_rlen;		/* +0x0012 */
108df930be7Sderaadt 	u_int16_t init_tdra;		/* +0x0014 */
109df930be7Sderaadt 	u_int16_t init_tlen;		/* +0x0016 */
110df930be7Sderaadt 	int16_t	  pad0[4];		/* Pad to 16 shorts */
111*0ec3b04cSmiod } __packed;
112df930be7Sderaadt 
113df930be7Sderaadt /* Receive message descriptor 1 (rmd1_bits) */
114df930be7Sderaadt #define	LE_R1_OWN	0x80		/* LANCE owns the packet */
115df930be7Sderaadt #define	LE_R1_ERR	0x40		/* error summary */
116df930be7Sderaadt #define	LE_R1_FRAM	0x20		/* framing error */
117df930be7Sderaadt #define	LE_R1_OFLO	0x10		/* overflow error */
118df930be7Sderaadt #define	LE_R1_CRC	0x08		/* CRC error */
119df930be7Sderaadt #define	LE_R1_BUFF	0x04		/* buffer error */
120df930be7Sderaadt #define	LE_R1_STP	0x02		/* start of packet */
121df930be7Sderaadt #define	LE_R1_ENP	0x01		/* end of packet */
122df930be7Sderaadt 
123df930be7Sderaadt #define	LE_R1_BITS \
124df930be7Sderaadt     "\20\10OWN\7ERR\6FRAM\5OFLO\4CRC\3BUFF\2STP\1ENP"
125df930be7Sderaadt 
126df930be7Sderaadt /* Transmit message descriptor 1 (tmd1_bits) */
127df930be7Sderaadt #define	LE_T1_OWN	0x80		/* LANCE owns the packet */
128df930be7Sderaadt #define	LE_T1_ERR	0x40		/* error summary */
129df930be7Sderaadt #define	LE_T1_MORE	0x10		/* multiple collisions */
130df930be7Sderaadt #define	LE_T1_ONE	0x08		/* single collision */
1312408ed96Sjmc #define	LE_T1_DEF	0x04		/* deferred transmit */
132df930be7Sderaadt #define	LE_T1_STP	0x02		/* start of packet */
133df930be7Sderaadt #define	LE_T1_ENP	0x01		/* end of packet */
134df930be7Sderaadt 
135df930be7Sderaadt #define	LE_T1_BITS \
136df930be7Sderaadt     "\20\10OWN\7ERR\6RES\5MORE\4ONE\3DEF\2STP\1ENP"
137df930be7Sderaadt 
138df930be7Sderaadt /* Transmit message descriptor 3 (tmd3) */
139df930be7Sderaadt #define	LE_T3_BUFF	0x8000		/* buffer error */
140df930be7Sderaadt #define	LE_T3_UFLO	0x4000		/* underflow error */
141df930be7Sderaadt #define	LE_T3_LCOL	0x1000		/* late collision */
142df930be7Sderaadt #define	LE_T3_LCAR	0x0800		/* loss of carrier */
143df930be7Sderaadt #define	LE_T3_RTRY	0x0400		/* retry error */
144df930be7Sderaadt #define	LE_T3_TDR_MASK	0x03ff		/* time domain reflectometry counter */
145df930be7Sderaadt 
146df930be7Sderaadt #define	LE_XMD2_ONES	0xf000
147df930be7Sderaadt 
148df930be7Sderaadt #define	LE_T3_BITS \
149df930be7Sderaadt     "\20\20BUFF\17UFLO\16RES\15LCOL\14LCAR\13RTRY"
150*0ec3b04cSmiod 
151*0ec3b04cSmiod /*
152*0ec3b04cSmiod  * PCnet-ISA defines which are not available on LANCE 7990
153*0ec3b04cSmiod  */
154*0ec3b04cSmiod 
155*0ec3b04cSmiod /* (ISA) Bus Configuration Registers */
156*0ec3b04cSmiod #define	LE_BCR_MSRDA	0x0000
157*0ec3b04cSmiod #define	LE_BCR_MSWRA	0x0001
158*0ec3b04cSmiod #define	LE_BCR_MC	0x0002
159*0ec3b04cSmiod #define	LE_BCR_LED1	0x0005
160*0ec3b04cSmiod #define	LE_BCR_LED2	0x0006
161*0ec3b04cSmiod #define	LE_BCR_LED3	0x0007
162*0ec3b04cSmiod 
163*0ec3b04cSmiod /* Bus configurations bits (MC) */
164*0ec3b04cSmiod #define	LE_MC_EADISEL	0x0008		/* EADI selection */
165*0ec3b04cSmiod #define	LE_MC_AWAKE	0x0004		/* auto-wake */
166*0ec3b04cSmiod #define	LE_MC_ASEL	0x0002		/* auto selection */
167*0ec3b04cSmiod #define	LE_MC_XMAUSEL	0x0001		/* external MAU selection */
168*0ec3b04cSmiod 
169*0ec3b04cSmiod /* LED bis (LED[123]) */
170*0ec3b04cSmiod #define	LE_LED_LEDOUT	0x8000
171*0ec3b04cSmiod #define	LE_LED_PSE	0x0080
172*0ec3b04cSmiod #define	LE_LED_XMTE	0x0010
173*0ec3b04cSmiod #define	LE_LED_PVPE	0x0008
174*0ec3b04cSmiod #define	LE_LED_PCVE	0x0004
175*0ec3b04cSmiod #define	LE_LED_JABE	0x0002
176*0ec3b04cSmiod #define	LE_LED_COLE	0x0001
177