1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: tape_status.h,v $
29 * Revision 2.7 91/05/14 16:01:44 mrt
30 * Correcting copyright
31 *
32 * Revision 2.6 91/05/13 06:02:28 af
33 * Modified tape_status structure to hold more info
34 * either way. Added flags field to hold special
35 * behavioural properties such as rewind-on-close.
36 * [91/05/12 af]
37 *
38 * Revision 2.5 91/03/16 14:43:42 rpd
39 * Fixed ioctl definitions for ANSI C.
40 * [91/02/20 rpd]
41 *
42 * Revision 2.4 91/02/05 17:10:21 mrt
43 * Changed to new Mach copyright
44 * [91/01/31 17:30:46 mrt]
45 *
46 * Revision 2.3 90/12/05 23:28:29 af
47 * Created.
48 *
49 * Revision 2.2 90/12/05 20:42:10 af
50 * Created, from BSD 4.3Reno mtio.h.
51 * [90/11/11 af]
52 *
53 */
54 /*
55 * Copyright (c) 1982, 1986 The Regents of the University of California.
56 * All rights reserved.
57 *
58 * Redistribution and use in source and binary forms are permitted
59 * provided that the above copyright notice and this paragraph are
60 * duplicated in all such forms and that any documentation,
61 * advertising materials, and other materials related to such
62 * distribution and use acknowledge that the software was developed
63 * by the University of California, Berkeley. The name of the
64 * University may not be used to endorse or promote products derived
65 * from this software without specific prior written permission.
66 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
67 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
68 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
69 *
70 * @(#)mtio.h 7.4 (Berkeley) 8/31/88
71 */
72
73 #ifndef _TAPE_STATUS_H_
74 #define _TAPE_STATUS_H_
75
76 /*
77 * Tape status
78 */
79
80 struct tape_status {
81 unsigned int mt_type;
82 unsigned int speed;
83 unsigned int density;
84 unsigned int flags;
85 # define TAPE_FLG_REWIND 0x1
86 # define TAPE_FLG_WP 0x2
87 };
88 #define TAPE_STATUS_COUNT (sizeof(struct tape_status)/sizeof(int))
89 #define TAPE_STATUS (('m'<<16) + 1)
90
91 /*
92 * Constants for mt_type. These are the same
93 * for controllers compatible with the types listed.
94 */
95 #define MT_ISTS 0x01 /* TS-11 */
96 #define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
97 #define MT_ISTM 0x03 /* TM11/TE10 Unibus */
98 #define MT_ISMT 0x04 /* TM78/TU78 Massbus */
99 #define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */
100 #define MT_ISCPC 0x06 /* SUN */
101 #define MT_ISAR 0x07 /* SUN */
102 #define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */
103 #define MT_ISCY 0x09 /* CCI Cipher */
104 #define MT_ISSCSI 0x0a /* SCSI tape (all brands) */
105
106
107 /*
108 * Set status parameters
109 */
110
111 struct tape_params {
112 unsigned int mt_operation;
113 unsigned int mt_repeat_count;
114 };
115
116 /* operations */
117 #define MTWEOF 0 /* write an end-of-file record */
118 #define MTFSF 1 /* forward space file */
119 #define MTBSF 2 /* backward space file */
120 #define MTFSR 3 /* forward space record */
121 #define MTBSR 4 /* backward space record */
122 #define MTREW 5 /* rewind */
123 #define MTOFFL 6 /* rewind and put the drive offline */
124 #define MTNOP 7 /* no operation, sets status only */
125 #define MTCACHE 8 /* enable controller cache */
126 #define MTNOCACHE 9 /* disable controller cache */
127
128
129 /*
130 * U*x compatibility
131 */
132
133 /* structure for MTIOCGET - mag tape get status command */
134
135 struct mtget {
136 short mt_type; /* type of magtape device */
137 /* the following two registers are grossly device dependent */
138 short mt_dsreg; /* ``drive status'' register */
139 short mt_erreg; /* ``error'' register */
140 /* end device-dependent registers */
141 short mt_resid; /* residual count */
142 /* the following two are not yet implemented */
143 unsigned long mt_fileno; /* file number of current position */
144 unsigned long mt_blkno; /* block number of current position */
145 /* end not yet implemented */
146 };
147
148
149 /* mag tape io control commands */
150 #define MTIOCTOP _IOW('m', 1, struct tape_params)/* do a mag tape op */
151 #define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
152 #define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
153 #define MTIOCEEOT _IO('m', 4) /* enable EOT error */
154
155
156 #endif _TAPE_STATUS_H_
Cache object: 7936a7a94c2c7e97d26946b0399d9027
|