xref: /netbsd/sys/arch/hp300/dev/ctreg.h (revision cd261664)
1 /*	$NetBSD: ctreg.h,v 1.11 2021/07/05 14:51:23 tsutsui Exp $	*/
2 
3 /*
4  * Copyright (c) 1982, 1990, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the University nor the names of its contributors
16  *    may be used to endorse or promote products derived from this software
17  *    without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  *	@(#)ctreg.h	8.1 (Berkeley) 6/10/93
32  */
33 
34 struct	ct_iocmd {
35 	char	unit;
36 	char	saddr;
37 	short	addr0;
38 	long	addr;
39 	char	nop2;
40 	char	slen;
41 	long	len;
42 	char	nop3;
43 	char	cmd;
44 };
45 
46 struct	ct_rscmd {
47 	char	unit;
48 	char	cmd;
49 };
50 
51 struct	ct_stat {
52 	char	c_vu;
53 	char	c_pend;
54 	short	c_ref;
55 	short	c_fef;
56 	short	c_aef;
57 	short	c_ief;
58 	short	c_blk0;
59 	long	c_blk;
60 	char	c_pad[4];
61 };
62 
63 struct	ct_ssmcmd {
64 	char	unit;
65 	char	cmd;
66 	short	refm;
67 	short	fefm;
68 	short	aefm;
69 	short	iefm;
70 };
71 
72 struct	ct_srcmd {
73 	char	unit;
74 	char	nop;
75 	char	cmd;
76 	char	param;
77 };
78 
79 struct	ct_soptcmd {
80 	char	unit;
81 	char	nop;
82 	char	cmd;
83 	char	opt;
84 };
85 
86 struct	ct_ulcmd {
87 	char	unit;
88 	char	cmd;
89 };
90 
91 struct	ct_wfmcmd {
92 	char	unit;
93 	char	cmd;
94 };
95 
96 struct	ct_clearcmd {
97 	char	unit;
98 	char	cmd;
99 };
100 
101 #define	CT7946ID	0x220
102 #define CT9145ID	0x268
103 #define	CT9144ID	0x260
104 #define	CT9144		0
105 #define	CT7912PID	0x209
106 #define	CT7914PID	0x20B
107 #define	CT88140		1
108 #define	CT35401ID	0x270
109 
110 /* convert bytes to 1k tape block and back */
111 #define CTBTOK(x)	((x) >> 10)
112 #define CTKTOB(x)	((x) << 10)
113 
114 #define	CTCTLR		15
115 
116 #define	REF_MASK	0x0
117 #define	FEF_MASK	0x0
118 #define	AEF_MASK	0x0
119 #define	IEF_MASK	0xF970
120 
121 #define	FEF_PF		0x0002
122 #define	FEF_REXMT	0x0001
123 #define	AEF_EOF		0x0010
124 #define	AEF_EOV		0x0008
125 
126 #define	C_READ		0x00
127 #define	C_WRITE		0x02
128 #define	C_CLEAR		0x08
129 #define	C_STATUS	0x0d
130 #define	C_SADDR		0x10
131 #define	C_SLEN		0x18
132 #define	C_SUNIT(x)	(0x20 | (x))
133 #define	C_SVOL(x)	(0x40 | (x))
134 #define	C_NOP		0x34
135 #define C_DESC		0x35
136 #define	C_SOPT		0x38
137 #define	C_SREL		0x3b
138 #define	C_SSM		0x3e
139 #define	C_WFM		0x49
140 #define	C_UNLOAD	0x4a
141 #define C_REL		0xc0
142 
143 #define	C_CMD		0x05
144 #define	C_EXEC		0x0e
145 #define	C_QSTAT		0x10
146 #define	C_TCMD		0x12
147 
148 #define C_CC            1
149 #define C_SKSPAR        2
150 #define	C_OPT		4
151 #define C_SPAR          4
152 #define C_IMRPT         8
153