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