Home | History | Annotate | Line # | Download | only in dev
ctreg.h revision 1.7
      1 /*	$NetBSD: ctreg.h,v 1.7 2001/05/27 09:09:05 kleink 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. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the University of
     18  *	California, Berkeley and its contributors.
     19  * 4. Neither the name of the University nor the names of its contributors
     20  *    may be used to endorse or promote products derived from this software
     21  *    without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33  * SUCH DAMAGE.
     34  *
     35  *	@(#)ctreg.h	8.1 (Berkeley) 6/10/93
     36  */
     37 
     38 struct	ct_iocmd {
     39 	char	unit;
     40 	char	saddr;
     41 	short	addr0;
     42 	long	addr;
     43 	char	nop2;
     44 	char	slen;
     45 	long	len;
     46 	char	nop3;
     47 	char	cmd;
     48 };
     49 
     50 struct	ct_rscmd {
     51 	char	unit;
     52 	char	cmd;
     53 };
     54 
     55 struct	ct_stat {
     56 	char	c_vu;
     57 	char	c_pend;
     58 	short	c_ref;
     59 	short	c_fef;
     60 	short	c_aef;
     61 	short	c_ief;
     62 	short	c_blk0;
     63 	long	c_blk;
     64 	char	c_pad[4];
     65 };
     66 
     67 struct	ct_ssmcmd {
     68 	char	unit;
     69 	char	cmd;
     70 	short	refm;
     71 	short	fefm;
     72 	short	aefm;
     73 	short	iefm;
     74 };
     75 
     76 struct	ct_srcmd {
     77 	char	unit;
     78 	char	nop;
     79 	char	cmd;
     80 	char	param;
     81 };
     82 
     83 struct	ct_soptcmd {
     84 	char	unit;
     85 	char	nop;
     86 	char	cmd;
     87 	char	opt;
     88 };
     89 
     90 struct	ct_ulcmd {
     91 	char	unit;
     92 	char	cmd;
     93 };
     94 
     95 struct	ct_wfmcmd {
     96 	char	unit;
     97 	char	cmd;
     98 };
     99 
    100 struct	ct_clearcmd {
    101 	char	unit;
    102 	char	cmd;
    103 };
    104 
    105 struct ct_describe {
    106 	u_int	d_iuw:16,	/* controller: installed unit word */
    107 		d_cmaxxfr:16,	/* controller: max transfer rate (Kb) */
    108 		d_ctype:8,	/* controller: controller type */
    109 		d_utype:8,	/* unit: unit type */
    110 		d_name:24,	/* unit: name (6 BCD digits) */
    111 		d_sectsize:16,	/* unit: # of bytes per block (sector) */
    112 		d_blkbuf:8,	/* unit: # of blocks which can be buffered */
    113 		d_burstsize:8,	/* unit: recommended burst size */
    114 		d_blocktime:16,	/* unit: block time (u-sec) */
    115 		d_uavexfr:16,	/* unit: average transfer rate (Kb) */
    116 		d_retry:16,	/* unit: optimal retry time (1/100-sec) */
    117 		d_access:16,	/* unit: access time param (1/100-sec) */
    118 		d_maxint:8,	/* unit: maximum interleave */
    119 		d_fvbyte:8,	/* unit: fixed volume byte */
    120 		d_rvbyte:8,	/* unit: removeable volume byte */
    121 		d_maxcyl:24,	/* volume: maximum cylinder */
    122 		d_maxhead:8,	/* volume: maximum head */
    123 		d_maxsect:16,	/* volume: maximum sector on track */
    124 		d_maxvsecth:16,	/* volume: maximum sector on volume (MSW) */
    125 		d_maxvsectl:32,	/* volume: maximum sector on volume (LSWs) */
    126 		d_interleave:8;	/* volume: current interleave */
    127  };
    128 
    129 #define	CT7946ID	0x220
    130 #define CT9145ID	0x268
    131 #define	CT9144ID	0x260
    132 #define	CT9144		0
    133 #define	CT7912PID	0x209
    134 #define	CT7914PID	0x20B
    135 #define	CT88140		1
    136 #define	CT35401ID	0x270
    137 
    138 /* convert bytes to 1k tape block and back */
    139 #define CTBTOK(x)	((x) >> 10)
    140 #define CTKTOB(x)	((x) << 10)
    141 
    142 #define	CTCTLR		15
    143 
    144 #define	REF_MASK	0x0
    145 #define	FEF_MASK	0x0
    146 #define	AEF_MASK	0x0
    147 #define	IEF_MASK	0xF970
    148 
    149 #define	FEF_PF		0x0002
    150 #define	FEF_REXMT	0x0001
    151 #define	AEF_EOF		0x0010
    152 #define	AEF_EOV		0x0008
    153 
    154 #define	C_READ		0x00
    155 #define	C_WRITE		0x02
    156 #define	C_CLEAR		0x08
    157 #define	C_STATUS	0x0d
    158 #define	C_SADDR		0x10
    159 #define	C_SLEN		0x18
    160 #define	C_SUNIT(x)	(0x20 | (x))
    161 #define	C_SVOL(x)	(0x40 | (x))
    162 #define	C_NOP		0x34
    163 #define C_DESC		0x35
    164 #define	C_SOPT		0x38
    165 #define	C_SREL		0x3b
    166 #define	C_SSM		0x3e
    167 #define	C_WFM		0x49
    168 #define	C_UNLOAD	0x4a
    169 #define C_REL		0xc0
    170 
    171 #define	C_CMD		0x05
    172 #define	C_EXEC		0x0e
    173 #define	C_QSTAT		0x10
    174 #define	C_TCMD		0x12
    175 
    176 #define C_CC            1
    177 #define C_SKSPAR        2
    178 #define	C_OPT		4
    179 #define C_SPAR          4
    180 #define C_IMRPT         8
    181