Deleted Added
full compact
mtio.4 (119893) mtio.4 (131530)
1.\" Copyright (c) 1996
2.\" Mike Pritchard <mpp@FreeBSD.org>. All rights reserved.
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" @(#)mtio.4 8.1 (Berkeley) 6/5/93
1.\" Copyright (c) 1996
2.\" Mike Pritchard <mpp@FreeBSD.org>. All rights reserved.
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\" The Regents of the University of California. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\" must display the following acknowledgement:
17.\" This product includes software developed by the University of
18.\" California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\" may be used to endorse or promote products derived from this software
21.\" without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\" @(#)mtio.4 8.1 (Berkeley) 6/5/93
36.\" $FreeBSD: head/share/man/man4/mtio.4 119893 2003-09-08 19:57:22Z ru $
36.\" $FreeBSD: head/share/man/man4/mtio.4 131530 2004-07-03 18:29:24Z ru $
37.\"
38.Dd February 11, 1996
39.Dt MTIO 4
40.Os
41.Sh NAME
42.Nm mtio
43.Nd FreeBSD magtape interface
44.Sh DESCRIPTION
45The special files
46named
47.Pa /dev/[n]sa*
48refer to SCSI tape drives,
49which may be attached to the system.
50.Pa /dev/[n]sa*.ctl
51are control devices that can be used to issue ioctls to the SCSI
52tape driver to set parameters that are required to last beyond the
53unmounting of a tape.
54.Pp
55.Pp
56The rewind devices automatically rewind
57when the last requested read, write or seek has finished, or the end of the tape
58has been reached.
59The letter
60.Ql n
61is usually prepended to
62the name of the no-rewind devices.
63.Pp
64Tapes can be written with either fixed length records or variable length
37.\"
38.Dd February 11, 1996
39.Dt MTIO 4
40.Os
41.Sh NAME
42.Nm mtio
43.Nd FreeBSD magtape interface
44.Sh DESCRIPTION
45The special files
46named
47.Pa /dev/[n]sa*
48refer to SCSI tape drives,
49which may be attached to the system.
50.Pa /dev/[n]sa*.ctl
51are control devices that can be used to issue ioctls to the SCSI
52tape driver to set parameters that are required to last beyond the
53unmounting of a tape.
54.Pp
55.Pp
56The rewind devices automatically rewind
57when the last requested read, write or seek has finished, or the end of the tape
58has been reached.
59The letter
60.Ql n
61is usually prepended to
62the name of the no-rewind devices.
63.Pp
64Tapes can be written with either fixed length records or variable length
65records. See
65records.
66See
66.Xr sa 4
67for more information.
68Two end-of-file markers mark the end of a tape, and
69one end-of-file marker marks the end of a tape file.
70If the tape is not to be rewound it is positioned with the
71head in between the two tape marks, where the next write
72will over write the second end-of-file marker.
73.Pp
74All of the magtape devices may be manipulated with the
75.Xr mt 1
76command.
77.Pp
78A number of
79.Xr ioctl 2
80operations are available
81on raw magnetic tape.
82The following definitions are from
83.In sys/mtio.h :
84.Bd -literal
85#ifndef _SYS_MTIO_H_
86#define _SYS_MTIO_H_
87
88#ifndef _KERNEL
89#include <sys/types.h>
90#endif
91#include <sys/ioccom.h>
92
93/*
94 * Structures and definitions for mag tape io control commands
95 */
96
97/* structure for MTIOCTOP - mag tape op command */
98struct mtop {
99 short mt_op; /* operations defined below */
100 daddr_t mt_count; /* how many of them */
101};
102
103/* operations */
104#define MTWEOF 0 /* write an end-of-file record */
105#define MTFSF 1 /* forward space file */
106#define MTBSF 2 /* backward space file */
107#define MTFSR 3 /* forward space record */
108#define MTBSR 4 /* backward space record */
109#define MTREW 5 /* rewind */
110#define MTOFFL 6 /* rewind and put the drive offline */
111#define MTNOP 7 /* no operation, sets status only */
112#define MTCACHE 8 /* enable controller cache */
113#define MTNOCACHE 9 /* disable controller cache */
114
115#if defined(__FreeBSD__)
116/* Set block size for device. If device is a variable size dev */
117/* a non zero parameter will change the device to a fixed block size */
118/* device with block size set to that of the parameter passed in. */
119/* Resetting the block size to 0 will restore the device to a variable */
120/* block size device. */
121
122#define MTSETBSIZ 10
123
124/* Set density values for device. Sets the value for the opened mode only. */
125
126#define MTSETDNSTY 11
127
128#define MTERASE 12 /* erase to EOM */
129#define MTEOD 13 /* Space to EOM */
130#define MTCOMP 14 /* select compression mode 0=off, 1=def */
131#define MTRETENS 15 /* re-tension tape */
132#define MTWSS 16 /* write setmark(s) */
133#define MTFSS 17 /* forward space setmark */
134#define MTBSS 18 /* backward space setmark */
135
136#define MT_COMP_ENABLE 0xffffffff
137#define MT_COMP_DISABLED 0xfffffffe
138#define MT_COMP_UNSUPP 0xfffffffd
139
140/*
141 * Values in mt_dsreg that say what the device is doing
142 */
143#define MTIO_DSREG_NIL 0 /* Unknown */
144#define MTIO_DSREG_REST 1 /* Doing Nothing */
145#define MTIO_DSREG_RBSY 2 /* Communicating with tape (but no motion) */
146#define MTIO_DSREG_WR 20 /* Writing */
147#define MTIO_DSREG_FMK 21 /* Writing Filemarks */
148#define MTIO_DSREG_ZER 22 /* Erasing */
149#define MTIO_DSREG_RD 30 /* Reading */
150#define MTIO_DSREG_FWD 40 /* Spacing Forward */
151#define MTIO_DSREG_REV 41 /* Spacing Reverse */
152#define MTIO_DSREG_POS 42 /* Hardware Positioning (direction unknown) */
153#define MTIO_DSREG_REW 43 /* Rewinding */
154#define MTIO_DSREG_TEN 44 /* Retensioning */
155#define MTIO_DSREG_UNL 45 /* Unloading */
156#define MTIO_DSREG_LD 46 /* Loading */
157
158#endif /* __FreeBSD__ */
159
160/* structure for MTIOCGET - mag tape get status command */
161
162struct mtget {
163 short mt_type; /* type of magtape device */
164/* the following two registers are grossly device dependent */
165 short mt_dsreg; /* ``drive status'' register */
166 short mt_erreg; /* ``error'' register */
167/* end device-dependent registers */
168 short mt_resid; /* residual count */
169#if defined (__FreeBSD__)
170 daddr_t mt_blksiz; /* presently operating blocksize */
171 daddr_t mt_density; /* presently operating density */
172 u_int32_t mt_comp; /* presently operating compression */
173 daddr_t mt_blksiz0; /* blocksize for mode 0 */
174 daddr_t mt_blksiz1; /* blocksize for mode 1 */
175 daddr_t mt_blksiz2; /* blocksize for mode 2 */
176 daddr_t mt_blksiz3; /* blocksize for mode 3 */
177 daddr_t mt_density0; /* density for mode 0 */
178 daddr_t mt_density1; /* density for mode 1 */
179 daddr_t mt_density2; /* density for mode 2 */
180 daddr_t mt_density3; /* density for mode 3 */
181/* the following are not yet implemented */
182 u_int32_t mt_comp0; /* compression type for mode 0 */
183 u_int32_t mt_comp1; /* compression type for mode 1 */
184 u_int32_t mt_comp2; /* compression type for mode 2 */
185 u_int32_t mt_comp3; /* compression type for mode 3 */
186/* end not yet implemented */
187#endif
188 daddr_t mt_fileno; /* relative file number of current position */
189 daddr_t mt_blkno; /* relative block number of current position */
190};
191
192/* structure for MTIOCERRSTAT - tape get error status command */
193/* really only supported for SCSI tapes right now */
194struct scsi_tape_errors {
195 /*
196 * These are latched from the last command that had a SCSI
197 * Check Condition noted for these operations. The act
198 * of issuing an MTIOCERRSTAT unlatches and clears them.
199 */
200 u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */
201 u_int32_t io_resid; /* residual count from last Data I/O */
202 u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */
203 u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */
204 u_int32_t ctl_resid; /* residual count from last Control I/O */
205 u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */
206 /*
207 * These are the read and write cumulative error counters.
208 * (how to reset cumulative error counters is not yet defined).
209 * (not implemented as yet but space is being reserved for them)
210 */
211 struct {
212 u_int32_t retries; /* total # retries performed */
213 u_int32_t corrected; /* total # corrections performed */
214 u_int32_t processed; /* total # corrections successful */
215 u_int32_t failures; /* total # corrections/retries failed */
216 u_int64_t nbytes; /* total # bytes processed */
217 } wterr, rderr;
218};
219
220union mterrstat {
221 struct scsi_tape_errors scsi_errstat;
222 char _reserved_padding[256];
223};
224
225/*
226 * Constants for mt_type byte. These are the same
227 * for controllers compatible with the types listed.
228 */
229#define MT_ISTS 0x01 /* TS-11 */
230#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
231#define MT_ISTM 0x03 /* TM11/TE10 Unibus */
232#define MT_ISMT 0x04 /* TM78/TU78 Massbus */
233#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */
234#define MT_ISCPC 0x06 /* SUN */
235#define MT_ISAR 0x07 /* SUN */
236#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */
237#define MT_ISCY 0x09 /* CCI Cipher */
238#define MT_ISCT 0x0a /* HP 1/4 tape */
239#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */
240#define MT_ISEXABYTE 0x0c /* Exabyte */
241#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */
242#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */
243#define MT_ISVIPER1 0x0e /* Archive Viper-150 */
244#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */
245#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */
246#define MT_ISMFOUR 0x11 /* M4 Data 1/2 9track drive */
247#define MT_ISTK50 0x12 /* DEC SCSI TK50 */
248#define MT_ISMT02 0x13 /* Emulex MT02 SCSI tape controller */
249
250/* mag tape io control commands */
251#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
252#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
253/* these two do not appear to be used anywhere */
254#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
255#define MTIOCEEOT _IO('m', 4) /* enable EOT error */
256/*
257 * When more SCSI-3 SSC (streaming device) devices are out there
258 * that support the full 32 byte type 2 structure, we'll have to
259 * rethink these ioctls to support all the entities they haul into
260 * the picture (64 bit blocks, logical file record numbers, etc..).
261 */
262#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /* get logical blk addr */
263#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /* get hardware blk addr */
264#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /* seek to logical blk addr */
265#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /* seek to hardware blk addr */
266#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
267/*
268 * Set EOT model- argument is number of filemarks to end a tape with.
269 * Note that not all possible values will be accepted.
270 */
271#define MTIOCSETEOTMODEL _IOW('m', 8, u_int32_t)
272/* Get current EOT model */
273#define MTIOCGETEOTMODEL _IOR('m', 8, u_int32_t)
274
275#ifndef _KERNEL
276#define DEFTAPE "/dev/nsa0"
277#endif
278
279#ifdef _KERNEL
280/*
281 * minor device number
282 */
283
284#define T_UNIT 003 /* unit selection */
285#define T_NOREWIND 004 /* no rewind on close */
286#define T_DENSEL 030 /* density select */
287#define T_800BPI 000 /* select 800 bpi */
288#define T_1600BPI 010 /* select 1600 bpi */
289#define T_6250BPI 020 /* select 6250 bpi */
290#define T_BADBPI 030 /* undefined selection */
291#endif
292
293#endif /* !_SYS_MTIO_H_ */
294.Ed
295.Sh FILES
296.Bl -tag -width /dev/[n]sa* -compact
297.It Pa /dev/[n]sa*
298.El
299.Sh SEE ALSO
300.Xr mt 1 ,
301.Xr tar 1 ,
302.Xr ast 4 ,
303.Xr sa 4
304.Sh HISTORY
305The
306.Nm
307manual appeared in
308.Bx 4.2 .
309An i386 version first appeared in
310.Fx 2.2 .
311.Sh BUGS
312The status should be returned in a device independent format.
313.Pp
314The special file naming should be redone in a more consistent and
315understandable manner.
67.Xr sa 4
68for more information.
69Two end-of-file markers mark the end of a tape, and
70one end-of-file marker marks the end of a tape file.
71If the tape is not to be rewound it is positioned with the
72head in between the two tape marks, where the next write
73will over write the second end-of-file marker.
74.Pp
75All of the magtape devices may be manipulated with the
76.Xr mt 1
77command.
78.Pp
79A number of
80.Xr ioctl 2
81operations are available
82on raw magnetic tape.
83The following definitions are from
84.In sys/mtio.h :
85.Bd -literal
86#ifndef _SYS_MTIO_H_
87#define _SYS_MTIO_H_
88
89#ifndef _KERNEL
90#include <sys/types.h>
91#endif
92#include <sys/ioccom.h>
93
94/*
95 * Structures and definitions for mag tape io control commands
96 */
97
98/* structure for MTIOCTOP - mag tape op command */
99struct mtop {
100 short mt_op; /* operations defined below */
101 daddr_t mt_count; /* how many of them */
102};
103
104/* operations */
105#define MTWEOF 0 /* write an end-of-file record */
106#define MTFSF 1 /* forward space file */
107#define MTBSF 2 /* backward space file */
108#define MTFSR 3 /* forward space record */
109#define MTBSR 4 /* backward space record */
110#define MTREW 5 /* rewind */
111#define MTOFFL 6 /* rewind and put the drive offline */
112#define MTNOP 7 /* no operation, sets status only */
113#define MTCACHE 8 /* enable controller cache */
114#define MTNOCACHE 9 /* disable controller cache */
115
116#if defined(__FreeBSD__)
117/* Set block size for device. If device is a variable size dev */
118/* a non zero parameter will change the device to a fixed block size */
119/* device with block size set to that of the parameter passed in. */
120/* Resetting the block size to 0 will restore the device to a variable */
121/* block size device. */
122
123#define MTSETBSIZ 10
124
125/* Set density values for device. Sets the value for the opened mode only. */
126
127#define MTSETDNSTY 11
128
129#define MTERASE 12 /* erase to EOM */
130#define MTEOD 13 /* Space to EOM */
131#define MTCOMP 14 /* select compression mode 0=off, 1=def */
132#define MTRETENS 15 /* re-tension tape */
133#define MTWSS 16 /* write setmark(s) */
134#define MTFSS 17 /* forward space setmark */
135#define MTBSS 18 /* backward space setmark */
136
137#define MT_COMP_ENABLE 0xffffffff
138#define MT_COMP_DISABLED 0xfffffffe
139#define MT_COMP_UNSUPP 0xfffffffd
140
141/*
142 * Values in mt_dsreg that say what the device is doing
143 */
144#define MTIO_DSREG_NIL 0 /* Unknown */
145#define MTIO_DSREG_REST 1 /* Doing Nothing */
146#define MTIO_DSREG_RBSY 2 /* Communicating with tape (but no motion) */
147#define MTIO_DSREG_WR 20 /* Writing */
148#define MTIO_DSREG_FMK 21 /* Writing Filemarks */
149#define MTIO_DSREG_ZER 22 /* Erasing */
150#define MTIO_DSREG_RD 30 /* Reading */
151#define MTIO_DSREG_FWD 40 /* Spacing Forward */
152#define MTIO_DSREG_REV 41 /* Spacing Reverse */
153#define MTIO_DSREG_POS 42 /* Hardware Positioning (direction unknown) */
154#define MTIO_DSREG_REW 43 /* Rewinding */
155#define MTIO_DSREG_TEN 44 /* Retensioning */
156#define MTIO_DSREG_UNL 45 /* Unloading */
157#define MTIO_DSREG_LD 46 /* Loading */
158
159#endif /* __FreeBSD__ */
160
161/* structure for MTIOCGET - mag tape get status command */
162
163struct mtget {
164 short mt_type; /* type of magtape device */
165/* the following two registers are grossly device dependent */
166 short mt_dsreg; /* ``drive status'' register */
167 short mt_erreg; /* ``error'' register */
168/* end device-dependent registers */
169 short mt_resid; /* residual count */
170#if defined (__FreeBSD__)
171 daddr_t mt_blksiz; /* presently operating blocksize */
172 daddr_t mt_density; /* presently operating density */
173 u_int32_t mt_comp; /* presently operating compression */
174 daddr_t mt_blksiz0; /* blocksize for mode 0 */
175 daddr_t mt_blksiz1; /* blocksize for mode 1 */
176 daddr_t mt_blksiz2; /* blocksize for mode 2 */
177 daddr_t mt_blksiz3; /* blocksize for mode 3 */
178 daddr_t mt_density0; /* density for mode 0 */
179 daddr_t mt_density1; /* density for mode 1 */
180 daddr_t mt_density2; /* density for mode 2 */
181 daddr_t mt_density3; /* density for mode 3 */
182/* the following are not yet implemented */
183 u_int32_t mt_comp0; /* compression type for mode 0 */
184 u_int32_t mt_comp1; /* compression type for mode 1 */
185 u_int32_t mt_comp2; /* compression type for mode 2 */
186 u_int32_t mt_comp3; /* compression type for mode 3 */
187/* end not yet implemented */
188#endif
189 daddr_t mt_fileno; /* relative file number of current position */
190 daddr_t mt_blkno; /* relative block number of current position */
191};
192
193/* structure for MTIOCERRSTAT - tape get error status command */
194/* really only supported for SCSI tapes right now */
195struct scsi_tape_errors {
196 /*
197 * These are latched from the last command that had a SCSI
198 * Check Condition noted for these operations. The act
199 * of issuing an MTIOCERRSTAT unlatches and clears them.
200 */
201 u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */
202 u_int32_t io_resid; /* residual count from last Data I/O */
203 u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */
204 u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */
205 u_int32_t ctl_resid; /* residual count from last Control I/O */
206 u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */
207 /*
208 * These are the read and write cumulative error counters.
209 * (how to reset cumulative error counters is not yet defined).
210 * (not implemented as yet but space is being reserved for them)
211 */
212 struct {
213 u_int32_t retries; /* total # retries performed */
214 u_int32_t corrected; /* total # corrections performed */
215 u_int32_t processed; /* total # corrections successful */
216 u_int32_t failures; /* total # corrections/retries failed */
217 u_int64_t nbytes; /* total # bytes processed */
218 } wterr, rderr;
219};
220
221union mterrstat {
222 struct scsi_tape_errors scsi_errstat;
223 char _reserved_padding[256];
224};
225
226/*
227 * Constants for mt_type byte. These are the same
228 * for controllers compatible with the types listed.
229 */
230#define MT_ISTS 0x01 /* TS-11 */
231#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
232#define MT_ISTM 0x03 /* TM11/TE10 Unibus */
233#define MT_ISMT 0x04 /* TM78/TU78 Massbus */
234#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */
235#define MT_ISCPC 0x06 /* SUN */
236#define MT_ISAR 0x07 /* SUN */
237#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */
238#define MT_ISCY 0x09 /* CCI Cipher */
239#define MT_ISCT 0x0a /* HP 1/4 tape */
240#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */
241#define MT_ISEXABYTE 0x0c /* Exabyte */
242#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */
243#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */
244#define MT_ISVIPER1 0x0e /* Archive Viper-150 */
245#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */
246#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */
247#define MT_ISMFOUR 0x11 /* M4 Data 1/2 9track drive */
248#define MT_ISTK50 0x12 /* DEC SCSI TK50 */
249#define MT_ISMT02 0x13 /* Emulex MT02 SCSI tape controller */
250
251/* mag tape io control commands */
252#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
253#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
254/* these two do not appear to be used anywhere */
255#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
256#define MTIOCEEOT _IO('m', 4) /* enable EOT error */
257/*
258 * When more SCSI-3 SSC (streaming device) devices are out there
259 * that support the full 32 byte type 2 structure, we'll have to
260 * rethink these ioctls to support all the entities they haul into
261 * the picture (64 bit blocks, logical file record numbers, etc..).
262 */
263#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /* get logical blk addr */
264#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /* get hardware blk addr */
265#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /* seek to logical blk addr */
266#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /* seek to hardware blk addr */
267#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
268/*
269 * Set EOT model- argument is number of filemarks to end a tape with.
270 * Note that not all possible values will be accepted.
271 */
272#define MTIOCSETEOTMODEL _IOW('m', 8, u_int32_t)
273/* Get current EOT model */
274#define MTIOCGETEOTMODEL _IOR('m', 8, u_int32_t)
275
276#ifndef _KERNEL
277#define DEFTAPE "/dev/nsa0"
278#endif
279
280#ifdef _KERNEL
281/*
282 * minor device number
283 */
284
285#define T_UNIT 003 /* unit selection */
286#define T_NOREWIND 004 /* no rewind on close */
287#define T_DENSEL 030 /* density select */
288#define T_800BPI 000 /* select 800 bpi */
289#define T_1600BPI 010 /* select 1600 bpi */
290#define T_6250BPI 020 /* select 6250 bpi */
291#define T_BADBPI 030 /* undefined selection */
292#endif
293
294#endif /* !_SYS_MTIO_H_ */
295.Ed
296.Sh FILES
297.Bl -tag -width /dev/[n]sa* -compact
298.It Pa /dev/[n]sa*
299.El
300.Sh SEE ALSO
301.Xr mt 1 ,
302.Xr tar 1 ,
303.Xr ast 4 ,
304.Xr sa 4
305.Sh HISTORY
306The
307.Nm
308manual appeared in
309.Bx 4.2 .
310An i386 version first appeared in
311.Fx 2.2 .
312.Sh BUGS
313The status should be returned in a device independent format.
314.Pp
315The special file naming should be redone in a more consistent and
316understandable manner.