xref: /csrg-svn/sys/news3400/if/lancereg.h (revision 63305)
153897Smckusick /*
2*63305Sbostic  * Copyright (c) 1992, 1993
3*63305Sbostic  *	The Regents of the University of California.  All rights reserved.
453897Smckusick  *
553897Smckusick  * This code is derived from software contributed to Berkeley by
653897Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
753897Smckusick  *
853897Smckusick  * %sccs.include.redist.c%
953897Smckusick  *
1053897Smckusick  * from: $Hdr: lancereg.h,v 4.300 91/06/09 06:26:05 root Rel41 $ SONY
1153897Smckusick  *
12*63305Sbostic  *	@(#)lancereg.h	8.1 (Berkeley) 06/11/93
1353897Smckusick  */
1453897Smckusick 
1553897Smckusick struct lance {
1653897Smckusick 	u_short	rdp;			/* data port			*/
1753897Smckusick 	u_short rap;			/* address port			*/
1853897Smckusick };
1953897Smckusick 
2053897Smckusick /*
2153897Smckusick  *	Control and status registers
2253897Smckusick  */
2353897Smckusick #define	CSR0		0
2453897Smckusick #define	CSR1		1
2553897Smckusick #define	CSR2		2
2653897Smckusick #define	CSR3		3
2753897Smckusick 
2853897Smckusick /*
2953897Smckusick  *	CSR0
3053897Smckusick  */
3153897Smckusick #define	CSR_ERR		0x8000		/* BABL|CERR|MISS|MERR		*/
3253897Smckusick #define	CSR_BABL	0x4000		/* transmitter timeout error	*/
3353897Smckusick #define	CSR_CERR	0x2000		/* collision error		*/
3453897Smckusick #define	CSR_MISS	0x1000		/* missed packet		*/
3553897Smckusick #define	CSR_MERR	0x0800		/* memory error			*/
3653897Smckusick #define	CSR_RINT	0x0400		/* receiver interrupt		*/
3753897Smckusick #define	CSR_TINT	0x0200		/* transmitter interrupt	*/
3853897Smckusick #define	CSR_IDON	0x0100		/* initailization done		*/
3953897Smckusick #define	CSR_INTR	0x0080		/* BABL|MISS|MERR|RINT|TINT|IDON */
4053897Smckusick #define	CSR_INEA	0x0040		/* interrupt enable		*/
4153897Smckusick #define	CSR_RXON	0x0020		/* receiver on			*/
4253897Smckusick #define	CSR_TXON	0x0010		/* transmitter on		*/
4353897Smckusick #define	CSR_TDMD	0x0008		/* transmit demand		*/
4453897Smckusick #define	CSR_STOP	0x0004		/* disable chip			*/
4553897Smckusick #define	CSR_STRT	0x0002		/* enable chip			*/
4653897Smckusick #define	CSR_INIT	0x0001		/* initialize			*/
4753897Smckusick 
4853897Smckusick /*
4953897Smckusick  *	CSR3
5053897Smckusick  */
5153897Smckusick #define	CSR_BSWP	0x0004		/* byte swap			*/
5253897Smckusick #define	CSR_ACON	0x0002		/* ALE control			*/
5353897Smckusick #define	CSR_BCON	0x0001		/* byte control			*/
5453897Smckusick 
5553897Smckusick /*
5653897Smckusick  *	Initialization block
5753897Smckusick  */
5853897Smckusick struct init_block {
5953897Smckusick 	u_short	ib_mode;
6053897Smckusick 	u_char  ib_padr[6];
6153897Smckusick 	u_char  ib_ladrf[8];
6253897Smckusick 	u_short ib_rdra;
6353897Smckusick 	u_short ib_rlen_rdra;
6453897Smckusick 	u_short ib_tdra;
6553897Smckusick 	u_short ib_tlen_tdra;
6653897Smckusick };
6753897Smckusick 
6853897Smckusick #define	IB_PROM		0x8000		/* promiscuous mode		*/
6953897Smckusick #define	IB_INTL		0x0040		/* internal loopback		*/
7053897Smckusick #define	IB_DRTY		0x0020		/* disable retry		*/
7153897Smckusick #define	IB_COLL		0x0010		/* force collision		*/
7253897Smckusick #define	IB_DTCR		0x0008		/* disable transmit CRC		*/
7353897Smckusick #define	IB_LOOP		0x0004		/* loopback			*/
7453897Smckusick #define	IB_DTX		0x0002		/* disable the transmitter	*/
7553897Smckusick #define	IB_DRX		0x0001		/* disable the receiver		*/
7653897Smckusick 
7753897Smckusick /*
7853897Smckusick  *	Descriptor rings
7953897Smckusick  */
8053897Smckusick 
8153897Smckusick /*
8253897Smckusick  *	Receive message descriptor
8353897Smckusick  */
8453897Smckusick struct recv_msg_desc {
8553897Smckusick 	u_short rmd_ladr;
8653897Smckusick 	u_short rmd_stat;
8753897Smckusick 	u_short rmd_bcnt;
8853897Smckusick 	u_short rmd_mcnt;
8953897Smckusick };
9053897Smckusick 
9153897Smckusick #define	RMD_OWN		0x8000		/* owned by lance		*/
9253897Smckusick #define	RMD_ERR		0x4000		/* FRAM|OFLO|CRC|BUFF		*/
9353897Smckusick #define	RMD_FRAM	0x2000		/* framing error		*/
9453897Smckusick #define	RMD_OFLO	0x1000		/* overflow			*/
9553897Smckusick #define	RMD_CRC		0x0800		/* CRC error			*/
9653897Smckusick #define	RMD_BUFF	0x0400		/* buffer error			*/
9753897Smckusick #define	RMD_STP		0x0200		/* start op packet		*/
9853897Smckusick #define	RMD_ENP		0x0100		/* end of packet		*/
9953897Smckusick #define	RMD_HADR	0x00ff		/* high order 8 bit of buffer address */
10053897Smckusick 
10153897Smckusick /*
10253897Smckusick  *	Transmit message descriptor
10353897Smckusick  */
10453897Smckusick struct xmit_msg_desc {
10553897Smckusick 	u_short tmd_ladr;
10653897Smckusick 	u_short tmd_stat;
10753897Smckusick 	u_short tmd_bcnt;
10853897Smckusick 	u_short tmd_error;
10953897Smckusick };
11053897Smckusick 
11153897Smckusick #define	TMD_OWN		0x8000		/* owned by lance		*/
11253897Smckusick #define	TMD_ERR		0x4000		/* LCOL|LCAR|UFLO|RTRY		*/
11353897Smckusick #define	TMD_MORE	0x1000		/* more than one retry		*/
11453897Smckusick #define	TMD_ONE		0x0800		/* one retry			*/
11553897Smckusick #define	TMD_DEF		0x0400		/* deferred			*/
11653897Smckusick #define	TMD_STP		0x0200		/* start of packet		*/
11753897Smckusick #define	TMD_ENP		0x0100		/* end of packet		*/
11853897Smckusick #define	TMD_HADR	0x00ff		/* high order 8 bit of buffer address */
11953897Smckusick 
12053897Smckusick #define	TMD_BUFF	0x8000		/* buffer error			*/
12153897Smckusick #define	TMD_UFLO	0x4000		/* underflow error		*/
12253897Smckusick #define	TMD_LCOL	0x1000		/* late collision		*/
12353897Smckusick #define	TMD_LCAR	0x0800		/* loss of carrier		*/
12453897Smckusick #define	TMD_RTRY	0x0400		/* retry error			*/
12553897Smckusick #define	TMD_TDR		0x00ff		/* time domain refrectometry	*/
126