xref: /csrg-svn/sys/hp300/dev/if_lereg.h (revision 50823)
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*50823Ssklower  *	@(#)if_lereg.h	7.2 (Berkeley) 08/08/91
841480Smckusick  */
941480Smckusick 
1041480Smckusick #define	LEID		21
1141480Smckusick 
1241480Smckusick #define	LEMTU		1518
1341480Smckusick #define	LEMINSIZE	60	/* should be 64 if mode DTCR is set */
1441480Smckusick #define	LERBUF		8
1541480Smckusick #define	LERBUFLOG2	3
1641480Smckusick #define	LE_RLEN		(LERBUFLOG2 << 13)
17*50823Ssklower #define	LETBUF		2
18*50823Ssklower #define	LETBUFLOG2	1
1941480Smckusick #define	LE_TLEN		(LETBUFLOG2 << 13)
2041480Smckusick 
2141480Smckusick #define vu_char		volatile u_char
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.
4041480Smckusick  * Current size is 13,758 bytes with 8 x 1518 receive buffers and
4141480Smckusick  * 1 x 1518 transmit buffer.
4241480Smckusick  */
4341480Smckusick struct lereg2 {
4441480Smckusick 	/* init block */
4541480Smckusick 	u_short	ler2_mode;		/* +0x0000 */
4641480Smckusick 	u_char	ler2_padr[6];		/* +0x0002 */
4741480Smckusick 	u_long	ler2_ladrf0;		/* +0x0008 */
4841480Smckusick 	u_long	ler2_ladrf1;		/* +0x000C */
4941480Smckusick 	u_short	ler2_rdra;		/* +0x0010 */
5041480Smckusick 	u_short	ler2_rlen;		/* +0x0012 */
5141480Smckusick 	u_short	ler2_tdra;		/* +0x0014 */
5241480Smckusick 	u_short	ler2_tlen;		/* +0x0016 */
5341480Smckusick 	/* receive message descriptors */
5441480Smckusick 	struct	lermd {			/* +0x0018 */
5541480Smckusick 		u_short	rmd0;
5641480Smckusick 		u_short	rmd1;
5741480Smckusick 		short	rmd2;
5841480Smckusick 		u_short	rmd3;
5941480Smckusick 	} ler2_rmd[LERBUF];
6041480Smckusick 	/* transmit message descriptors */
6141480Smckusick 	struct	letmd {			/* +0x0058 */
6241480Smckusick 		u_short	tmd0;
6341480Smckusick 		u_short	tmd1;
6441480Smckusick 		short	tmd2;
6541480Smckusick 		u_short	tmd3;
6641480Smckusick 	} ler2_tmd[LETBUF];
6741480Smckusick 	char	ler2_rbuf[LERBUF][LEMTU]; /* +0x0060 */
6841480Smckusick 	char	ler2_tbuf[LETBUF][LEMTU]; /* +0x2FD0 */
6941480Smckusick };
7041480Smckusick 
7141480Smckusick /*
7241480Smckusick  * Control and status bits -- lereg0
7341480Smckusick  */
7441480Smckusick #define	LE_IE		0x80		/* interrupt enable */
7541480Smckusick #define	LE_IR		0x40		/* interrupt requested */
7641480Smckusick #define	LE_LOCK		0x08		/* lock status register */
7741480Smckusick #define	LE_ACK		0x04		/* ack of lock */
7841480Smckusick #define	LE_JAB		0x02		/* loss of tx clock (???) */
7941480Smckusick #define LE_IPL(x)	((((x) >> 4) & 0x3) + 3)
8041480Smckusick 
8141480Smckusick /*
8241480Smckusick  * Control and status bits -- lereg1
8341480Smckusick  */
8441480Smckusick #define	LE_CSR0		0
8541480Smckusick #define	LE_CSR1		1
8641480Smckusick #define	LE_CSR2		2
8741480Smckusick #define	LE_CSR3		3
8841480Smckusick 
8941480Smckusick #define	LE_SERR		0x8000
9041480Smckusick #define	LE_BABL		0x4000
9141480Smckusick #define	LE_CERR		0x2000
9241480Smckusick #define	LE_MISS		0x1000
9341480Smckusick #define	LE_MERR		0x0800
9441480Smckusick #define	LE_RINT		0x0400
9541480Smckusick #define	LE_TINT		0x0200
9641480Smckusick #define	LE_IDON		0x0100
9741480Smckusick #define	LE_INTR		0x0080
9841480Smckusick #define	LE_INEA		0x0040
9941480Smckusick #define	LE_RXON		0x0020
10041480Smckusick #define	LE_TXON		0x0010
10141480Smckusick #define	LE_TDMD		0x0008
10241480Smckusick #define	LE_STOP		0x0004
10341480Smckusick #define	LE_STRT		0x0002
10441480Smckusick #define	LE_INIT		0x0001
10541480Smckusick 
10641480Smckusick #define	LE_BSWP		0x4
10741480Smckusick #define	LE_MODE		0x0
10841480Smckusick 
10941480Smckusick /*
11041480Smckusick  * Control and status bits -- lereg2
11141480Smckusick  */
11241480Smckusick #define	LE_OWN		0x8000
11341480Smckusick #define	LE_ERR		0x4000
11441480Smckusick #define	LE_STP		0x0200
11541480Smckusick #define	LE_ENP		0x0100
11641480Smckusick 
11741480Smckusick #define	LE_FRAM		0x2000
11841480Smckusick #define	LE_OFLO		0x1000
11941480Smckusick #define	LE_CRC		0x0800
12041480Smckusick #define	LE_RBUFF	0x0400
12141480Smckusick #define	LE_MORE		0x1000
12241480Smckusick #define	LE_ONE		0x0800
12341480Smckusick #define	LE_DEF		0x0400
12441480Smckusick #define	LE_TBUFF	0x8000
12541480Smckusick #define	LE_UFLO		0x4000
12641480Smckusick #define	LE_LCOL		0x1000
12741480Smckusick #define	LE_LCAR		0x0800
12841480Smckusick #define	LE_RTRY		0x0400
129