am7990reg.h revision 155093
1155093Smarius/*	$NetBSD: am7990reg.h,v 1.11 2005/12/11 12:21:25 christos Exp $	*/
2155093Smarius
3155093Smarius/*-
4155093Smarius * Copyright (c) 1998 The NetBSD Foundation, Inc.
5155093Smarius * All rights reserved.
6155093Smarius *
7155093Smarius * This code is derived from software contributed to The NetBSD Foundation
8155093Smarius * by Charles M. Hannum.
9155093Smarius *
10155093Smarius * Redistribution and use in source and binary forms, with or without
11155093Smarius * modification, are permitted provided that the following conditions
12155093Smarius * are met:
13155093Smarius * 1. Redistributions of source code must retain the above copyright
14155093Smarius *    notice, this list of conditions and the following disclaimer.
15155093Smarius * 2. Redistributions in binary form must reproduce the above copyright
16155093Smarius *    notice, this list of conditions and the following disclaimer in the
17155093Smarius *    documentation and/or other materials provided with the distribution.
18155093Smarius * 3. All advertising materials mentioning features or use of this software
19155093Smarius *    must display the following acknowledgement:
20155093Smarius *        This product includes software developed by the NetBSD
21155093Smarius *        Foundation, Inc. and its contributors.
22155093Smarius * 4. Neither the name of The NetBSD Foundation nor the names of its
23155093Smarius *    contributors may be used to endorse or promote products derived
24155093Smarius *    from this software without specific prior written permission.
25155093Smarius *
26155093Smarius * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27155093Smarius * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28155093Smarius * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29155093Smarius * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30155093Smarius * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31155093Smarius * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32155093Smarius * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33155093Smarius * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34155093Smarius * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35155093Smarius * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36155093Smarius * POSSIBILITY OF SUCH DAMAGE.
37155093Smarius */
38155093Smarius
39155093Smarius/*-
40155093Smarius * Copyright (c) 1992, 1993
41155093Smarius *	The Regents of the University of California.  All rights reserved.
42155093Smarius *
43155093Smarius * This code is derived from software contributed to Berkeley by
44155093Smarius * Ralph Campbell and Rick Macklem.
45155093Smarius *
46155093Smarius * Redistribution and use in source and binary forms, with or without
47155093Smarius * modification, are permitted provided that the following conditions
48155093Smarius * are met:
49155093Smarius * 1. Redistributions of source code must retain the above copyright
50155093Smarius *    notice, this list of conditions and the following disclaimer.
51155093Smarius * 2. Redistributions in binary form must reproduce the above copyright
52155093Smarius *    notice, this list of conditions and the following disclaimer in the
53155093Smarius *    documentation and/or other materials provided with the distribution.
54155093Smarius * 3. Neither the name of the University nor the names of its contributors
55155093Smarius *    may be used to endorse or promote products derived from this software
56155093Smarius *    without specific prior written permission.
57155093Smarius *
58155093Smarius * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
59155093Smarius * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60155093Smarius * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
61155093Smarius * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62155093Smarius * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63155093Smarius * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64155093Smarius * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65155093Smarius * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66155093Smarius * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67155093Smarius * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68155093Smarius * SUCH DAMAGE.
69155093Smarius *
70155093Smarius *	@(#)if_lereg.h	8.1 (Berkeley) 6/10/93
71155093Smarius */
72155093Smarius
73155093Smarius/* $FreeBSD: head/sys/dev/le/am7990reg.h 155093 2006-01-31 14:48:58Z marius $ */
74155093Smarius
75155093Smarius#ifndef _DEV_LE_AM7990REG_H_
76155093Smarius#define	_DEV_LE_AM7990REG_H_
77155093Smarius
78155093Smarius/*
79155093Smarius * Receive message descriptor
80155093Smarius */
81155093Smariusstruct lermd {
82155093Smarius	uint16_t rmd0;
83155093Smarius#if BYTE_ORDER == BIG_ENDIAN
84155093Smarius	uint8_t  rmd1_bits;
85155093Smarius	uint8_t  rmd1_hadr;
86155093Smarius#else
87155093Smarius	uint8_t  rmd1_hadr;
88155093Smarius	uint8_t  rmd1_bits;
89155093Smarius#endif
90155093Smarius	int16_t	 rmd2;
91155093Smarius	uint16_t rmd3;
92155093Smarius} __packed;
93155093Smarius
94155093Smarius/*
95155093Smarius * Transmit message descriptor
96155093Smarius */
97155093Smariusstruct letmd {
98155093Smarius	uint16_t tmd0;
99155093Smarius#if BYTE_ORDER == BIG_ENDIAN
100155093Smarius	uint8_t  tmd1_bits;
101155093Smarius	uint8_t  tmd1_hadr;
102155093Smarius#else
103155093Smarius	uint8_t  tmd1_hadr;
104155093Smarius	uint8_t  tmd1_bits;
105155093Smarius#endif
106155093Smarius	int16_t	 tmd2;
107155093Smarius	uint16_t tmd3;
108155093Smarius} __packed;
109155093Smarius
110155093Smarius/*
111155093Smarius * Initialization block
112155093Smarius */
113155093Smariusstruct leinit {
114155093Smarius	uint16_t init_mode;		/* +0x0000 */
115155093Smarius	uint16_t init_padr[3];		/* +0x0002 */
116155093Smarius	uint16_t init_ladrf[4];		/* +0x0008 */
117155093Smarius	uint16_t init_rdra;		/* +0x0010 */
118155093Smarius	uint16_t init_rlen;		/* +0x0012 */
119155093Smarius	uint16_t init_tdra;		/* +0x0014 */
120155093Smarius	uint16_t init_tlen;		/* +0x0016 */
121155093Smarius	int16_t	 pad0[4];		/* Pad to 16 shorts. */
122155093Smarius} __packed;
123155093Smarius
124155093Smarius/* Receive message descriptor 1 (rmd1_bits) */
125155093Smarius#define	LE_R1_OWN	0x80		/* LANCE owns the packet */
126155093Smarius#define	LE_R1_ERR	0x40		/* error summary */
127155093Smarius#define	LE_R1_FRAM	0x20		/* framing error */
128155093Smarius#define	LE_R1_OFLO	0x10		/* overflow error */
129155093Smarius#define	LE_R1_CRC	0x08		/* CRC error */
130155093Smarius#define	LE_R1_BUFF	0x04		/* buffer error */
131155093Smarius#define	LE_R1_STP	0x02		/* start of packet */
132155093Smarius#define	LE_R1_ENP	0x01		/* end of packet */
133155093Smarius
134155093Smarius#define	LE_R1_BITS \
135155093Smarius    "\20\10OWN\7ERR\6FRAM\5OFLO\4CRC\3BUFF\2STP\1ENP"
136155093Smarius
137155093Smarius/* Transmit message descriptor 1 (tmd1_bits) */
138155093Smarius#define	LE_T1_OWN	0x80		/* LANCE owns the packet */
139155093Smarius#define	LE_T1_ERR	0x40		/* error summary */
140155093Smarius#define	LE_T1_MORE	0x10		/* multiple collisions */
141155093Smarius#define	LE_T1_ONE	0x08		/* single collision */
142155093Smarius#define	LE_T1_DEF	0x04		/* deferred transmit */
143155093Smarius#define	LE_T1_STP	0x02		/* start of packet */
144155093Smarius#define	LE_T1_ENP	0x01		/* end of packet */
145155093Smarius
146155093Smarius#define	LE_T1_BITS \
147155093Smarius    "\20\10OWN\7ERR\6RES\5MORE\4ONE\3DEF\2STP\1ENP"
148155093Smarius
149155093Smarius/* Transmit message descriptor 3 (tmd3) */
150155093Smarius#define	LE_T3_BUFF	0x8000		/* buffer error */
151155093Smarius#define	LE_T3_UFLO	0x4000		/* underflow error */
152155093Smarius#define	LE_T3_LCOL	0x1000		/* late collision */
153155093Smarius#define	LE_T3_LCAR	0x0800		/* loss of carrier */
154155093Smarius#define	LE_T3_RTRY	0x0400		/* retry error */
155155093Smarius#define	LE_T3_TDR_MASK	0x03ff		/* time domain reflectometry counter */
156155093Smarius
157155093Smarius#define	LE_XMD2_ONES	0xf000
158155093Smarius
159155093Smarius#define	LE_T3_BITS \
160155093Smarius    "\20\20BUFF\17UFLO\16RES\15LCOL\14LCAR\13RTRY"
161155093Smarius
162155093Smarius/*
163155093Smarius * PCnet-ISA defines which are not available on LANCE 7990.
164155093Smarius */
165155093Smarius
166155093Smarius/* (ISA) Bus Configuration Registers */
167155093Smarius#define	LE_BCR_MSRDA	0x0000
168155093Smarius#define	LE_BCR_MSWRA	0x0001
169155093Smarius#define	LE_BCR_MC	0x0002
170155093Smarius#define	LE_BCR_LED1	0x0005
171155093Smarius#define	LE_BCR_LED2	0x0006
172155093Smarius#define	LE_BCR_LED3	0x0007
173155093Smarius
174155093Smarius/* Bus configurations bits (MC) */
175155093Smarius#define	LE_MC_EADISEL	0x0008		/* EADI selection */
176155093Smarius#define	LE_MC_AWAKE	0x0004		/* auto-wake */
177155093Smarius#define	LE_MC_ASEL	0x0002		/* auto selection */
178155093Smarius#define	LE_MC_XMAUSEL	0x0001		/* external MAU selection */
179155093Smarius
180155093Smarius/* LED bis (LED[123]) */
181155093Smarius#define	LE_LED_LEDOUT	0x8000
182155093Smarius#define	LE_LED_PSE	0x0080
183155093Smarius#define	LE_LED_XMTE	0x0010
184155093Smarius#define	LE_LED_PVPE	0x0008
185155093Smarius#define	LE_LED_PCVE	0x0004
186155093Smarius#define	LE_LED_JABE	0x0002
187155093Smarius#define	LE_LED_COLE	0x0001
188155093Smarius
189155093Smarius#endif /* !_DEV_LE_AM7990REG_H_ */
190