xref: /csrg-svn/sys/hp300/dev/if_lereg.h (revision 54719)
141480Smckusick /*
241480Smckusick  * Copyright (c) 1982, 1990 The Regents of the University of California.
341480Smckusick  * All rights reserved.
441480Smckusick  *
541480Smckusick  * %sccs.include.redist.c%
641480Smckusick  *
7*54719Ssklower  *	@(#)if_lereg.h	7.4 (Berkeley) 07/06/92
841480Smckusick  */
941480Smckusick 
1053930Shibler #ifdef KERNEL
1153930Shibler #include "hp/dev/iotypes.h"	/* XXX */
1253930Shibler #else
1353930Shibler #include <hp/dev/iotypes.h>	/* XXX */
1453930Shibler #endif
1553930Shibler 
1641480Smckusick #define	LEID		21
1741480Smckusick 
1841480Smckusick #define	LEMTU		1518
1941480Smckusick #define	LEMINSIZE	60	/* should be 64 if mode DTCR is set */
2041480Smckusick #define	LERBUF		8
2141480Smckusick #define	LERBUFLOG2	3
2241480Smckusick #define	LE_RLEN		(LERBUFLOG2 << 13)
2350823Ssklower #define	LETBUF		2
2450823Ssklower #define	LETBUFLOG2	1
2541480Smckusick #define	LE_TLEN		(LETBUFLOG2 << 13)
2641480Smckusick 
2741480Smckusick /*
2841480Smckusick  * LANCE registers.
2941480Smckusick  */
3041480Smckusick struct lereg0 {
3141480Smckusick 	u_char	ler0_pad0;
3241480Smckusick 	vu_char	ler0_id;	/* ID */
3341480Smckusick 	u_char	ler0_pad1;
3441480Smckusick 	vu_char	ler0_status;	/* interrupt enable/status */
3541480Smckusick };
3641480Smckusick 
3741480Smckusick struct lereg1 {
3841480Smckusick 	u_short	ler1_rdp;	/* data port */
3941480Smckusick 	u_short	ler1_rap;	/* register select port */
4041480Smckusick };
4141480Smckusick 
4241480Smckusick /*
4341480Smckusick  * Overlayed on 16K dual-port RAM.
4453930Shibler  * Current size is 15,284 bytes with 8 x 1518 receive buffers and
4553930Shibler  * 2 x 1518 transmit buffers.
4641480Smckusick  */
4741480Smckusick struct lereg2 {
4841480Smckusick 	/* init block */
4941480Smckusick 	u_short	ler2_mode;		/* +0x0000 */
5041480Smckusick 	u_char	ler2_padr[6];		/* +0x0002 */
51*54719Ssklower 	u_long	ler2_ladrf[2];		/* +0x0008 */
5241480Smckusick 	u_short	ler2_rdra;		/* +0x0010 */
5341480Smckusick 	u_short	ler2_rlen;		/* +0x0012 */
5441480Smckusick 	u_short	ler2_tdra;		/* +0x0014 */
5541480Smckusick 	u_short	ler2_tlen;		/* +0x0016 */
5641480Smckusick 	/* receive message descriptors */
5741480Smckusick 	struct	lermd {			/* +0x0018 */
5841480Smckusick 		u_short	rmd0;
5941480Smckusick 		u_short	rmd1;
6041480Smckusick 		short	rmd2;
6141480Smckusick 		u_short	rmd3;
6241480Smckusick 	} ler2_rmd[LERBUF];
6341480Smckusick 	/* transmit message descriptors */
6441480Smckusick 	struct	letmd {			/* +0x0058 */
6541480Smckusick 		u_short	tmd0;
6641480Smckusick 		u_short	tmd1;
6741480Smckusick 		short	tmd2;
6841480Smckusick 		u_short	tmd3;
6941480Smckusick 	} ler2_tmd[LETBUF];
7053930Shibler 	char	ler2_rbuf[LERBUF][LEMTU]; /* +0x0068 */
7153930Shibler 	char	ler2_tbuf[LETBUF][LEMTU]; /* +0x2FD8 */
7241480Smckusick };
7341480Smckusick 
7441480Smckusick /*
7541480Smckusick  * Control and status bits -- lereg0
7641480Smckusick  */
7741480Smckusick #define	LE_IE		0x80		/* interrupt enable */
7841480Smckusick #define	LE_IR		0x40		/* interrupt requested */
7941480Smckusick #define	LE_LOCK		0x08		/* lock status register */
8041480Smckusick #define	LE_ACK		0x04		/* ack of lock */
8141480Smckusick #define	LE_JAB		0x02		/* loss of tx clock (???) */
8241480Smckusick #define LE_IPL(x)	((((x) >> 4) & 0x3) + 3)
8341480Smckusick 
8441480Smckusick /*
8541480Smckusick  * Control and status bits -- lereg1
8641480Smckusick  */
8741480Smckusick #define	LE_CSR0		0
8841480Smckusick #define	LE_CSR1		1
8941480Smckusick #define	LE_CSR2		2
9041480Smckusick #define	LE_CSR3		3
9141480Smckusick 
9241480Smckusick #define	LE_SERR		0x8000
9341480Smckusick #define	LE_BABL		0x4000
9441480Smckusick #define	LE_CERR		0x2000
9541480Smckusick #define	LE_MISS		0x1000
9641480Smckusick #define	LE_MERR		0x0800
9741480Smckusick #define	LE_RINT		0x0400
9841480Smckusick #define	LE_TINT		0x0200
9941480Smckusick #define	LE_IDON		0x0100
10041480Smckusick #define	LE_INTR		0x0080
10141480Smckusick #define	LE_INEA		0x0040
10241480Smckusick #define	LE_RXON		0x0020
10341480Smckusick #define	LE_TXON		0x0010
10441480Smckusick #define	LE_TDMD		0x0008
10541480Smckusick #define	LE_STOP		0x0004
10641480Smckusick #define	LE_STRT		0x0002
10741480Smckusick #define	LE_INIT		0x0001
10841480Smckusick 
10941480Smckusick #define	LE_BSWP		0x4
11041480Smckusick #define	LE_MODE		0x0
11141480Smckusick 
11241480Smckusick /*
11341480Smckusick  * Control and status bits -- lereg2
11441480Smckusick  */
11541480Smckusick #define	LE_OWN		0x8000
11641480Smckusick #define	LE_ERR		0x4000
11741480Smckusick #define	LE_STP		0x0200
11841480Smckusick #define	LE_ENP		0x0100
11941480Smckusick 
12041480Smckusick #define	LE_FRAM		0x2000
12141480Smckusick #define	LE_OFLO		0x1000
12241480Smckusick #define	LE_CRC		0x0800
12341480Smckusick #define	LE_RBUFF	0x0400
12441480Smckusick #define	LE_MORE		0x1000
12541480Smckusick #define	LE_ONE		0x0800
12641480Smckusick #define	LE_DEF		0x0400
12741480Smckusick #define	LE_TBUFF	0x8000
12841480Smckusick #define	LE_UFLO		0x4000
12941480Smckusick #define	LE_LCOL		0x1000
13041480Smckusick #define	LE_LCAR		0x0800
13141480Smckusick #define	LE_RTRY		0x0400
132