1227569Sphilip/*	$NetBSD: if_dmcreg.h,v 1.1.24.4 2005/03/04 16:49:52 skrll Exp $	*/
2300607Sarybchik/*
3283514Sarybchik * Copyright (c) 1982, 1986 Regents of the University of California.
4227569Sphilip * All rights reserved.
5227569Sphilip *
6283514Sarybchik * Redistribution and use in source and binary forms, with or without
7227569Sphilip * modification, are permitted provided that the following conditions
8283514Sarybchik * are met:
9283514Sarybchik * 1. Redistributions of source code must retain the above copyright
10283514Sarybchik *    notice, this list of conditions and the following disclaimer.
11283514Sarybchik * 2. Redistributions in binary form must reproduce the above copyright
12283514Sarybchik *    notice, this list of conditions and the following disclaimer in the
13283514Sarybchik *    documentation and/or other materials provided with the distribution.
14283514Sarybchik * 3. Neither the name of the University nor the names of its contributors
15283514Sarybchik *    may be used to endorse or promote products derived from this software
16283514Sarybchik *    without specific prior written permission.
17283514Sarybchik *
18283514Sarybchik * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19283514Sarybchik * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20283514Sarybchik * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21283514Sarybchik * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22283514Sarybchik * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23283514Sarybchik * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24283514Sarybchik * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25283514Sarybchik * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26283514Sarybchik * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27283514Sarybchik * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28283514Sarybchik * SUCH DAMAGE.
29227569Sphilip *
30227569Sphilip *	@(#)if_dmc.h	7.5 (Berkeley) 6/28/90
31228078Sphilip */
32228078Sphilip
33228078Sphilip/*
34227569Sphilip * DMC-11 Interface
35227569Sphilip */
36227569Sphilip
37283514Sarybchik#ifdef notdef
38299320Sarybchikstruct dmcdevice {
39283514Sarybchik	char	bsel0;
40291436Sarybchik	char	bsel1;
41299610Sarybchik	char	bsel2;
42283514Sarybchik	char	bsel3;
43283514Sarybchik	short	sel4;
44283514Sarybchik	short	sel6;
45299610Sarybchik};
46283514Sarybchik#endif
47283514Sarybchik
48283514Sarybchik#define	DMC_BSEL0	0
49291436Sarybchik#define DMC_BSEL1	1
50299610Sarybchik#define DMC_BSEL2	2
51283514Sarybchik#define DMC_BSEL3	3
52283514Sarybchik#define DMC_SEL4	4
53283514Sarybchik#define DMC_SEL6	6
54283514Sarybchik
55283514Sarybchik/*
56291436Sarybchik * dmc software packet encapsulation.  This allows the dmc
57299610Sarybchik * link to be multiplexed among several protocols.
58283514Sarybchik * The first eight bytes of the dmc header are garbage,
59283514Sarybchik * since on a vax the uba has been known to mung these
60283514Sarybchik * bytes.  The next two bytes encapsulate packet type.
61283514Sarybchik */
62283514Sarybchikstruct dmc_header {
63291436Sarybchik	char	dmc_buf[8];	/* space for uba on vax */
64299610Sarybchik	short	dmc_type;	/* encapsulate packet type */
65283514Sarybchik};
66283514Sarybchik
67283514Sarybchik/* packet types */
68283514Sarybchik#define	DMC_IPTYPE	1
69291436Sarybchik#define	DMC_TRAILER	2
70299610Sarybchik#define	DMC_NTRAILER	16
71283514Sarybchik
72283514Sarybchik/*
73283514Sarybchik * DMCMTU includes space for data (1024) +
74283514Sarybchik * protocol header (256) + trailer descriptor (4).
75293807Sarybchik * The software link encapsulation header (dmc_header)
76299610Sarybchik * is handled separately.
77293807Sarybchik	#define DMCMTU  1284
78293807Sarybchik */
79293807Sarybchik#define DMCMTU  1500
80293807Sarybchik
81293890Sarybchik#define	RDYSCAN	16	/* loop delay for RDYI after RQI */
82293890Sarybchik
83293807Sarybchik/* defines for bsel0 */
84299610Sarybchik#define	DMC_BACCI	0
85293807Sarybchik#define	DMC_CNTLI	1
86293807Sarybchik#define	DMC_PERR	2
87293807Sarybchik#define	DMC_BASEI	3
88293807Sarybchik#define	DMC_WRITE	0		/* transmit block */
89283514Sarybchik#define	DMC_READ	4		/* read block */
90299610Sarybchik#define	DMC_RQI		0040		/* port request bit */
91283514Sarybchik#define	DMC_IEI		0100		/* enable input interrupts */
92283514Sarybchik#define	DMC_RDYI	0200		/* port ready */
93283514Sarybchik#define	DMC0BITS	"\10\10RDI\7IEI\6RQI"
94283514Sarybchik
95283514Sarybchik/* defines for bsel1 */
96283514Sarybchik#define	DMC_MCLR	0100		/* DMC11 Master Clear */
97283514Sarybchik#define	DMC_RUN		0200		/* clock running */
98283514Sarybchik#define	DMC1BITS	"\10\10RUN\7MCLR"
99299610Sarybchik
100283514Sarybchik/* defines for bsel2 */
101283514Sarybchik#define	DMC_BACCO	0
102283514Sarybchik#define	DMC_CNTLO	1
103283514Sarybchik#define	DMC_OUX		0		/* transmit block */
104291436Sarybchik#define	DMC_OUR		4		/* read block */
105299610Sarybchik#define	DMC_IEO		0100		/* enable output interrupts */
106283514Sarybchik#define	DMC_RDYO	0200		/* port available */
107283514Sarybchik#define	DMC2BITS	"\10\10RDO\7IEO"
108283514Sarybchik
109299610Sarybchik/* defines for CNTLI mode */
110283514Sarybchik#define	DMC_HDPLX	02000		/* half duplex DDCMP operation */
111283514Sarybchik#define	DMC_SEC		04000		/* half duplex secondary station */
112291436Sarybchik#define	DMC_MAINT	00400		/* enter maintenance mode */
113299610Sarybchik
114283514Sarybchik/* defines for BACCI/O and BASEI mode */
115283514Sarybchik#define	DMC_XMEM	0140000		/* xmem bit position */
116283514Sarybchik#define	DMC_CCOUNT	0037777		/* character count mask */
117283514Sarybchik#define	DMC_RESUME	0002000		/* resume (BASEI only) */
118283514Sarybchik
119283514Sarybchik/* defines for CNTLO */
120283514Sarybchik#define	DMC_CNTMASK	01777
121283514Sarybchik
122283514Sarybchik#define	DMC_DATACK	01
123283514Sarybchik#define	DMC_TIMEOUT	02
124283514Sarybchik#define	DMC_NOBUFS	04
125299610Sarybchik#define	DMC_MAINTREC	010
126283514Sarybchik#define	DMC_LOSTDATA	020
127283514Sarybchik#define	DMC_DISCONN	0100
128299320Sarybchik#define	DMC_START	0200
129283514Sarybchik#define	DMC_NEXMEM	0400
130283514Sarybchik#define	DMC_ERROR	01000
131283514Sarybchik
132299517Sarybchik#define	DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC)
133299610Sarybchik#define	CNTLO_BITS	\
134299610Sarybchik   "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK"
135283514Sarybchik