summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/wt.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-01-08 12:46:15 +0000
committerjoerg <joerg@FreeBSD.org>1996-01-08 12:46:15 +0000
commit68695555370902143d4aa7d03e11d7ef2109e785 (patch)
treedc8384ba8e983811d8cc1bfe98b35570ca2f2219 /sys/i386/isa/wt.c
parent63a6a9070f2f90aa395953458e3ce10d4d09eb53 (diff)
downloadFreeBSD-src-68695555370902143d4aa7d03e11d7ef2109e785.zip
FreeBSD-src-68695555370902143d4aa7d03e11d7ef2109e785.tar.gz
MTRETENS for the wt driver. This patch got lost with
my previous commit.
Diffstat (limited to 'sys/i386/isa/wt.c')
-rw-r--r--sys/i386/isa/wt.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index a1f2c70..08e49f9 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -19,7 +19,7 @@
* the original CMU copyright notice.
*
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
- * $Id: wt.c,v 1.26 1995/12/10 13:39:27 phk Exp $
+ * $Id: wt.c,v 1.27 1995/12/22 15:39:45 bde Exp $
*
*/
@@ -446,11 +446,9 @@ done:
/*
* Ioctl routine. Compatible with BSD ioctls.
- * Direct QIC-02 commands ERASE and RETENSION added.
- * There are three possible ioctls:
+ * There are two possible ioctls:
* ioctl (int fd, MTIOCGET, struct mtget *buf) -- get status
* ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op
- * ioctl (int fd, WTQICMD, int qicop) -- do QIC op
*/
int wtioctl (dev_t dev, int cmd, caddr_t arg, int flags, struct proc *p)
{
@@ -464,32 +462,6 @@ int wtioctl (dev_t dev, int cmd, caddr_t arg, int flags, struct proc *p)
switch (cmd) {
default:
return (EINVAL);
- case WTQICMD: /* direct QIC command */
- op = (int) *(void**)arg;
- switch (op) {
- default:
- return (EINVAL);
- case QIC_ERASE: /* erase the whole tape */
- if (! (t->flags & TPWRITE) || (t->flags & TPWP))
- return (EACCES);
- if (error = wtwait (t, PCATCH, "wterase"))
- return (error);
- break;
- case QIC_RETENS: /* retension the tape */
- if (error = wtwait (t, PCATCH, "wtretens"))
- return (error);
- break;
- }
- /* Both ERASE and RETENS operations work like REWIND. */
- /* Simulate the rewind operation here. */
- t->flags &= ~(TPRO | TPWO | TPVOL);
- if (! wtcmd (t, op))
- return (EIO);
- t->flags |= TPSTART | TPREW;
- if (op == QIC_ERASE)
- t->flags |= TPWANY;
- wtclock (t);
- return (0);
case MTIOCIEOT: /* ignore EOT errors */
case MTIOCEEOT: /* enable EOT errors */
return (0);
@@ -539,15 +511,23 @@ int wtioctl (dev_t dev, int cmd, caddr_t arg, int flags, struct proc *p)
if (error = wtwritefm (t))
return (error);
return (0);
+ case MTRETENS: /* re-tension tape */
+ if (error = wtwait (t, PCATCH, "wtretens"))
+ return (error);
+ op = QIC_RETENS;
+ goto erase_retens;
+
case MTERASE: /* erase to EOM */
if (! (t->flags & TPWRITE) || (t->flags & TPWP))
return (EACCES);
if (error = wtwait (t, PCATCH, "wterase"))
return (error);
- /* ERASE operations work like REWIND. */
+ op = QIC_ERASE;
+ erase_retens:
+ /* ERASE and RETENS operations work like REWIND. */
/* Simulate the rewind operation here. */
t->flags &= ~(TPRO | TPWO | TPVOL);
- if (! wtcmd (t, QIC_ERASE))
+ if (! wtcmd (t, op))
return (EIO);
t->flags |= TPSTART | TPREW;
t->flags |= TPWANY;
OpenPOWER on IntegriCloud