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