xref: /original-bsd/sys/vax/if/if_dmc.h (revision 05cf3734)
1 /*
2  * Copyright (c) 1982, 1986 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)if_dmc.h	7.5 (Berkeley) 06/28/90
8  */
9 
10 /*
11  * DMC-11 Interface
12  */
13 
14 struct dmcdevice {
15         char    bsel0;
16 	char 	bsel1;
17 	char	bsel2;
18 	char 	bsel3;
19 	short	sel4;
20 	short	sel6;
21 };
22 
23 /*
24  * dmc software packet encapsulation.  This allows the dmc
25  * link to be multiplexed among several protocols.
26  * The first eight bytes of the dmc header are garbage,
27  * since on a vax the uba has been known to mung these
28  * bytes.  The next two bytes encapsulate packet type.
29  */
30 struct dmc_header {
31 	char	dmc_buf[8];	/* space for uba on vax */
32 	short	dmc_type;	/* encapsulate packet type */
33 };
34 
35 /* packet types */
36 #define	DMC_IPTYPE	1
37 #define	DMC_TRAILER	2
38 #define	DMC_NTRAILER	16
39 
40 /*
41  * DMCMTU includes space for data (1024) +
42  * protocol header (256) + trailer descriptor (4).
43  * The software link encapsulation header (dmc_header)
44  * is handled separately.
45 	#define DMCMTU  1284
46  */
47 #define DMCMTU  1500
48 
49 #define	RDYSCAN	16	/* loop delay for RDYI after RQI */
50 
51 /* defines for bsel0 */
52 #define	DMC_BACCI	0
53 #define	DMC_CNTLI	1
54 #define	DMC_PERR	2
55 #define	DMC_BASEI	3
56 #define	DMC_WRITE	0		/* transmit block */
57 #define	DMC_READ	4		/* read block */
58 #define	DMC_RQI		0040		/* port request bit */
59 #define	DMC_IEI		0100		/* enable input interrupts */
60 #define	DMC_RDYI	0200		/* port ready */
61 #define	DMC0BITS	"\10\10RDI\7IEI\6RQI"
62 
63 /* defines for bsel1 */
64 #define	DMC_MCLR	0100		/* DMC11 Master Clear */
65 #define	DMC_RUN		0200		/* clock running */
66 #define	DMC1BITS	"\10\10RUN\7MCLR"
67 
68 /* defines for bsel2 */
69 #define	DMC_BACCO	0
70 #define	DMC_CNTLO	1
71 #define	DMC_OUX		0		/* transmit block */
72 #define	DMC_OUR		4		/* read block */
73 #define	DMC_IEO		0100		/* enable output interrupts */
74 #define	DMC_RDYO	0200		/* port available */
75 #define	DMC2BITS	"\10\10RDO\7IEO"
76 
77 /* defines for CNTLI mode */
78 #define	DMC_HDPLX	02000		/* half duplex DDCMP operation */
79 #define	DMC_SEC		04000		/* half duplex secondary station */
80 #define	DMC_MAINT	00400		/* enter maintenance mode */
81 
82 /* defines for BACCI/O and BASEI mode */
83 #define	DMC_XMEM	0140000		/* xmem bit position */
84 #define	DMC_CCOUNT	0037777		/* character count mask */
85 #define	DMC_RESUME	0002000		/* resume (BASEI only) */
86 
87 /* defines for CNTLO */
88 #define	DMC_CNTMASK	01777
89 
90 #define	DMC_DATACK	01
91 #define	DMC_TIMEOUT	02
92 #define	DMC_NOBUFS	04
93 #define	DMC_MAINTREC	010
94 #define	DMC_LOSTDATA	020
95 #define	DMC_DISCONN	0100
96 #define	DMC_START	0200
97 #define	DMC_NEXMEM	0400
98 #define	DMC_ERROR	01000
99 
100 #define	DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC)
101 #define	CNTLO_BITS	\
102    "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK"
103