xref: /dflybsd-src/sys/dev/netif/lnc/am7990reg.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*	$NetBSD: am7990reg.h,v 1.11 2005/12/11 12:21:25 christos Exp $	*/
286d7f5d3SJohn Marino /*	$FreeBSD: src/sys/dev/le/am7990reg.h,v 1.1 2006/01/31 14:48:58 marius Exp $	*/
386d7f5d3SJohn Marino /*	$DragonFly: src/sys/dev/netif/lnc/am7990reg.h,v 1.1 2006/07/07 14:16:29 sephe Exp $	*/
486d7f5d3SJohn Marino 
586d7f5d3SJohn Marino 
686d7f5d3SJohn Marino /*-
786d7f5d3SJohn Marino  * Copyright (c) 1998 The NetBSD Foundation, Inc.
886d7f5d3SJohn Marino  * All rights reserved.
986d7f5d3SJohn Marino  *
1086d7f5d3SJohn Marino  * This code is derived from software contributed to The NetBSD Foundation
1186d7f5d3SJohn Marino  * by Charles M. Hannum.
1286d7f5d3SJohn Marino  *
1386d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
1486d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
1586d7f5d3SJohn Marino  * are met:
1686d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
1786d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
1886d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
1986d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
2086d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
2186d7f5d3SJohn Marino  * 3. All advertising materials mentioning features or use of this software
2286d7f5d3SJohn Marino  *    must display the following acknowledgement:
2386d7f5d3SJohn Marino  *        This product includes software developed by the NetBSD
2486d7f5d3SJohn Marino  *        Foundation, Inc. and its contributors.
2586d7f5d3SJohn Marino  * 4. Neither the name of The NetBSD Foundation nor the names of its
2686d7f5d3SJohn Marino  *    contributors may be used to endorse or promote products derived
2786d7f5d3SJohn Marino  *    from this software without specific prior written permission.
2886d7f5d3SJohn Marino  *
2986d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
3086d7f5d3SJohn Marino  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
3186d7f5d3SJohn Marino  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
3286d7f5d3SJohn Marino  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
3386d7f5d3SJohn Marino  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3486d7f5d3SJohn Marino  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3586d7f5d3SJohn Marino  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3686d7f5d3SJohn Marino  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3786d7f5d3SJohn Marino  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3886d7f5d3SJohn Marino  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3986d7f5d3SJohn Marino  * POSSIBILITY OF SUCH DAMAGE.
4086d7f5d3SJohn Marino  */
4186d7f5d3SJohn Marino 
4286d7f5d3SJohn Marino /*-
4386d7f5d3SJohn Marino  * Copyright (c) 1992, 1993
4486d7f5d3SJohn Marino  *	The Regents of the University of California.  All rights reserved.
4586d7f5d3SJohn Marino  *
4686d7f5d3SJohn Marino  * This code is derived from software contributed to Berkeley by
4786d7f5d3SJohn Marino  * Ralph Campbell and Rick Macklem.
4886d7f5d3SJohn Marino  *
4986d7f5d3SJohn Marino  * Redistribution and use in source and binary forms, with or without
5086d7f5d3SJohn Marino  * modification, are permitted provided that the following conditions
5186d7f5d3SJohn Marino  * are met:
5286d7f5d3SJohn Marino  * 1. Redistributions of source code must retain the above copyright
5386d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer.
5486d7f5d3SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
5586d7f5d3SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
5686d7f5d3SJohn Marino  *    documentation and/or other materials provided with the distribution.
5786d7f5d3SJohn Marino  * 3. Neither the name of the University nor the names of its contributors
5886d7f5d3SJohn Marino  *    may be used to endorse or promote products derived from this software
5986d7f5d3SJohn Marino  *    without specific prior written permission.
6086d7f5d3SJohn Marino  *
6186d7f5d3SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
6286d7f5d3SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
6386d7f5d3SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
6486d7f5d3SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
6586d7f5d3SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
6686d7f5d3SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
6786d7f5d3SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
6886d7f5d3SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
6986d7f5d3SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
7086d7f5d3SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
7186d7f5d3SJohn Marino  * SUCH DAMAGE.
7286d7f5d3SJohn Marino  *
7386d7f5d3SJohn Marino  *	@(#)if_lereg.h	8.1 (Berkeley) 6/10/93
7486d7f5d3SJohn Marino  */
7586d7f5d3SJohn Marino 
7686d7f5d3SJohn Marino #ifndef _DEV_LE_AM7990REG_H_
7786d7f5d3SJohn Marino #define	_DEV_LE_AM7990REG_H_
7886d7f5d3SJohn Marino 
7986d7f5d3SJohn Marino /*
8086d7f5d3SJohn Marino  * Receive message descriptor
8186d7f5d3SJohn Marino  */
8286d7f5d3SJohn Marino struct lermd {
8386d7f5d3SJohn Marino 	uint16_t rmd0;
8486d7f5d3SJohn Marino #if BYTE_ORDER == BIG_ENDIAN
8586d7f5d3SJohn Marino 	uint8_t  rmd1_bits;
8686d7f5d3SJohn Marino 	uint8_t  rmd1_hadr;
8786d7f5d3SJohn Marino #else
8886d7f5d3SJohn Marino 	uint8_t  rmd1_hadr;
8986d7f5d3SJohn Marino 	uint8_t  rmd1_bits;
9086d7f5d3SJohn Marino #endif
9186d7f5d3SJohn Marino 	int16_t	 rmd2;
9286d7f5d3SJohn Marino 	uint16_t rmd3;
9386d7f5d3SJohn Marino } __packed;
9486d7f5d3SJohn Marino 
9586d7f5d3SJohn Marino /*
9686d7f5d3SJohn Marino  * Transmit message descriptor
9786d7f5d3SJohn Marino  */
9886d7f5d3SJohn Marino struct letmd {
9986d7f5d3SJohn Marino 	uint16_t tmd0;
10086d7f5d3SJohn Marino #if BYTE_ORDER == BIG_ENDIAN
10186d7f5d3SJohn Marino 	uint8_t  tmd1_bits;
10286d7f5d3SJohn Marino 	uint8_t  tmd1_hadr;
10386d7f5d3SJohn Marino #else
10486d7f5d3SJohn Marino 	uint8_t  tmd1_hadr;
10586d7f5d3SJohn Marino 	uint8_t  tmd1_bits;
10686d7f5d3SJohn Marino #endif
10786d7f5d3SJohn Marino 	int16_t	 tmd2;
10886d7f5d3SJohn Marino 	uint16_t tmd3;
10986d7f5d3SJohn Marino } __packed;
11086d7f5d3SJohn Marino 
11186d7f5d3SJohn Marino /*
11286d7f5d3SJohn Marino  * Initialization block
11386d7f5d3SJohn Marino  */
11486d7f5d3SJohn Marino struct leinit {
11586d7f5d3SJohn Marino 	uint16_t init_mode;		/* +0x0000 */
11686d7f5d3SJohn Marino 	uint16_t init_padr[3];		/* +0x0002 */
11786d7f5d3SJohn Marino 	uint16_t init_ladrf[4];		/* +0x0008 */
11886d7f5d3SJohn Marino 	uint16_t init_rdra;		/* +0x0010 */
11986d7f5d3SJohn Marino 	uint16_t init_rlen;		/* +0x0012 */
12086d7f5d3SJohn Marino 	uint16_t init_tdra;		/* +0x0014 */
12186d7f5d3SJohn Marino 	uint16_t init_tlen;		/* +0x0016 */
12286d7f5d3SJohn Marino 	int16_t	 pad0[4];		/* Pad to 16 shorts. */
12386d7f5d3SJohn Marino } __packed;
12486d7f5d3SJohn Marino 
12586d7f5d3SJohn Marino /* Receive message descriptor 1 (rmd1_bits) */
12686d7f5d3SJohn Marino #define	LE_R1_OWN	0x80		/* LANCE owns the packet */
12786d7f5d3SJohn Marino #define	LE_R1_ERR	0x40		/* error summary */
12886d7f5d3SJohn Marino #define	LE_R1_FRAM	0x20		/* framing error */
12986d7f5d3SJohn Marino #define	LE_R1_OFLO	0x10		/* overflow error */
13086d7f5d3SJohn Marino #define	LE_R1_CRC	0x08		/* CRC error */
13186d7f5d3SJohn Marino #define	LE_R1_BUFF	0x04		/* buffer error */
13286d7f5d3SJohn Marino #define	LE_R1_STP	0x02		/* start of packet */
13386d7f5d3SJohn Marino #define	LE_R1_ENP	0x01		/* end of packet */
13486d7f5d3SJohn Marino 
13586d7f5d3SJohn Marino #define	LE_R1_BITS \
13686d7f5d3SJohn Marino     "\20\10OWN\7ERR\6FRAM\5OFLO\4CRC\3BUFF\2STP\1ENP"
13786d7f5d3SJohn Marino 
13886d7f5d3SJohn Marino /* Transmit message descriptor 1 (tmd1_bits) */
13986d7f5d3SJohn Marino #define	LE_T1_OWN	0x80		/* LANCE owns the packet */
14086d7f5d3SJohn Marino #define	LE_T1_ERR	0x40		/* error summary */
14186d7f5d3SJohn Marino #define	LE_T1_MORE	0x10		/* multiple collisions */
14286d7f5d3SJohn Marino #define	LE_T1_ONE	0x08		/* single collision */
14386d7f5d3SJohn Marino #define	LE_T1_DEF	0x04		/* deferred transmit */
14486d7f5d3SJohn Marino #define	LE_T1_STP	0x02		/* start of packet */
14586d7f5d3SJohn Marino #define	LE_T1_ENP	0x01		/* end of packet */
14686d7f5d3SJohn Marino 
14786d7f5d3SJohn Marino #define	LE_T1_BITS \
14886d7f5d3SJohn Marino     "\20\10OWN\7ERR\6RES\5MORE\4ONE\3DEF\2STP\1ENP"
14986d7f5d3SJohn Marino 
15086d7f5d3SJohn Marino /* Transmit message descriptor 3 (tmd3) */
15186d7f5d3SJohn Marino #define	LE_T3_BUFF	0x8000		/* buffer error */
15286d7f5d3SJohn Marino #define	LE_T3_UFLO	0x4000		/* underflow error */
15386d7f5d3SJohn Marino #define	LE_T3_LCOL	0x1000		/* late collision */
15486d7f5d3SJohn Marino #define	LE_T3_LCAR	0x0800		/* loss of carrier */
15586d7f5d3SJohn Marino #define	LE_T3_RTRY	0x0400		/* retry error */
15686d7f5d3SJohn Marino #define	LE_T3_TDR_MASK	0x03ff		/* time domain reflectometry counter */
15786d7f5d3SJohn Marino 
15886d7f5d3SJohn Marino #define	LE_XMD2_ONES	0xf000
15986d7f5d3SJohn Marino 
16086d7f5d3SJohn Marino #define	LE_T3_BITS \
16186d7f5d3SJohn Marino     "\20\20BUFF\17UFLO\16RES\15LCOL\14LCAR\13RTRY"
16286d7f5d3SJohn Marino 
16386d7f5d3SJohn Marino /*
16486d7f5d3SJohn Marino  * PCnet-ISA defines which are not available on LANCE 7990.
16586d7f5d3SJohn Marino  */
16686d7f5d3SJohn Marino 
16786d7f5d3SJohn Marino /* (ISA) Bus Configuration Registers */
16886d7f5d3SJohn Marino #define	LE_BCR_MSRDA	0x0000
16986d7f5d3SJohn Marino #define	LE_BCR_MSWRA	0x0001
17086d7f5d3SJohn Marino #define	LE_BCR_MC	0x0002
17186d7f5d3SJohn Marino #define	LE_BCR_LED1	0x0005
17286d7f5d3SJohn Marino #define	LE_BCR_LED2	0x0006
17386d7f5d3SJohn Marino #define	LE_BCR_LED3	0x0007
17486d7f5d3SJohn Marino 
17586d7f5d3SJohn Marino /* Bus configurations bits (MC) */
17686d7f5d3SJohn Marino #define	LE_MC_EADISEL	0x0008		/* EADI selection */
17786d7f5d3SJohn Marino #define	LE_MC_AWAKE	0x0004		/* auto-wake */
17886d7f5d3SJohn Marino #define	LE_MC_ASEL	0x0002		/* auto selection */
17986d7f5d3SJohn Marino #define	LE_MC_XMAUSEL	0x0001		/* external MAU selection */
18086d7f5d3SJohn Marino 
18186d7f5d3SJohn Marino /* LED bis (LED[123]) */
18286d7f5d3SJohn Marino #define	LE_LED_LEDOUT	0x8000
18386d7f5d3SJohn Marino #define	LE_LED_PSE	0x0080
18486d7f5d3SJohn Marino #define	LE_LED_XMTE	0x0010
18586d7f5d3SJohn Marino #define	LE_LED_PVPE	0x0008
18686d7f5d3SJohn Marino #define	LE_LED_PCVE	0x0004
18786d7f5d3SJohn Marino #define	LE_LED_JABE	0x0002
18886d7f5d3SJohn Marino #define	LE_LED_COLE	0x0001
18986d7f5d3SJohn Marino 
19086d7f5d3SJohn Marino #endif /* !_DEV_LE_AM7990REG_H_ */
191