summaryrefslogtreecommitdiff
path: root/bin/mt
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 12:45:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 12:45:50 +0000
commit86f0d598c3169b42fcd878daa478422c2f32a090 (patch)
tree400d7a499b868e66ab5a355488446f575cfde808 /bin/mt
parent230fd0b14b93f3058d09de305c0e8fed47a81f93 (diff)
add blocksize/density commands; part of #921; from rhialto@polder.ubc.kun.nl
Diffstat (limited to 'bin/mt')
-rw-r--r--bin/mt/mt.112
-rw-r--r--bin/mt/mt.c15
2 files changed, 23 insertions, 4 deletions
diff --git a/bin/mt/mt.1 b/bin/mt/mt.1
index 0f23ed44d04..b1e9f0a417a 100644
--- a/bin/mt/mt.1
+++ b/bin/mt/mt.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: mt.1,v 1.7 1996/03/05 20:39:42 scottr Exp $
+.\" $NetBSD: mt.1,v 1.8 1996/05/21 10:23:55 mrg Exp $
.\"
.\" Copyright (c) 1981, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -104,6 +104,14 @@ Retensions the tape (if this operation is supported by the tape unit).
Erases the tape (if this operation is supported by the tape unit).
.It Cm eom
Forward space to the end of the media.
+.It Cm blocksize
+Set the tape blocksize to
+.Ar count
+bytes.
+.It Cm density
+Set the tape density code to
+.Ar count
+as specified in the SCSI2 specification.
.El
.Pp
If a tape name is not specified, and the environment variable
@@ -134,6 +142,8 @@ is not given.
Raw SCSI tape interface
.It Pa /dev/rmt*
Raw magnetic tape interface
+.It Pa /usr/src/sys/scsi/scsi_tape.h
+List of SCSI2 density codes
.El
.Sh SEE ALSO
.\".Xr mtio 4 ,
diff --git a/bin/mt/mt.c b/bin/mt/mt.c
index ce2758af7cb..4777fecb049 100644
--- a/bin/mt/mt.c
+++ b/bin/mt/mt.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mt.c,v 1.3 1996/04/17 17:01:46 dm Exp $ */
-/* $NetBSD: mt.c,v 1.12 1996/03/28 07:10:05 scottr Exp $ */
+/* $OpenBSD: mt.c,v 1.4 1996/05/22 12:45:49 deraadt Exp $ */
+/* $NetBSD: mt.c,v 1.14 1996/05/21 10:23:54 mrg Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$NetBSD: mt.c,v 1.12 1996/03/28 07:10:05 scottr Exp $";
+static char rcsid[] = "$NetBSD: mt.c,v 1.14 1996/05/21 10:23:54 mrg Exp $";
#endif
#endif /* not lint */
@@ -72,8 +72,10 @@ struct commands {
int c_code;
int c_ronly;
} com[] = {
+ { "blocksize", MTSETBSIZ, 1 },
{ "bsf", MTBSF, 1 },
{ "bsr", MTBSR, 1 },
+ { "density", MTSETDNSTY, 1 },
{ "eof", MTWEOF, 0 },
{ "eom", MTEOM, 1 },
{ "erase", MTERASE, 0 },
@@ -202,6 +204,7 @@ struct tape_desc {
#ifdef tahoe
{ MT_ISCY, "cipher", CYS_BITS, CYCW_BITS },
#endif
+ { 0x7, "SCSI tape", "76543210", "76543210" },
{ 0 }
};
@@ -227,6 +230,12 @@ status(bp)
printreg("ds", bp->mt_dsreg, mt->t_dsbits);
printreg("\ner", bp->mt_erreg, mt->t_erbits);
(void)putchar('\n');
+ (void)printf("blocksize: %ld (%ld, %ld, %ld, %ld)\n",
+ bp->mt_blksiz, bp->mt_mblksiz[0], bp->mt_mblksiz[1],
+ bp->mt_mblksiz[2], bp->mt_mblksiz[3]);
+ (void)printf("density: %ld (%ld, %ld, %ld, %ld)\n",
+ bp->mt_density, bp->mt_mdensity[0], bp->mt_mdensity[1],
+ bp->mt_mdensity[2], bp->mt_mdensity[3]);
}
/*