xref: /csrg-svn/sys/vax/if/if_ilreg.h (revision 7265)
1*7265Ssam /*	if_ilreg.h	4.2	82/06/23	*/
26895Sfeldman 
36895Sfeldman /*
46895Sfeldman  * Interlan Ethernet Communications Controller interface
56895Sfeldman  */
66895Sfeldman struct ildevice {
76895Sfeldman 	short	il_csr;		/* Command and Status Register */
86895Sfeldman 	short	il_bar;		/* Buffer Address Register */
96895Sfeldman 	short	il_bcr;		/* Byte Count Register */
106895Sfeldman };
116895Sfeldman 
126895Sfeldman /*
136895Sfeldman  * Command and status bits
146895Sfeldman  */
15*7265Ssam #define	IL_EUA		0xc000		/* Extended Unibus Address */
166895Sfeldman #define	IL_CMD		0x3f00		/* Command Function Code */
176895Sfeldman #define	IL_CDONE	0x0080		/* Command Done */
186895Sfeldman #define	IL_CIE		0x0040		/* Command Interrupt Enable */
196895Sfeldman #define	IL_RDONE	0x0020		/* Receive DMA Done */
206895Sfeldman #define	IL_RIE		0x0010		/* Receive Interrupt Enable */
216895Sfeldman #define	IL_STATUS	0x000f		/* Command Status Code */
226895Sfeldman 
23*7265Ssam #define	IL_BITS		"\20\10CDONE\7CIE\6RDONE\5RIE"
246895Sfeldman 
25*7265Ssam /* command definitions */
266895Sfeldman #define	ILC_MLPBAK	0x0100		/* Set Module Interface Loopback Mode */
276895Sfeldman #define	ILC_ILPBAK	0x0200		/* Set Internal Loopback Mode */
286895Sfeldman #define	ILC_CLPBAK	0x0300		/* Clear Loopback Mode */
296895Sfeldman #define	ILC_PRMSC	0x0400		/* Set Promiscuous Receive Mode */
306895Sfeldman #define	ILC_CLPRMSC	0x0500		/* Clear Promiscuous Receive Mode */
316895Sfeldman #define	ILC_RCVERR	0x0600		/* Set Receive-On-Error Bit */
326895Sfeldman #define	ILC_CRCVERR	0x0700		/* Clear Receive-On-Error Bit */
336895Sfeldman #define	ILC_OFFLINE	0x0800		/* Go Offline */
346895Sfeldman #define	ILC_ONLINE	0x0900		/* Go Online */
356895Sfeldman #define	ILC_DIAG	0x0a00		/* Run On-board Diagnostics */
366895Sfeldman #define	ILC_STAT	0x1800		/* Report and Reset Statistics */
376895Sfeldman #define	ILC_DELAYS	0x1900		/* Report Collision Delay Times */
386895Sfeldman #define	ILC_RCV		0x2000		/* Supply Receive Buffer */
396895Sfeldman #define	ILC_LDXMIT	0x2800		/* Load Transmit Data */
406895Sfeldman #define	ILC_XMIT	0x2900		/* Load Transmit Data and Send */
416895Sfeldman #define	ILC_LDGRPS	0x2a00		/* Load Group Addresses */
426895Sfeldman #define	ILC_RMGRPS	0x2b00		/* Delete Group Addresses */
436895Sfeldman #define	ILC_FLUSH	0x3000		/* Flush Receive BAR/BCR Queue */
446895Sfeldman #define	ILC_RESET	0x3f00		/* Reset */
456895Sfeldman 
466895Sfeldman /*
47*7265Ssam  * Error codes found in the status bits of the csr.
486895Sfeldman  */
49*7265Ssam #define	ILERR_SUCCESS		0	/* command successful */
50*7265Ssam #define	ILERR_RETRIES		1	/* " " with retries */
51*7265Ssam #define	ILERR_BADCMD		2	/* illegal command */
52*7265Ssam #define	ILERR_INVCMD		3	/* invalid command */
53*7265Ssam #define	ILERR_RECVERR		4	/* receiver error */
54*7265Ssam #define	ILERR_BUFSIZ		5	/* buffer size too big */
55*7265Ssam #define	ILERR_FRAMESIZ		6	/* frame size too small */
56*7265Ssam #define	ILERR_COLLISIONS	8	/* excessive collisions */
57*7265Ssam #define	ILERR_BUFALIGNMENT	10	/* buffer not word aligned */
58*7265Ssam #define	ILERR_NXM		15	/* non-existent memory */
59*7265Ssam 
60*7265Ssam #define	NILERRS			16
61*7265Ssam #ifdef ILERRS
62*7265Ssam char *ilerrs[NILERRS] = {
63*7265Ssam 	"success",			/*  0 */
64*7265Ssam 	"success with retries", 	/*  1 */
65*7265Ssam 	"illegal command",		/*  2 */
66*7265Ssam 	"inappropriate command",	/*  3 */
67*7265Ssam 	"failure",			/*  4 */
68*7265Ssam 	"buffer size exceeded",		/*  5 */
69*7265Ssam 	"frame too small",		/*  6 */
70*7265Ssam 	0,				/*  7 */
71*7265Ssam 	"excessive collisions",		/*  8 */
72*7265Ssam 	0,				/*  9 */
73*7265Ssam 	"buffer alignment error",	/* 10 */
74*7265Ssam 	0,				/* 11 */
75*7265Ssam 	0,				/* 12 */
76*7265Ssam 	0,				/* 13 */
77*7265Ssam 	0,				/* 14 */
78*7265Ssam 	"non-existent memory"		/* 15 */
796895Sfeldman };
80*7265Ssam #endif
816895Sfeldman 
82*7265Ssam /*
83*7265Ssam  * Diagnostics codes.
84*7265Ssam  */
85*7265Ssam #define	ILDIAG_SUCCESS		0	/* no problems */
86*7265Ssam #define	ILDIAG_CHKSUMERR	1	/* ROM/RAM checksum error */
87*7265Ssam #define	ILDIAG_DMAERR		2	/* DMA not working */
88*7265Ssam #define	ILDIAG_XMITERR		3	/* xmit circuitry failure */
89*7265Ssam #define	ILDIAG_RECVERR		4	/* rcvr circuitry failure */
90*7265Ssam #define	ILDIAG_LOOPBACK		5	/* loopback test failed */
91*7265Ssam 
92*7265Ssam #define	NILDIAGS		6
93*7265Ssam #ifdef ILDIAGS
94*7265Ssam char *ildiag[NILDIAGS] = {
95*7265Ssam 	"success",			/* 0 */
96*7265Ssam 	"checksum error",		/* 1 */
97*7265Ssam 	"NM10 dma error",		/* 2 */
98*7265Ssam 	"transmitter error",		/* 3 */
99*7265Ssam 	"receiver error",		/* 4 */
100*7265Ssam 	"loopback failure",		/* 5 */
1016895Sfeldman };
102*7265Ssam #endif
103*7265Ssam 
104*7265Ssam /*
105*7265Ssam  * Frame status bits, returned in frame status byte
106*7265Ssam  * at the top of each received packet.
107*7265Ssam  */
108*7265Ssam #define	ILFSTAT_C	0x1		/* CRC error */
109*7265Ssam #define	ILFSTAT_A	0x2		/* alignment error */
110*7265Ssam #define	ILFSTAT_L	0x4		/* 1+ frames lost just before */
111