xref: /csrg-svn/sys/vax/if/if_vv.h (revision 7025)
1 /*	if_vv.h	4.1	82/06/04	*/
2 /*
3  * Local network header for V2LNI Ring
4  * This is arbitrated by "V2LNI-PEOPLE@MIT-MC"
5  * (aka Joel N. Chiappa)
6  */
7 
8 struct vv_header {
9 	 /* the first two fields are required by the hardware */
10 	u_char	vh_dhost;	/* destination address */
11 	u_char	vh_shost;	/* source address */
12 	/* the next three fields are the local network header */
13 	u_char	vh_version;	/* header version */
14 	u_char	vh_type;	/* packet type => protocol number */
15 	short	vh_info;	/* protocol-specific information */
16 };
17 
18 #define	RING_VERSION	1	/* current version of v2lni header */
19 
20 /*
21  * Packet types (protocol numbers) in v2lni header
22  */
23 #define	RING_IP		1
24 #define	RING_IPTrailer	2
25 #define	RING_WHOAMI	0xa5	/* insure some bit transitions */
26 
27 #define	VV_BROADCAST	0	/* hardware-defined broadcast address */
28 
29 /*
30  * Proteon V2LNI Hardware definitions
31  * register bit definitions - new style
32  */
33 #define	VV_ENB	01		/* Enable Operation */
34 #define	VV_DEN	02		/* Enable DMA */
35 #define	VV_HEN	04		/* Host Relay Enable (Rcv) */
36 #define	VV_CPB	04		/* Clear Packet Buffer (Xmit) */
37 #define	VV_STE	010		/* Self Test Enable (Rcv) */
38 #define	VV_UT1	010		/* Unused (Xmit) */
39 #define	VV_LPB	020		/* Modem Disable (Rcv) */
40 #define	VV_INR	020		/* Initialize Ring (Xmit) */
41 #define	VV_RST	040		/* Reset */
42 #define	VV_IEN	0100		/* Interrupt Enable */
43 #define	VV_RDY	0200		/* Done */
44 #define	VV_DPR	0400		/* Data Present (Rcv) */
45 #define	VV_RFS	0400		/* Refused (Xmit) */
46 #define	VV_NXM	01000		/* Non Existent Memory */
47 #define	VV_OVR	02000		/* Overrun */
48 #define	VV_ODB	04000		/* Odd Byte (Achtung, mein Fuehrer) (Rcv) */
49 #define	VV_UT2	04000		/* Unused (Xmit) */
50 #define	VV_LDE	010000		/* Link Data Error (Rcv) */
51 #define	VV_OPT	010000		/* Output Timeout (Xmit) */
52 #define	VV_NOK	020000		/* Ring Not OK */
53 #define	VV_BDF	040000		/* Bad Format in Operation */
54 #define	VV_NIR	0100000		/* Not in Ring */
55 
56 #define	VVXERR	(VV_NXM|VV_OVR|VV_OPT|VV_BDF)	/* Xmit errs */
57 #define	VVRERR	(VV_NXM|VV_OVR|VV_ODB|VV_BDF)	/* Rcv errs */
58 #define	VVFE	(VV_NXM|VV_OVR)			/* Fatal errors */
59 
60 #define VV_IBITS \
61 "\10\20NIR\17BDF\16NOK\15LDE\14ODB\13OVR\12NXM\11DPR\10RDY\7IEN\6RST\5LPB\4STE\3HEN\2DEN\1ENB"
62 
63 #define VV_OBITS \
64 "\10\20NIR\17BDF\16NOK\15OPT\13OVR\12NXM\11RFS\10RDY\7IEN\6RST\5INR\3HEN\2DEN\1ENB"
65 
66 /* device registers */
67 struct vvreg {
68 	short	vvicsr;		/* input csr */
69 	u_short	vviwc;		/* input word count */
70 	u_short	vviba;		/* input addr lo */
71 	u_short	vviea;		/* input addr hi */
72 	short	vvocsr;		/* output csr */
73 	u_short	vvowc;		/* output word count */
74 	u_short	vvoba;		/* output addr lo */
75 	u_short	vvoea;		/* output addr hi */
76 };
77 
78 #define	VVRETRY	7
79