|
|
1.1 root 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 [email protected]
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: * Copyright (c) 1982, 1986 The Regents of the University of California.
28: * All rights reserved.
29: *
30: * Redistribution and use in source and binary forms, with or without
31: * modification, are permitted provided that the following conditions
32: * are met:
33: * 1. Redistributions of source code must retain the above copyright
34: * notice, this list of conditions and the following disclaimer.
35: * 2. Redistributions in binary form must reproduce the above copyright
36: * notice, this list of conditions and the following disclaimer in the
37: * documentation and/or other materials provided with the distribution.
38: * 4. The name of the Laboratory may not be used to endorse or promote
39: * products derived from this software without specific prior written
40: * permission.
41: *
42: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52: * SUCH DAMAGE.
53: *
54: * @(#)mtio.h 7.4 (Berkeley) 8/31/88
55: */
56:
57: #ifndef _TAPE_STATUS_H_
58: #define _TAPE_STATUS_H_
59:
60: /*
61: * Tape status
62: */
63:
64: struct tape_status {
65: unsigned int mt_type;
66: unsigned int speed;
67: unsigned int density;
68: unsigned int flags;
69: # define TAPE_FLG_REWIND 0x1
70: # define TAPE_FLG_WP 0x2
71: };
72: #define TAPE_STATUS_COUNT (sizeof(struct tape_status)/sizeof(int))
73: #define TAPE_STATUS (('m'<<16) + 1)
74:
75: /*
76: * Constants for mt_type. These are the same
77: * for controllers compatible with the types listed.
78: */
79: #define MT_ISTS 0x01 /* TS-11 */
80: #define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
81: #define MT_ISTM 0x03 /* TM11/TE10 Unibus */
82: #define MT_ISMT 0x04 /* TM78/TU78 Massbus */
83: #define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */
84: #define MT_ISCPC 0x06 /* SUN */
85: #define MT_ISAR 0x07 /* SUN */
86: #define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */
87: #define MT_ISCY 0x09 /* CCI Cipher */
88: #define MT_ISSCSI 0x0a /* SCSI tape (all brands) */
89:
90:
91: /*
92: * Set status parameters
93: */
94:
95: struct tape_params {
96: unsigned int mt_operation;
97: unsigned int mt_repeat_count;
98: };
99:
100: /* operations */
101: #define MTWEOF 0 /* write an end-of-file record */
102: #define MTFSF 1 /* forward space file */
103: #define MTBSF 2 /* backward space file */
104: #define MTFSR 3 /* forward space record */
105: #define MTBSR 4 /* backward space record */
106: #define MTREW 5 /* rewind */
107: #define MTOFFL 6 /* rewind and put the drive offline */
108: #define MTNOP 7 /* no operation, sets status only */
109: #define MTCACHE 8 /* enable controller cache */
110: #define MTNOCACHE 9 /* disable controller cache */
111:
112:
113: /*
114: * U*x compatibility
115: */
116:
117: /* structure for MTIOCGET - mag tape get status command */
118:
119: struct mtget {
120: short mt_type; /* type of magtape device */
121: /* the following two registers are grossly device dependent */
122: short mt_dsreg; /* ``drive status'' register */
123: short mt_erreg; /* ``error'' register */
124: /* end device-dependent registers */
125: short mt_resid; /* residual count */
126: /* the following two are not yet implemented */
127: unsigned long mt_fileno; /* file number of current position */
128: unsigned long mt_blkno; /* block number of current position */
129: /* end not yet implemented */
130: };
131:
132:
133: /* mag tape io control commands */
134: #define MTIOCTOP _IOW('m', 1, struct tape_params)/* do a mag tape op */
135: #define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
136: #define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
137: #define MTIOCEEOT _IO('m', 4) /* enable EOT error */
138:
139:
140: #endif _TAPE_STATUS_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.