xref: /csrg-svn/sys/vax/if/if_ilreg.h (revision 23299)
1*23299Smckusick /*
2*23299Smckusick  * Copyright (c) 1982 Regents of the University of California.
3*23299Smckusick  * All rights reserved.  The Berkeley software License Agreement
4*23299Smckusick  * specifies the terms and conditions for redistribution.
5*23299Smckusick  *
6*23299Smckusick  *	@(#)if_ilreg.h	6.2 (Berkeley) 06/08/85
7*23299Smckusick  */
86895Sfeldman 
96895Sfeldman /*
106895Sfeldman  * Interlan Ethernet Communications Controller interface
116895Sfeldman  */
126895Sfeldman struct ildevice {
136895Sfeldman 	short	il_csr;		/* Command and Status Register */
146895Sfeldman 	short	il_bar;		/* Buffer Address Register */
156895Sfeldman 	short	il_bcr;		/* Byte Count Register */
166895Sfeldman };
176895Sfeldman 
186895Sfeldman /*
196895Sfeldman  * Command and status bits
206895Sfeldman  */
217265Ssam #define	IL_EUA		0xc000		/* Extended Unibus Address */
226895Sfeldman #define	IL_CMD		0x3f00		/* Command Function Code */
236895Sfeldman #define	IL_CDONE	0x0080		/* Command Done */
246895Sfeldman #define	IL_CIE		0x0040		/* Command Interrupt Enable */
256895Sfeldman #define	IL_RDONE	0x0020		/* Receive DMA Done */
266895Sfeldman #define	IL_RIE		0x0010		/* Receive Interrupt Enable */
276895Sfeldman #define	IL_STATUS	0x000f		/* Command Status Code */
286895Sfeldman 
297265Ssam #define	IL_BITS		"\20\10CDONE\7CIE\6RDONE\5RIE"
306895Sfeldman 
317265Ssam /* command definitions */
326895Sfeldman #define	ILC_MLPBAK	0x0100		/* Set Module Interface Loopback Mode */
336895Sfeldman #define	ILC_ILPBAK	0x0200		/* Set Internal Loopback Mode */
346895Sfeldman #define	ILC_CLPBAK	0x0300		/* Clear Loopback Mode */
356895Sfeldman #define	ILC_PRMSC	0x0400		/* Set Promiscuous Receive Mode */
366895Sfeldman #define	ILC_CLPRMSC	0x0500		/* Clear Promiscuous Receive Mode */
376895Sfeldman #define	ILC_RCVERR	0x0600		/* Set Receive-On-Error Bit */
386895Sfeldman #define	ILC_CRCVERR	0x0700		/* Clear Receive-On-Error Bit */
396895Sfeldman #define	ILC_OFFLINE	0x0800		/* Go Offline */
406895Sfeldman #define	ILC_ONLINE	0x0900		/* Go Online */
416895Sfeldman #define	ILC_DIAG	0x0a00		/* Run On-board Diagnostics */
429180Ssam #define	ILC_ISA		0x0d00		/* Set Insert Source Address Mode */
439180Ssam #define	ILC_CISA	0x0e00		/* Clear Insert Source Address Mode */
449180Ssam #define	ILC_DEFPA	0x0f00		/* Set Physical Address to Default */
459180Ssam #define	ILC_ALLMC	0x1000		/* Set Receive All Multicast Packets */
469180Ssam #define	ILC_CALLMC	0x1100		/* Clear Receive All Multicast */
476895Sfeldman #define	ILC_STAT	0x1800		/* Report and Reset Statistics */
486895Sfeldman #define	ILC_DELAYS	0x1900		/* Report Collision Delay Times */
496895Sfeldman #define	ILC_RCV		0x2000		/* Supply Receive Buffer */
506895Sfeldman #define	ILC_LDXMIT	0x2800		/* Load Transmit Data */
516895Sfeldman #define	ILC_XMIT	0x2900		/* Load Transmit Data and Send */
526895Sfeldman #define	ILC_LDGRPS	0x2a00		/* Load Group Addresses */
536895Sfeldman #define	ILC_RMGRPS	0x2b00		/* Delete Group Addresses */
549180Ssam #define	ILC_LDPA	0x2c00		/* Load Physical Address */
556895Sfeldman #define	ILC_FLUSH	0x3000		/* Flush Receive BAR/BCR Queue */
566895Sfeldman #define	ILC_RESET	0x3f00		/* Reset */
576895Sfeldman 
586895Sfeldman /*
597265Ssam  * Error codes found in the status bits of the csr.
606895Sfeldman  */
617265Ssam #define	ILERR_SUCCESS		0	/* command successful */
627265Ssam #define	ILERR_RETRIES		1	/* " " with retries */
637265Ssam #define	ILERR_BADCMD		2	/* illegal command */
647265Ssam #define	ILERR_INVCMD		3	/* invalid command */
657265Ssam #define	ILERR_RECVERR		4	/* receiver error */
667265Ssam #define	ILERR_BUFSIZ		5	/* buffer size too big */
677265Ssam #define	ILERR_FRAMESIZ		6	/* frame size too small */
687265Ssam #define	ILERR_COLLISIONS	8	/* excessive collisions */
697265Ssam #define	ILERR_BUFALIGNMENT	10	/* buffer not word aligned */
707265Ssam #define	ILERR_NXM		15	/* non-existent memory */
717265Ssam 
727265Ssam #define	NILERRS			16
737265Ssam #ifdef ILERRS
747265Ssam char *ilerrs[NILERRS] = {
757265Ssam 	"success",			/*  0 */
767265Ssam 	"success with retries", 	/*  1 */
777265Ssam 	"illegal command",		/*  2 */
787265Ssam 	"inappropriate command",	/*  3 */
797265Ssam 	"failure",			/*  4 */
807265Ssam 	"buffer size exceeded",		/*  5 */
817265Ssam 	"frame too small",		/*  6 */
827265Ssam 	0,				/*  7 */
837265Ssam 	"excessive collisions",		/*  8 */
847265Ssam 	0,				/*  9 */
857265Ssam 	"buffer alignment error",	/* 10 */
867265Ssam 	0,				/* 11 */
877265Ssam 	0,				/* 12 */
887265Ssam 	0,				/* 13 */
897265Ssam 	0,				/* 14 */
907265Ssam 	"non-existent memory"		/* 15 */
916895Sfeldman };
927265Ssam #endif
936895Sfeldman 
947265Ssam /*
957265Ssam  * Diagnostics codes.
967265Ssam  */
977265Ssam #define	ILDIAG_SUCCESS		0	/* no problems */
987265Ssam #define	ILDIAG_CHKSUMERR	1	/* ROM/RAM checksum error */
997265Ssam #define	ILDIAG_DMAERR		2	/* DMA not working */
1007265Ssam #define	ILDIAG_XMITERR		3	/* xmit circuitry failure */
1017265Ssam #define	ILDIAG_RECVERR		4	/* rcvr circuitry failure */
1027265Ssam #define	ILDIAG_LOOPBACK		5	/* loopback test failed */
1037265Ssam 
1047265Ssam #define	NILDIAGS		6
1057265Ssam #ifdef ILDIAGS
1067265Ssam char *ildiag[NILDIAGS] = {
1077265Ssam 	"success",			/* 0 */
1087265Ssam 	"checksum error",		/* 1 */
1097265Ssam 	"NM10 dma error",		/* 2 */
1107265Ssam 	"transmitter error",		/* 3 */
1117265Ssam 	"receiver error",		/* 4 */
1127265Ssam 	"loopback failure",		/* 5 */
1136895Sfeldman };
1147265Ssam #endif
1157265Ssam 
1167265Ssam /*
1177265Ssam  * Frame status bits, returned in frame status byte
1187265Ssam  * at the top of each received packet.
1197265Ssam  */
1207265Ssam #define	ILFSTAT_C	0x1		/* CRC error */
1217265Ssam #define	ILFSTAT_A	0x2		/* alignment error */
1227265Ssam #define	ILFSTAT_L	0x4		/* 1+ frames lost just before */
123