if_dmcreg.h revision 1.1 1 1.1 ragge /* $NetBSD: if_dmcreg.h,v 1.1 2001/05/06 17:36:04 ragge Exp $ */
2 1.1 ragge /*
3 1.1 ragge * Copyright (c) 1982, 1986 Regents of the University of California.
4 1.1 ragge * All rights reserved.
5 1.1 ragge *
6 1.1 ragge * Redistribution and use in source and binary forms, with or without
7 1.1 ragge * modification, are permitted provided that the following conditions
8 1.1 ragge * are met:
9 1.1 ragge * 1. Redistributions of source code must retain the above copyright
10 1.1 ragge * notice, this list of conditions and the following disclaimer.
11 1.1 ragge * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 ragge * notice, this list of conditions and the following disclaimer in the
13 1.1 ragge * documentation and/or other materials provided with the distribution.
14 1.1 ragge * 3. All advertising materials mentioning features or use of this software
15 1.1 ragge * must display the following acknowledgement:
16 1.1 ragge * This product includes software developed by the University of
17 1.1 ragge * California, Berkeley and its contributors.
18 1.1 ragge * 4. Neither the name of the University nor the names of its contributors
19 1.1 ragge * may be used to endorse or promote products derived from this software
20 1.1 ragge * without specific prior written permission.
21 1.1 ragge *
22 1.1 ragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.1 ragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 ragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 ragge * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.1 ragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1 ragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1 ragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1 ragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1 ragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1 ragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 ragge * SUCH DAMAGE.
33 1.1 ragge *
34 1.1 ragge * @(#)if_dmc.h 7.5 (Berkeley) 6/28/90
35 1.1 ragge */
36 1.1 ragge
37 1.1 ragge /*
38 1.1 ragge * DMC-11 Interface
39 1.1 ragge */
40 1.1 ragge
41 1.1 ragge #ifdef notdef
42 1.1 ragge struct dmcdevice {
43 1.1 ragge char bsel0;
44 1.1 ragge char bsel1;
45 1.1 ragge char bsel2;
46 1.1 ragge char bsel3;
47 1.1 ragge short sel4;
48 1.1 ragge short sel6;
49 1.1 ragge };
50 1.1 ragge #endif
51 1.1 ragge
52 1.1 ragge #define DMC_BSEL0 0
53 1.1 ragge #define DMC_BSEL1 1
54 1.1 ragge #define DMC_BSEL2 2
55 1.1 ragge #define DMC_BSEL3 3
56 1.1 ragge #define DMC_SEL4 4
57 1.1 ragge #define DMC_SEL6 6
58 1.1 ragge
59 1.1 ragge /*
60 1.1 ragge * dmc software packet encapsulation. This allows the dmc
61 1.1 ragge * link to be multiplexed among several protocols.
62 1.1 ragge * The first eight bytes of the dmc header are garbage,
63 1.1 ragge * since on a vax the uba has been known to mung these
64 1.1 ragge * bytes. The next two bytes encapsulate packet type.
65 1.1 ragge */
66 1.1 ragge struct dmc_header {
67 1.1 ragge char dmc_buf[8]; /* space for uba on vax */
68 1.1 ragge short dmc_type; /* encapsulate packet type */
69 1.1 ragge };
70 1.1 ragge
71 1.1 ragge /* packet types */
72 1.1 ragge #define DMC_IPTYPE 1
73 1.1 ragge #define DMC_TRAILER 2
74 1.1 ragge #define DMC_NTRAILER 16
75 1.1 ragge
76 1.1 ragge /*
77 1.1 ragge * DMCMTU includes space for data (1024) +
78 1.1 ragge * protocol header (256) + trailer descriptor (4).
79 1.1 ragge * The software link encapsulation header (dmc_header)
80 1.1 ragge * is handled separately.
81 1.1 ragge #define DMCMTU 1284
82 1.1 ragge */
83 1.1 ragge #define DMCMTU 1500
84 1.1 ragge
85 1.1 ragge #define RDYSCAN 16 /* loop delay for RDYI after RQI */
86 1.1 ragge
87 1.1 ragge /* defines for bsel0 */
88 1.1 ragge #define DMC_BACCI 0
89 1.1 ragge #define DMC_CNTLI 1
90 1.1 ragge #define DMC_PERR 2
91 1.1 ragge #define DMC_BASEI 3
92 1.1 ragge #define DMC_WRITE 0 /* transmit block */
93 1.1 ragge #define DMC_READ 4 /* read block */
94 1.1 ragge #define DMC_RQI 0040 /* port request bit */
95 1.1 ragge #define DMC_IEI 0100 /* enable input interrupts */
96 1.1 ragge #define DMC_RDYI 0200 /* port ready */
97 1.1 ragge #define DMC0BITS "\10\10RDI\7IEI\6RQI"
98 1.1 ragge
99 1.1 ragge /* defines for bsel1 */
100 1.1 ragge #define DMC_MCLR 0100 /* DMC11 Master Clear */
101 1.1 ragge #define DMC_RUN 0200 /* clock running */
102 1.1 ragge #define DMC1BITS "\10\10RUN\7MCLR"
103 1.1 ragge
104 1.1 ragge /* defines for bsel2 */
105 1.1 ragge #define DMC_BACCO 0
106 1.1 ragge #define DMC_CNTLO 1
107 1.1 ragge #define DMC_OUX 0 /* transmit block */
108 1.1 ragge #define DMC_OUR 4 /* read block */
109 1.1 ragge #define DMC_IEO 0100 /* enable output interrupts */
110 1.1 ragge #define DMC_RDYO 0200 /* port available */
111 1.1 ragge #define DMC2BITS "\10\10RDO\7IEO"
112 1.1 ragge
113 1.1 ragge /* defines for CNTLI mode */
114 1.1 ragge #define DMC_HDPLX 02000 /* half duplex DDCMP operation */
115 1.1 ragge #define DMC_SEC 04000 /* half duplex secondary station */
116 1.1 ragge #define DMC_MAINT 00400 /* enter maintenance mode */
117 1.1 ragge
118 1.1 ragge /* defines for BACCI/O and BASEI mode */
119 1.1 ragge #define DMC_XMEM 0140000 /* xmem bit position */
120 1.1 ragge #define DMC_CCOUNT 0037777 /* character count mask */
121 1.1 ragge #define DMC_RESUME 0002000 /* resume (BASEI only) */
122 1.1 ragge
123 1.1 ragge /* defines for CNTLO */
124 1.1 ragge #define DMC_CNTMASK 01777
125 1.1 ragge
126 1.1 ragge #define DMC_DATACK 01
127 1.1 ragge #define DMC_TIMEOUT 02
128 1.1 ragge #define DMC_NOBUFS 04
129 1.1 ragge #define DMC_MAINTREC 010
130 1.1 ragge #define DMC_LOSTDATA 020
131 1.1 ragge #define DMC_DISCONN 0100
132 1.1 ragge #define DMC_START 0200
133 1.1 ragge #define DMC_NEXMEM 0400
134 1.1 ragge #define DMC_ERROR 01000
135 1.1 ragge
136 1.1 ragge #define DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC)
137 1.1 ragge #define CNTLO_BITS \
138 1.1 ragge "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK"
139