xref: /original-bsd/sys/sys/mtio.h (revision 210ce081)
1 /*
2  * Copyright (c) 1982, 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)mtio.h	7.5 (Berkeley) 06/28/90
8  */
9 
10 /*
11  * Structures and definitions for mag tape io control commands
12  */
13 
14 /* structure for MTIOCTOP - mag tape op command */
15 struct mtop {
16 	short	mt_op;		/* operations defined below */
17 	daddr_t	mt_count;	/* how many of them */
18 };
19 
20 /* operations */
21 #define MTWEOF		0	/* write an end-of-file record */
22 #define MTFSF		1	/* forward space file */
23 #define MTBSF		2	/* backward space file */
24 #define MTFSR		3	/* forward space record */
25 #define MTBSR		4	/* backward space record */
26 #define MTREW		5	/* rewind */
27 #define MTOFFL		6	/* rewind and put the drive offline */
28 #define MTNOP		7	/* no operation, sets status only */
29 #define MTCACHE		8	/* enable controller cache */
30 #define MTNOCACHE	9	/* disable controller cache */
31 
32 /* structure for MTIOCGET - mag tape get status command */
33 
34 struct mtget {
35 	short	mt_type;	/* type of magtape device */
36 /* the following two registers are grossly device dependent */
37 	short	mt_dsreg;	/* ``drive status'' register */
38 	short	mt_erreg;	/* ``error'' register */
39 /* end device-dependent registers */
40 	short	mt_resid;	/* residual count */
41 /* the following two are not yet implemented */
42 	daddr_t	mt_fileno;	/* file number of current position */
43 	daddr_t	mt_blkno;	/* block number of current position */
44 /* end not yet implemented */
45 };
46 
47 /*
48  * Constants for mt_type byte.  These are the same
49  * for controllers compatible with the types listed.
50  */
51 #define	MT_ISTS		0x01		/* TS-11 */
52 #define	MT_ISHT		0x02		/* TM03 Massbus: TE16, TU45, TU77 */
53 #define	MT_ISTM		0x03		/* TM11/TE10 Unibus */
54 #define	MT_ISMT		0x04		/* TM78/TU78 Massbus */
55 #define	MT_ISUT		0x05		/* SI TU-45 emulation on Unibus */
56 #define	MT_ISCPC	0x06		/* SUN */
57 #define	MT_ISAR		0x07		/* SUN */
58 #define	MT_ISTMSCP	0x08		/* DEC TMSCP protocol (TU81, TK50) */
59 #define	MT_ISCY		0x09		/* CCI Cipher */
60 
61 /* mag tape io control commands */
62 #define	MTIOCTOP	_IOW('m', 1, struct mtop)	/* do a mag tape op */
63 #define	MTIOCGET	_IOR('m', 2, struct mtget)	/* get tape status */
64 #define MTIOCIEOT	_IO('m', 3)			/* ignore EOT error */
65 #define MTIOCEEOT	_IO('m', 4)			/* enable EOT error */
66 
67 #ifndef KERNEL
68 #define	DEFTAPE	"/dev/rmt12"
69 #endif
70