Home | History | Annotate | Line # | Download | only in ic
lancereg.h revision 1.2
      1  1.2   mycroft /*	$NetBSD: lancereg.h,v 1.2 1998/08/15 10:18:14 mycroft Exp $	*/
      2  1.2   mycroft 
      3  1.2   mycroft /*-
      4  1.2   mycroft  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  1.2   mycroft  * All rights reserved.
      6  1.2   mycroft  *
      7  1.2   mycroft  * This code is derived from software contributed to The NetBSD Foundation
      8  1.2   mycroft  * by Charles M. Hannum.
      9  1.2   mycroft  *
     10  1.2   mycroft  * Redistribution and use in source and binary forms, with or without
     11  1.2   mycroft  * modification, are permitted provided that the following conditions
     12  1.2   mycroft  * are met:
     13  1.2   mycroft  * 1. Redistributions of source code must retain the above copyright
     14  1.2   mycroft  *    notice, this list of conditions and the following disclaimer.
     15  1.2   mycroft  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.2   mycroft  *    notice, this list of conditions and the following disclaimer in the
     17  1.2   mycroft  *    documentation and/or other materials provided with the distribution.
     18  1.2   mycroft  * 3. All advertising materials mentioning features or use of this software
     19  1.2   mycroft  *    must display the following acknowledgement:
     20  1.2   mycroft  *        This product includes software developed by the NetBSD
     21  1.2   mycroft  *        Foundation, Inc. and its contributors.
     22  1.2   mycroft  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.2   mycroft  *    contributors may be used to endorse or promote products derived
     24  1.2   mycroft  *    from this software without specific prior written permission.
     25  1.2   mycroft  *
     26  1.2   mycroft  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.2   mycroft  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.2   mycroft  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.2   mycroft  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.2   mycroft  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.2   mycroft  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.2   mycroft  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.2   mycroft  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.2   mycroft  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.2   mycroft  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.2   mycroft  * POSSIBILITY OF SUCH DAMAGE.
     37  1.2   mycroft  */
     38  1.1  drochner 
     39  1.1  drochner /*-
     40  1.1  drochner  * Copyright (c) 1992, 1993
     41  1.1  drochner  *	The Regents of the University of California.  All rights reserved.
     42  1.1  drochner  *
     43  1.1  drochner  * This code is derived from software contributed to Berkeley by
     44  1.1  drochner  * Ralph Campbell and Rick Macklem.
     45  1.1  drochner  *
     46  1.1  drochner  * Redistribution and use in source and binary forms, with or without
     47  1.1  drochner  * modification, are permitted provided that the following conditions
     48  1.1  drochner  * are met:
     49  1.1  drochner  * 1. Redistributions of source code must retain the above copyright
     50  1.1  drochner  *    notice, this list of conditions and the following disclaimer.
     51  1.1  drochner  * 2. Redistributions in binary form must reproduce the above copyright
     52  1.1  drochner  *    notice, this list of conditions and the following disclaimer in the
     53  1.1  drochner  *    documentation and/or other materials provided with the distribution.
     54  1.1  drochner  * 3. All advertising materials mentioning features or use of this software
     55  1.1  drochner  *    must display the following acknowledgement:
     56  1.1  drochner  *	This product includes software developed by the University of
     57  1.1  drochner  *	California, Berkeley and its contributors.
     58  1.1  drochner  * 4. Neither the name of the University nor the names of its contributors
     59  1.1  drochner  *    may be used to endorse or promote products derived from this software
     60  1.1  drochner  *    without specific prior written permission.
     61  1.1  drochner  *
     62  1.1  drochner  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     63  1.1  drochner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     64  1.1  drochner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     65  1.1  drochner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     66  1.1  drochner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     67  1.1  drochner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     68  1.1  drochner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     69  1.1  drochner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     70  1.1  drochner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     71  1.1  drochner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     72  1.1  drochner  * SUCH DAMAGE.
     73  1.1  drochner  *
     74  1.1  drochner  *	@(#)if_lereg.h	8.1 (Berkeley) 6/10/93
     75  1.1  drochner  */
     76  1.1  drochner 
     77  1.1  drochner #define	LEBLEN		1536	/* ETHERMTU + header + CRC */
     78  1.1  drochner #define	LEMINSIZE	60	/* should be 64 if mode DTCR is set */
     79  1.1  drochner 
     80  1.1  drochner #define	LE_INITADDR(sc)		(sc->sc_initaddr)
     81  1.1  drochner #define	LE_RMDADDR(sc, bix)	(sc->sc_rmdaddr + sizeof(struct lermd) * (bix))
     82  1.1  drochner #define	LE_TMDADDR(sc, bix)	(sc->sc_tmdaddr + sizeof(struct letmd) * (bix))
     83  1.1  drochner #define	LE_RBUFADDR(sc, bix)	(sc->sc_rbufaddr[bix])
     84  1.1  drochner #define	LE_TBUFADDR(sc, bix)	(sc->sc_tbufaddr[bix])
     85  1.1  drochner 
     86  1.1  drochner /* register addresses */
     87  1.1  drochner #define	LE_CSR0		0x0000		/* Control and status register */
     88  1.1  drochner #define	LE_CSR1		0x0001		/* low address of init block */
     89  1.1  drochner #define	LE_CSR2		0x0002		/* high address of init block */
     90  1.1  drochner #define	LE_CSR3		0x0003		/* Bus master and control */
     91  1.1  drochner 
     92  1.1  drochner /* Control and status register 0 (csr0) */
     93  1.1  drochner #define	LE_C0_ERR	0x8000		/* error summary */
     94  1.1  drochner #define	LE_C0_BABL	0x4000		/* transmitter timeout error */
     95  1.1  drochner #define	LE_C0_CERR	0x2000		/* collision */
     96  1.1  drochner #define	LE_C0_MISS	0x1000		/* missed a packet */
     97  1.1  drochner #define	LE_C0_MERR	0x0800		/* memory error */
     98  1.1  drochner #define	LE_C0_RINT	0x0400		/* receiver interrupt */
     99  1.1  drochner #define	LE_C0_TINT	0x0200		/* transmitter interrupt */
    100  1.1  drochner #define	LE_C0_IDON	0x0100		/* initalization done */
    101  1.1  drochner #define	LE_C0_INTR	0x0080		/* interrupt condition */
    102  1.1  drochner #define	LE_C0_INEA	0x0040		/* interrupt enable */
    103  1.1  drochner #define	LE_C0_RXON	0x0020		/* receiver on */
    104  1.1  drochner #define	LE_C0_TXON	0x0010		/* transmitter on */
    105  1.1  drochner #define	LE_C0_TDMD	0x0008		/* transmit demand */
    106  1.1  drochner #define	LE_C0_STOP	0x0004		/* disable all external activity */
    107  1.1  drochner #define	LE_C0_STRT	0x0002		/* enable external activity */
    108  1.1  drochner #define	LE_C0_INIT	0x0001		/* begin initalization */
    109  1.1  drochner 
    110  1.1  drochner #define	LE_C0_BITS \
    111  1.1  drochner     "\20\20ERR\17BABL\16CERR\15MISS\14MERR\13RINT\
    112  1.1  drochner \12TINT\11IDON\10INTR\07INEA\06RXON\05TXON\04TDMD\03STOP\02STRT\01INIT"
    113  1.1  drochner 
    114  1.1  drochner /* Control and status register 3 (csr3) */
    115  1.1  drochner #define	LE_C3_BSWP	0x0004		/* byte swap */
    116  1.1  drochner #define	LE_C3_ACON	0x0002		/* ALE control, eh? */
    117  1.1  drochner #define	LE_C3_BCON	0x0001		/* byte control */
    118  1.1  drochner 
    119  1.1  drochner /* Initialzation block (mode) */
    120  1.1  drochner #define	LE_MODE_PROM	0x8000		/* promiscuous mode */
    121  1.1  drochner /*			0x7f80		   reserved, must be zero */
    122  1.1  drochner /* 0x4000 - 0x0080 are not available on LANCE 7990 */
    123  1.1  drochner #define	LE_MODE_DRCVBC	0x4000		/* disable receive brodcast */
    124  1.1  drochner #define	LE_MODE_DRCVPA	0x2000		/* disable physical address detection */
    125  1.1  drochner #define	LE_MODE_DLNKTST	0x1000		/* disable link status */
    126  1.1  drochner #define	LE_MODE_DAPC	0x0800		/* disable automatic polarity correction */
    127  1.1  drochner #define	LE_MODE_MENDECL	0x0400		/* MENDEC loopback mode */
    128  1.1  drochner #define	LE_MODE_LRTTSEL	0x0200		/* lower receice threshold /
    129  1.1  drochner 					   transmit mode selection */
    130  1.1  drochner #define	LE_MODE_PSEL1	0x0100		/* port selection bit1 */
    131  1.1  drochner #define	LE_MODE_PSEL0	0x0080		/* port selection bit0 */
    132  1.1  drochner #define	LE_MODE_INTL	0x0040		/* internal loopback */
    133  1.1  drochner #define	LE_MODE_DRTY	0x0020		/* disable retry */
    134  1.1  drochner #define	LE_MODE_COLL	0x0010		/* force a collision */
    135  1.1  drochner #define	LE_MODE_DTCR	0x0008		/* disable transmit CRC */
    136  1.1  drochner #define	LE_MODE_LOOP	0x0004		/* loopback mode */
    137  1.1  drochner #define	LE_MODE_DTX	0x0002		/* disable transmitter */
    138  1.1  drochner #define	LE_MODE_DRX	0x0001		/* disable receiver */
    139  1.1  drochner #define	LE_MODE_NORMAL	0		/* none of the above */
    140