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