xref: /csrg-svn/sys/hp300/dev/if_lereg.h (revision 41480)
1*41480Smckusick /*
2*41480Smckusick  * Copyright (c) 1982, 1990 The Regents of the University of California.
3*41480Smckusick  * All rights reserved.
4*41480Smckusick  *
5*41480Smckusick  * %sccs.include.redist.c%
6*41480Smckusick  *
7*41480Smckusick  *	@(#)if_lereg.h	7.1 (Berkeley) 05/08/90
8*41480Smckusick  */
9*41480Smckusick 
10*41480Smckusick #define	LEID		21
11*41480Smckusick 
12*41480Smckusick #define	LEMTU		1518
13*41480Smckusick #define	LEMINSIZE	60	/* should be 64 if mode DTCR is set */
14*41480Smckusick #define	LERBUF		8
15*41480Smckusick #define	LERBUFLOG2	3
16*41480Smckusick #define	LE_RLEN		(LERBUFLOG2 << 13)
17*41480Smckusick #define	LETBUF		1
18*41480Smckusick #define	LETBUFLOG2	0
19*41480Smckusick #define	LE_TLEN		(LETBUFLOG2 << 13)
20*41480Smckusick 
21*41480Smckusick #define vu_char		volatile u_char
22*41480Smckusick 
23*41480Smckusick /*
24*41480Smckusick  * LANCE registers.
25*41480Smckusick  */
26*41480Smckusick struct lereg0 {
27*41480Smckusick 	u_char	ler0_pad0;
28*41480Smckusick 	vu_char	ler0_id;	/* ID */
29*41480Smckusick 	u_char	ler0_pad1;
30*41480Smckusick 	vu_char	ler0_status;	/* interrupt enable/status */
31*41480Smckusick };
32*41480Smckusick 
33*41480Smckusick struct lereg1 {
34*41480Smckusick 	u_short	ler1_rdp;	/* data port */
35*41480Smckusick 	u_short	ler1_rap;	/* register select port */
36*41480Smckusick };
37*41480Smckusick 
38*41480Smckusick /*
39*41480Smckusick  * Overlayed on 16K dual-port RAM.
40*41480Smckusick  * Current size is 13,758 bytes with 8 x 1518 receive buffers and
41*41480Smckusick  * 1 x 1518 transmit buffer.
42*41480Smckusick  */
43*41480Smckusick struct lereg2 {
44*41480Smckusick 	/* init block */
45*41480Smckusick 	u_short	ler2_mode;		/* +0x0000 */
46*41480Smckusick 	u_char	ler2_padr[6];		/* +0x0002 */
47*41480Smckusick 	u_long	ler2_ladrf0;		/* +0x0008 */
48*41480Smckusick 	u_long	ler2_ladrf1;		/* +0x000C */
49*41480Smckusick 	u_short	ler2_rdra;		/* +0x0010 */
50*41480Smckusick 	u_short	ler2_rlen;		/* +0x0012 */
51*41480Smckusick 	u_short	ler2_tdra;		/* +0x0014 */
52*41480Smckusick 	u_short	ler2_tlen;		/* +0x0016 */
53*41480Smckusick 	/* receive message descriptors */
54*41480Smckusick 	struct	lermd {			/* +0x0018 */
55*41480Smckusick 		u_short	rmd0;
56*41480Smckusick 		u_short	rmd1;
57*41480Smckusick 		short	rmd2;
58*41480Smckusick 		u_short	rmd3;
59*41480Smckusick 	} ler2_rmd[LERBUF];
60*41480Smckusick 	/* transmit message descriptors */
61*41480Smckusick 	struct	letmd {			/* +0x0058 */
62*41480Smckusick 		u_short	tmd0;
63*41480Smckusick 		u_short	tmd1;
64*41480Smckusick 		short	tmd2;
65*41480Smckusick 		u_short	tmd3;
66*41480Smckusick 	} ler2_tmd[LETBUF];
67*41480Smckusick 	char	ler2_rbuf[LERBUF][LEMTU]; /* +0x0060 */
68*41480Smckusick 	char	ler2_tbuf[LETBUF][LEMTU]; /* +0x2FD0 */
69*41480Smckusick };
70*41480Smckusick 
71*41480Smckusick /*
72*41480Smckusick  * Control and status bits -- lereg0
73*41480Smckusick  */
74*41480Smckusick #define	LE_IE		0x80		/* interrupt enable */
75*41480Smckusick #define	LE_IR		0x40		/* interrupt requested */
76*41480Smckusick #define	LE_LOCK		0x08		/* lock status register */
77*41480Smckusick #define	LE_ACK		0x04		/* ack of lock */
78*41480Smckusick #define	LE_JAB		0x02		/* loss of tx clock (???) */
79*41480Smckusick #define LE_IPL(x)	((((x) >> 4) & 0x3) + 3)
80*41480Smckusick 
81*41480Smckusick /*
82*41480Smckusick  * Control and status bits -- lereg1
83*41480Smckusick  */
84*41480Smckusick #define	LE_CSR0		0
85*41480Smckusick #define	LE_CSR1		1
86*41480Smckusick #define	LE_CSR2		2
87*41480Smckusick #define	LE_CSR3		3
88*41480Smckusick 
89*41480Smckusick #define	LE_SERR		0x8000
90*41480Smckusick #define	LE_BABL		0x4000
91*41480Smckusick #define	LE_CERR		0x2000
92*41480Smckusick #define	LE_MISS		0x1000
93*41480Smckusick #define	LE_MERR		0x0800
94*41480Smckusick #define	LE_RINT		0x0400
95*41480Smckusick #define	LE_TINT		0x0200
96*41480Smckusick #define	LE_IDON		0x0100
97*41480Smckusick #define	LE_INTR		0x0080
98*41480Smckusick #define	LE_INEA		0x0040
99*41480Smckusick #define	LE_RXON		0x0020
100*41480Smckusick #define	LE_TXON		0x0010
101*41480Smckusick #define	LE_TDMD		0x0008
102*41480Smckusick #define	LE_STOP		0x0004
103*41480Smckusick #define	LE_STRT		0x0002
104*41480Smckusick #define	LE_INIT		0x0001
105*41480Smckusick 
106*41480Smckusick #define	LE_BSWP		0x4
107*41480Smckusick #define	LE_MODE		0x0
108*41480Smckusick 
109*41480Smckusick /*
110*41480Smckusick  * Control and status bits -- lereg2
111*41480Smckusick  */
112*41480Smckusick #define	LE_OWN		0x8000
113*41480Smckusick #define	LE_ERR		0x4000
114*41480Smckusick #define	LE_STP		0x0200
115*41480Smckusick #define	LE_ENP		0x0100
116*41480Smckusick 
117*41480Smckusick #define	LE_FRAM		0x2000
118*41480Smckusick #define	LE_OFLO		0x1000
119*41480Smckusick #define	LE_CRC		0x0800
120*41480Smckusick #define	LE_RBUFF	0x0400
121*41480Smckusick #define	LE_MORE		0x1000
122*41480Smckusick #define	LE_ONE		0x0800
123*41480Smckusick #define	LE_DEF		0x0400
124*41480Smckusick #define	LE_TBUFF	0x8000
125*41480Smckusick #define	LE_UFLO		0x4000
126*41480Smckusick #define	LE_LCOL		0x1000
127*41480Smckusick #define	LE_LCAR		0x0800
128*41480Smckusick #define	LE_RTRY		0x0400
129