Annotation of sys/arch/hp300/stand/include/if_lereg.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: if_lereg.h,v 1.3 2006/08/17 06:31:10 miod Exp $ */
! 2: /* $NetBSD: if_lereg.h,v 1.1 1996/01/01 18:10:56 thorpej Exp $ */
! 3:
! 4: /*
! 5: * Copyright (c) 1982, 1990 The Regents of the University of California.
! 6: * All rights reserved.
! 7: *
! 8: * Redistribution and use in source and binary forms, with or without
! 9: * modification, are permitted provided that the following conditions
! 10: * are met:
! 11: * 1. Redistributions of source code must retain the above copyright
! 12: * notice, this list of conditions and the following disclaimer.
! 13: * 2. Redistributions in binary form must reproduce the above copyright
! 14: * notice, this list of conditions and the following disclaimer in the
! 15: * documentation and/or other materials provided with the distribution.
! 16: * 3. Neither the name of the University nor the names of its contributors
! 17: * may be used to endorse or promote products derived from this software
! 18: * without specific prior written permission.
! 19: *
! 20: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 21: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 22: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 23: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 24: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 25: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 26: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 27: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 28: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 29: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 30: * SUCH DAMAGE.
! 31: *
! 32: * @(#)if_lereg.h 7.1 (Berkeley) 5/8/90
! 33: */
! 34:
! 35: #define LEID 21
! 36:
! 37: #define NTBUF 2
! 38: #define TLEN 1
! 39: #define NRBUF 8
! 40: #define RLEN 3
! 41: #define BUFSIZE 1518
! 42:
! 43: #define vu_char volatile u_char
! 44: #define vu_short volatile u_short
! 45:
! 46: /*
! 47: * LANCE registers.
! 48: */
! 49: struct lereg0 {
! 50: u_char ler0_pad0;
! 51: vu_char ler0_id; /* ID */
! 52: u_char ler0_pad1;
! 53: vu_char ler0_status; /* interrupt enable/status */
! 54: };
! 55:
! 56: /*
! 57: * Control and status bits -- lereg0
! 58: */
! 59: #define LE_IE 0x80 /* interrupt enable */
! 60: #define LE_IR 0x40 /* interrupt requested */
! 61: #define LE_LOCK 0x08 /* lock status register */
! 62: #define LE_ACK 0x04 /* ack of lock */
! 63: #define LE_JAB 0x02 /* loss of tx clock (???) */
! 64: #define LE_IPL(x) ((((x) >> 4) & 0x3) + 3)
! 65:
! 66: struct lereg1 {
! 67: vu_short ler1_rdp; /* data port */
! 68: vu_short ler1_rap; /* register select port */
! 69: };
! 70:
! 71: /*
! 72: * Control and status bits -- lereg1
! 73: */
! 74: #define LE_SERR 0x8000
! 75: #define LE_BABL 0x4000
! 76: #define LE_CERR 0x2000
! 77: #define LE_MISS 0x1000
! 78: #define LE_MERR 0x0800
! 79: #define LE_RINT 0x0400
! 80: #define LE_TINT 0x0200
! 81: #define LE_IDON 0x0100
! 82: #define LE_INTR 0x0080
! 83: #define LE_INEA 0x0040
! 84: #define LE_RXON 0x0020
! 85: #define LE_TXON 0x0010
! 86: #define LE_TDMD 0x0008
! 87: #define LE_STOP 0x0004
! 88: #define LE_STRT 0x0002
! 89: #define LE_INIT 0x0001
! 90:
! 91: #define LE_BSWP 0x0004
! 92: #define LE_ACON 0x0002
! 93: #define LE_BCON 0x0001
! 94:
! 95: /*
! 96: * Overlayed on 16K dual-port RAM.
! 97: * Current size is 15,284 bytes with 8 x 1518 receive buffers and
! 98: * 2 x 1518 transmit buffers.
! 99: */
! 100:
! 101: /*
! 102: * LANCE initialization block
! 103: */
! 104: struct init_block {
! 105: u_short mode; /* mode register */
! 106: u_char padr[6]; /* ethernet address */
! 107: u_long ladrf[2]; /* logical address filter (multicast) */
! 108: u_short rdra; /* low order pointer to receive ring */
! 109: u_short rlen; /* high order pointer and no. rings */
! 110: u_short tdra; /* low order pointer to transmit ring */
! 111: u_short tlen; /* high order pointer and no rings */
! 112: };
! 113:
! 114: /*
! 115: * Mode bits -- init_block
! 116: */
! 117: #define LE_PROM 0x8000 /* promiscuous */
! 118: #define LE_INTL 0x0040 /* internal loopback */
! 119: #define LE_DRTY 0x0020 /* disable retry */
! 120: #define LE_COLL 0x0010 /* force collision */
! 121: #define LE_DTCR 0x0008 /* disable transmit crc */
! 122: #define LE_LOOP 0x0004 /* loopback */
! 123: #define LE_DTX 0x0002 /* disable transmitter */
! 124: #define LE_DRX 0x0001 /* disable receiver */
! 125: #define LE_NORMAL 0x0000
! 126:
! 127: /*
! 128: * Message descriptor
! 129: */
! 130: struct mds {
! 131: u_short addr;
! 132: u_short flags;
! 133: u_short bcnt;
! 134: u_short mcnt;
! 135: };
! 136:
! 137: /* Message descriptor flags */
! 138: #define LE_OWN 0x8000 /* owner bit, 0=host, 1=LANCE */
! 139: #define LE_ERR 0x4000 /* error */
! 140: #define LE_STP 0x0200 /* start of packet */
! 141: #define LE_ENP 0x0100 /* end of packet */
! 142:
! 143: /* Receive ring status flags */
! 144: #define LE_FRAM 0x2000 /* framing error error */
! 145: #define LE_OFLO 0x1000 /* silo overflow */
! 146: #define LE_CRC 0x0800 /* CRC error */
! 147: #define LE_RBUFF 0x0400 /* buffer error */
! 148:
! 149: /* Transmit ring status flags */
! 150: #define LE_MORE 0x1000 /* more than 1 retry */
! 151: #define LE_ONE 0x0800 /* one retry */
! 152: #define LE_DEF 0x0400 /* deferred transmit */
! 153:
! 154: /* Transmit errors */
! 155: #define LE_TBUFF 0x8000 /* buffer error */
! 156: #define LE_UFLO 0x4000 /* silo underflow */
! 157: #define LE_LCOL 0x1000 /* late collision */
! 158: #define LE_LCAR 0x0800 /* loss of carrier */
! 159: #define LE_RTRY 0x0400 /* tried 16 times */
CVSweb