xref: /netbsd-src/sys/dev/gpib/ctreg.h (revision b6a2ef75694885c4bc28bfdbf162917cf76614a8)
1*b6a2ef75Sperry /*	$NetBSD: ctreg.h,v 1.4 2007/12/25 18:33:37 perry Exp $	*/
2c7fc491bSgmcgarry 
3c7fc491bSgmcgarry /*
4c7fc491bSgmcgarry  * Copyright (c) 1982, 1990, 1993
5c7fc491bSgmcgarry  *	The Regents of the University of California.  All rights reserved.
6c7fc491bSgmcgarry  *
7c7fc491bSgmcgarry  * Redistribution and use in source and binary forms, with or without
8c7fc491bSgmcgarry  * modification, are permitted provided that the following conditions
9c7fc491bSgmcgarry  * are met:
10c7fc491bSgmcgarry  * 1. Redistributions of source code must retain the above copyright
11c7fc491bSgmcgarry  *    notice, this list of conditions and the following disclaimer.
12c7fc491bSgmcgarry  * 2. Redistributions in binary form must reproduce the above copyright
13c7fc491bSgmcgarry  *    notice, this list of conditions and the following disclaimer in the
14c7fc491bSgmcgarry  *    documentation and/or other materials provided with the distribution.
15aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
16c7fc491bSgmcgarry  *    may be used to endorse or promote products derived from this software
17c7fc491bSgmcgarry  *    without specific prior written permission.
18c7fc491bSgmcgarry  *
19c7fc491bSgmcgarry  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20c7fc491bSgmcgarry  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21c7fc491bSgmcgarry  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22c7fc491bSgmcgarry  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23c7fc491bSgmcgarry  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24c7fc491bSgmcgarry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25c7fc491bSgmcgarry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26c7fc491bSgmcgarry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27c7fc491bSgmcgarry  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28c7fc491bSgmcgarry  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29c7fc491bSgmcgarry  * SUCH DAMAGE.
30c7fc491bSgmcgarry  *
31c7fc491bSgmcgarry  *	@(#)ctreg.h	8.1 (Berkeley) 6/10/93
32c7fc491bSgmcgarry  */
33c7fc491bSgmcgarry 
34c7fc491bSgmcgarry struct	ct_iocmd {
35c7fc491bSgmcgarry 	u_int8_t	unit;		/* punit */
36c7fc491bSgmcgarry 	u_int8_t	saddr;		/* CS80CMD_SADDR */
37c7fc491bSgmcgarry 	u_int16_t	addr0;		/* always 0 */
38c7fc491bSgmcgarry 	u_int32_t	addr;		/* blkno */
39c7fc491bSgmcgarry 	u_int8_t	nop2;		/* CS80CMD_NOP */
40c7fc491bSgmcgarry 	u_int8_t	slen;		/* CS80CMD_SLEN */
41c7fc491bSgmcgarry 	u_int32_t	len;		/* 0 (for rewind) /resid */
42c7fc491bSgmcgarry 	u_int8_t	nop3;		/* CS80CMD_NOP */
43c7fc491bSgmcgarry 	u_int8_t	cmd;		/* CS80CMD_READ/CS80CMD_WRITE */
44*b6a2ef75Sperry } __packed;
45c7fc491bSgmcgarry 
46c7fc491bSgmcgarry struct	ct_rscmd {
47c7fc491bSgmcgarry 	u_int8_t	unit;
48c7fc491bSgmcgarry 	u_int8_t	cmd;
49*b6a2ef75Sperry } __packed;
50c7fc491bSgmcgarry 
51c7fc491bSgmcgarry struct	ct_ulcmd {
52c7fc491bSgmcgarry 	u_int8_t	unit;
53c7fc491bSgmcgarry 	u_int8_t	cmd;
54*b6a2ef75Sperry } __packed;
55c7fc491bSgmcgarry 
56c7fc491bSgmcgarry struct	ct_wfmcmd {
57c7fc491bSgmcgarry 	u_int8_t	unit;
58c7fc491bSgmcgarry 	u_int8_t	cmd;
59*b6a2ef75Sperry } __packed;
60c7fc491bSgmcgarry 
61c7fc491bSgmcgarry #define	CT7946ID	0x220
62c7fc491bSgmcgarry #define CT9145ID	0x268
63c7fc491bSgmcgarry #define	CT9144ID	0x260
64c7fc491bSgmcgarry #define	CT9144		0
65c7fc491bSgmcgarry #define	CT7912PID	0x209
66c7fc491bSgmcgarry #define	CT7914PID	0x20B
67c7fc491bSgmcgarry #define	CT88140		1
68c7fc491bSgmcgarry #define	CT35401ID	0x270
69c7fc491bSgmcgarry 
70c7fc491bSgmcgarry /* convert bytes to 1k tape block and back */
71c7fc491bSgmcgarry #define CTBTOK(x)	((x) >> 10)
72c7fc491bSgmcgarry #define CTKTOB(x)	((x) << 10)
73