xref: /dflybsd-src/sys/dev/netif/lnc/am79900reg.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /*	$NetBSD: am79900reg.h,v 1.8 2005/12/11 12:21:25 christos Exp $	*/
286d7f5d3SJohn Marino /*	$FreeBSD: src/sys/dev/le/am79900reg.h,v 1.1 2006/01/31 14:48:58 marius Exp $	*/
386d7f5d3SJohn Marino /*	$DragonFly: src/sys/dev/netif/lnc/am79900reg.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_AM79900REG_H_
7786d7f5d3SJohn Marino #define	_DEV_LE_AM79900REG_H_
7886d7f5d3SJohn Marino 
7986d7f5d3SJohn Marino /*
8086d7f5d3SJohn Marino  * Receive message descriptor
8186d7f5d3SJohn Marino  */
8286d7f5d3SJohn Marino struct lermd {
8386d7f5d3SJohn Marino 	uint32_t	rmd0;
8486d7f5d3SJohn Marino 	uint32_t	rmd1;
8586d7f5d3SJohn Marino 	uint32_t	rmd2;
8686d7f5d3SJohn Marino 	int32_t		rmd3;
8786d7f5d3SJohn Marino };
8886d7f5d3SJohn Marino 
8986d7f5d3SJohn Marino /*
9086d7f5d3SJohn Marino  * Transmit message descriptor
9186d7f5d3SJohn Marino  */
9286d7f5d3SJohn Marino struct letmd {
9386d7f5d3SJohn Marino 	uint32_t	tmd0;
9486d7f5d3SJohn Marino 	uint32_t	tmd1;
9586d7f5d3SJohn Marino 	uint32_t	tmd2;
9686d7f5d3SJohn Marino 	int32_t		tmd3;
9786d7f5d3SJohn Marino };
9886d7f5d3SJohn Marino 
9986d7f5d3SJohn Marino /*
10086d7f5d3SJohn Marino  * Initialization block
10186d7f5d3SJohn Marino  */
10286d7f5d3SJohn Marino struct leinit {
10386d7f5d3SJohn Marino 	uint32_t	init_mode;	/* +0x0000 */
10486d7f5d3SJohn Marino 	uint32_t	init_padr[2];	/* +0x0002 */
10586d7f5d3SJohn Marino 	uint16_t	init_ladrf[4];	/* +0x0008 */
10686d7f5d3SJohn Marino 	uint32_t	init_rdra;	/* +0x0010 */
10786d7f5d3SJohn Marino 	uint32_t	init_tdra;	/* +0x0014 */
10886d7f5d3SJohn Marino 	int32_t	 	pad;		/* Pad to 8 ints. */
10986d7f5d3SJohn Marino };
11086d7f5d3SJohn Marino 
11186d7f5d3SJohn Marino /* Receive message descriptor 1 (rmd1_bits) */
11286d7f5d3SJohn Marino #define	LE_R1_OWN	(1U << 31)	/* LANCE owns the packet */
11386d7f5d3SJohn Marino #define	LE_R1_ERR	(1U << 30)	/* error summary */
11486d7f5d3SJohn Marino #define	LE_R1_FRAM	(1U << 29)	/* framing error */
11586d7f5d3SJohn Marino #define	LE_R1_OFLO	(1U << 28)	/* overflow error */
11686d7f5d3SJohn Marino #define	LE_R1_CRC	(1U << 27)	/* CRC error */
11786d7f5d3SJohn Marino #define	LE_R1_BUFF	(1U << 26)	/* buffer error */
11886d7f5d3SJohn Marino #define	LE_R1_STP	(1U << 25)	/* start of packet */
11986d7f5d3SJohn Marino #define	LE_R1_ENP	(1U << 24)	/* end of packet */
12086d7f5d3SJohn Marino #define	LE_R1_ONES	(0xfU << 12)	/* must be ones */
12186d7f5d3SJohn Marino #define	LE_R1_BCNT_MASK	(0xfff)		/* byte count mask */
12286d7f5d3SJohn Marino 
12386d7f5d3SJohn Marino #define	LE_R1_BITS \
12486d7f5d3SJohn Marino     "\20\40OWN\37ERR\36FRAM\35OFLO\34CRC\33BUFF\32STP\31ENP"
12586d7f5d3SJohn Marino 
12686d7f5d3SJohn Marino /* Transmit message descriptor 1 (tmd1_bits) */
12786d7f5d3SJohn Marino #define	LE_T1_OWN	(1U << 31)	/* LANCE owns the packet */
12886d7f5d3SJohn Marino #define	LE_T1_ERR	(1U << 30)	/* error summary */
12986d7f5d3SJohn Marino #define	LE_T1_ADD_FCS	(1U << 29)	/* add FCS (PCnet-PCI) */
13086d7f5d3SJohn Marino #define	LE_T1_NO_FCS	(1U << 29)	/* no FCS (ILACC) */
13186d7f5d3SJohn Marino #define	LE_T1_MORE	(1U << 28)	/* multiple collisions */
13286d7f5d3SJohn Marino #define	LE_T1_LTINT	(1U << 28)	/* transmit interrupt (if LTINTEN) */
13386d7f5d3SJohn Marino #define	LE_T1_ONE	(1U << 27)	/* single collision */
13486d7f5d3SJohn Marino #define	LE_T1_DEF	(1U << 26)	/* deferred transmit */
13586d7f5d3SJohn Marino #define	LE_T1_STP	(1U << 25)	/* start of packet */
13686d7f5d3SJohn Marino #define	LE_T1_ENP	(1U << 24)	/* end of packet */
13786d7f5d3SJohn Marino #define	LE_T1_ONES	(0xfU << 12)	/* must be ones */
13886d7f5d3SJohn Marino #define	LE_T1_BCNT_MASK	(0xfff)		/* byte count mask */
13986d7f5d3SJohn Marino 
14086d7f5d3SJohn Marino #define	LE_T1_BITS \
14186d7f5d3SJohn Marino     "\20\40OWN\37ERR\36RES\35MORE\34ONE\33DEF\32STP\31ENP"
14286d7f5d3SJohn Marino 
14386d7f5d3SJohn Marino /* Transmit message descriptor 3 (tmd3) */
14486d7f5d3SJohn Marino #define	LE_T2_BUFF	(1U << 31)	/* buffer error */
14586d7f5d3SJohn Marino #define	LE_T2_UFLO	(1U << 30)	/* underflow error */
14686d7f5d3SJohn Marino #define	LE_T2_EXDEF	(1U << 29)	/* excessive defferral */
14786d7f5d3SJohn Marino #define	LE_T2_LCOL	(1U << 28)	/* late collision */
14886d7f5d3SJohn Marino #define	LE_T2_LCAR	(1U << 27)	/* loss of carrier */
14986d7f5d3SJohn Marino #define	LE_T2_RTRY	(1U << 26)	/* retry error */
15086d7f5d3SJohn Marino #if 0
15186d7f5d3SJohn Marino #define	LE_T3_TDR_MASK	0x03ff		/* time domain reflectometry counter */
15286d7f5d3SJohn Marino #endif
15386d7f5d3SJohn Marino 
15486d7f5d3SJohn Marino #define	LE_T3_BITS \
15586d7f5d3SJohn Marino     "\12\40BUFF\37UFLO\35LCOL\34LCAR\33RTRY"
15686d7f5d3SJohn Marino 
15786d7f5d3SJohn Marino #endif /* !_DEV_LE_AM7990REG_H_ */
158