xref: /original-bsd/sys/sys/mtio.h (revision c3e32dec)
1 /*
2  * Copyright (c) 1982, 1986, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)mtio.h	8.1 (Berkeley) 06/02/93
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 #define MT_ISCT		0x0a		/* HP 1/4 tape */
61 #define MT_ISFHP	0x0b		/* HP 7980 1/2 tape */
62 #define MT_ISEXABYTE	0x0c		/* Exabyte */
63 #define MT_ISEXA8200	0x0c		/* Exabyte EXB-8200 */
64 #define MT_ISEXA8500	0x0d		/* Exabyte EXB-8500 */
65 #define MT_ISVIPER1	0x0e		/* Archive Viper-150 */
66 #define MT_ISPYTHON	0x0f		/* Archive Python (DAT) */
67 #define MT_ISHPDAT	0x10		/* HP 35450A DAT drive */
68 #define MT_ISMFOUR	0x11		/* M4 Data 1/2 9track drive */
69 #define MT_ISTK50	0x12		/* DEC SCSI TK50 */
70 #define MT_ISMT02	0x13		/* Emulex MT02 SCSI tape controller */
71 
72 /* mag tape io control commands */
73 #define	MTIOCTOP	_IOW('m', 1, struct mtop)	/* do a mag tape op */
74 #define	MTIOCGET	_IOR('m', 2, struct mtget)	/* get tape status */
75 #define MTIOCIEOT	_IO('m', 3)			/* ignore EOT error */
76 #define MTIOCEEOT	_IO('m', 4)			/* enable EOT error */
77 
78 #ifndef KERNEL
79 #define	DEFTAPE	"/dev/rmt12"
80 #endif
81 
82 #ifdef	KERNEL
83 /*
84  * minor device number
85  */
86 
87 #define	T_UNIT		003		/* unit selection */
88 #define	T_NOREWIND	004		/* no rewind on close */
89 #define	T_DENSEL	030		/* density select */
90 #define	T_800BPI	000		/* select  800 bpi */
91 #define	T_1600BPI	010		/* select 1600 bpi */
92 #define	T_6250BPI	020		/* select 6250 bpi */
93 #define	T_BADBPI	030		/* undefined selection */
94 #endif
95