Deleted Added
full compact
mtio.4 (256281) mtio.4 (280438)
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

--- 19 unchanged lines hidden (view full) ---

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

--- 19 unchanged lines hidden (view full) ---

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: stable/10/share/man/man4/mtio.4 231564 2012-02-12 18:29:56Z ed $
36.\" $FreeBSD: stable/10/share/man/man4/mtio.4 280438 2015-03-24 14:36:10Z ken $
37.\"
37.\"
38.Dd November 11, 2011
38.Dd February 12, 2015
39.Dt MTIO 4
40.Os
41.Sh NAME
42.Nm mtio
43.Nd FreeBSD magtape interface
44.Sh DESCRIPTION
45The special files
46named
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*
47.Pa /dev/[en]sa*
48refer to SCSI tape drives,
49which may be attached to the system.
48refer to SCSI tape drives,
49which may be attached to the system.
50.Pa /dev/[n]sa*.ctl
50.Pa /dev/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
55The rewind devices automatically rewind
56when the last requested read, write or seek has finished, or the end of the tape
57has been reached.
58The letter
59.Ql n
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
55The rewind devices automatically rewind
56when the last requested read, write or seek has finished, or the end of the tape
57has been reached.
58The letter
59.Ql n
60is usually prepended to
60is prepended to
61the name of the no-rewind devices.
61the name of the no-rewind devices.
62The letter
63.Ql e
64is prepended to the name of the eject devices.
62.Pp
63Tapes can be written with either fixed length records or variable length
64records.
65See
66.Xr sa 4
67for more information.
65.Pp
66Tapes can be written with either fixed length records or variable length
67records.
68See
69.Xr sa 4
70for 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.
71Two filemarks mark the end of a tape, and
72one filemark 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

--- 49 unchanged lines hidden (view full) ---

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 */
73If the tape is not to be rewound it is positioned with the
74head in between the two tape marks, where the next write
75will over write the second end-of-file marker.
76.Pp
77All of the magtape devices may be manipulated with the
78.Xr mt 1
79command.
80.Pp

--- 49 unchanged lines hidden (view full) ---

130
131#define MTERASE 12 /* erase to EOM */
132#define MTEOD 13 /* Space to EOM */
133#define MTCOMP 14 /* select compression mode 0=off, 1=def */
134#define MTRETENS 15 /* re-tension tape */
135#define MTWSS 16 /* write setmark(s) */
136#define MTFSS 17 /* forward space setmark */
137#define MTBSS 18 /* backward space setmark */
138#define MTLOAD 19 /* load tape in drive */
139#define MTWEOFI 20 /* write an end-of-file record without waiting*/
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 */

--- 80 unchanged lines hidden (view full) ---

223 } wterr, rderr;
224};
225
226union mterrstat {
227 struct scsi_tape_errors scsi_errstat;
228 char _reserved_padding[256];
229};
230
140
141#define MT_COMP_ENABLE 0xffffffff
142#define MT_COMP_DISABLED 0xfffffffe
143#define MT_COMP_UNSUPP 0xfffffffd
144
145/*
146 * Values in mt_dsreg that say what the device is doing
147 */

--- 80 unchanged lines hidden (view full) ---

228 } wterr, rderr;
229};
230
231union mterrstat {
232 struct scsi_tape_errors scsi_errstat;
233 char _reserved_padding[256];
234};
235
236struct mtrblim {
237 uint32_t granularity;
238 uint32_t min_block_length;
239 uint32_t max_block_length;
240};
241
242typedef enum {
243 MT_LOCATE_DEST_OBJECT = 0x00,
244 MT_LOCATE_DEST_FILE = 0x01,
245 MT_LOCATE_DEST_SET = 0x02,
246 MT_LOCATE_DEST_EOD = 0x03
247} mt_locate_dest_type;
248
249typedef enum {
250 MT_LOCATE_BAM_IMPLICIT = 0x00,
251 MT_LOCATE_BAM_EXPLICIT = 0x01
252} mt_locate_bam;
253
254typedef enum {
255 MT_LOCATE_FLAG_IMMED = 0x01,
256 MT_LOCATE_FLAG_CHANGE_PART = 0x02
257} mt_locate_flags;
258
259struct mtlocate {
260 mt_locate_flags flags;
261 mt_locate_dest_type dest_type;
262 mt_locate_bam block_address_mode;
263 int64_t partition;
264 uint64_t logical_id;
265 uint8_t reserved[64];
266};
267
268typedef enum {
269 MT_EXT_GET_NONE,
270 MT_EXT_GET_OK,
271 MT_EXT_GET_NEED_MORE_SPACE,
272 MT_EXT_GET_ERROR
273} mt_ext_get_status;
274
275struct mtextget {
276 uint32_t alloc_len;
277 char *status_xml;
278 uint32_t fill_len;
279 mt_ext_get_status status;
280 char error_str[128];
281 uint8_t reserved[64];
282};
283
284#define MT_EXT_GET_ROOT_NAME "mtextget"
285#define MT_DENSITY_ROOT_NAME "mtdensity"
286#define MT_MEDIA_DENSITY_NAME "media_density"
287#define MT_DENSITY_REPORT_NAME "density_report"
288#define MT_MEDIUM_TYPE_REPORT_NAME "medium_type_report"
289#define MT_MEDIA_REPORT_NAME "media_report"
290#define MT_DENSITY_ENTRY_NAME "density_entry"
291
292#define MT_DENS_WRITE_OK 0x80
293#define MT_DENS_DUP 0x40
294#define MT_DENS_DEFLT 0x20
295
296
297#define MT_PARAM_FIXED_STR_LEN 32
298union mt_param_value {
299 int64_t value_signed;
300 uint64_t value_unsigned;
301 char *value_var_str;
302 char value_fixed_str[MT_PARAM_FIXED_STR_LEN];
303 uint8_t reserved[64];
304};
305
306typedef enum {
307 MT_PARAM_SET_NONE,
308 MT_PARAM_SET_SIGNED,
309 MT_PARAM_SET_UNSIGNED,
310 MT_PARAM_SET_VAR_STR,
311 MT_PARAM_SET_FIXED_STR
312} mt_param_set_type;
313
314typedef enum {
315 MT_PARAM_STATUS_NONE,
316 MT_PARAM_STATUS_OK,
317 MT_PARAM_STATUS_ERROR
318} mt_param_set_status;
319
320#define MT_PARAM_VALUE_NAME_LEN 64
321struct mtparamset {
322 char value_name[MT_PARAM_VALUE_NAME_LEN];
323 mt_param_set_type value_type;
324 int value_len;
325 union mt_param_value value;
326 mt_param_set_status status;
327 char error_str[128];
328};
329
330#define MT_PARAM_ROOT_NAME "mtparamget"
331#define MT_PROTECTION_NAME "protection"
332
231/*
333/*
334 * Set a list of parameters.
335 */
336struct mtsetlist {
337 int num_params;
338 int param_len;
339 struct mtparamset *params;
340};
341
342/*
232 * Constants for mt_type byte. These are the same
233 * for controllers compatible with the types listed.
234 */
235#define MT_ISTS 0x01 /* TS-11 */
236#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
237#define MT_ISTM 0x03 /* TM11/TE10 Unibus */
238#define MT_ISMT 0x04 /* TM78/TU78 Massbus */
239#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */

--- 32 unchanged lines hidden (view full) ---

272#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
273/*
274 * Set EOT model- argument is number of filemarks to end a tape with.
275 * Note that not all possible values will be accepted.
276 */
277#define MTIOCSETEOTMODEL _IOW('m', 8, uint32_t)
278/* Get current EOT model */
279#define MTIOCGETEOTMODEL _IOR('m', 8, uint32_t)
343 * Constants for mt_type byte. These are the same
344 * for controllers compatible with the types listed.
345 */
346#define MT_ISTS 0x01 /* TS-11 */
347#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
348#define MT_ISTM 0x03 /* TM11/TE10 Unibus */
349#define MT_ISMT 0x04 /* TM78/TU78 Massbus */
350#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */

--- 32 unchanged lines hidden (view full) ---

383#define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */
384/*
385 * Set EOT model- argument is number of filemarks to end a tape with.
386 * Note that not all possible values will be accepted.
387 */
388#define MTIOCSETEOTMODEL _IOW('m', 8, uint32_t)
389/* Get current EOT model */
390#define MTIOCGETEOTMODEL _IOR('m', 8, uint32_t)
391#define MTIOCRBLIM _IOR('m', 9, struct mtrblim) /* get block limits */
392#define MTIOCEXTLOCATE _IOW('m', 10, struct mtlocate) /* seek to position */
393#define MTIOCEXTGET _IOWR('m', 11, struct mtextget) /* get tape status */
394#define MTIOCPARAMGET _IOWR('m', 12, struct mtextget) /* get tape params */
395#define MTIOCPARAMSET _IOWR('m', 13, struct mtparamset) /* set tape params */
396#define MTIOCSETLIST _IOWR('m', 14, struct mtsetlist) /* set N params */
280
281#ifndef _KERNEL
282#define DEFTAPE "/dev/nsa0"
283#endif
284
285#endif /* !_SYS_MTIO_H_ */
286.Ed
287.Sh FILES
397
398#ifndef _KERNEL
399#define DEFTAPE "/dev/nsa0"
400#endif
401
402#endif /* !_SYS_MTIO_H_ */
403.Ed
404.Sh FILES
288.Bl -tag -width /dev/[n]sa* -compact
289.It Pa /dev/[n]sa*
405.Bl -tag -width /dev/[en]sa* -compact
406.It Pa /dev/[en]sa*
290.El
291.Sh SEE ALSO
292.Xr mt 1 ,
293.Xr tar 1 ,
407.El
408.Sh SEE ALSO
409.Xr mt 1 ,
410.Xr tar 1 ,
294.Xr ast 4 ,
295.Xr sa 4
296.Sh HISTORY
297The
298.Nm
299manual appeared in
300.Bx 4.2 .
301An i386 version first appeared in
302.Fx 2.2 .
411.Xr sa 4
412.Sh HISTORY
413The
414.Nm
415manual appeared in
416.Bx 4.2 .
417An i386 version first appeared in
418.Fx 2.2 .
303.Sh BUGS
304The status should be returned in a device independent format.
305.Pp
306The special file naming should be redone in a more consistent and
307understandable manner.