summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/wtreg.h
diff options
context:
space:
mode:
authoralm <alm@FreeBSD.org>1993-12-13 18:38:44 +0000
committeralm <alm@FreeBSD.org>1993-12-13 18:38:44 +0000
commit5dc76893af26dbfd8429205bdeb7af90d3e89360 (patch)
treeba142a71dc62f58626e18c9eddfc60ad9f2eda16 /sys/i386/isa/wtreg.h
parente6b36ffc84f0f0dde3151c5b29e59f20ef8621cf (diff)
downloadFreeBSD-src-5dc76893af26dbfd8429205bdeb7af90d3e89360.zip
FreeBSD-src-5dc76893af26dbfd8429205bdeb7af90d3e89360.tar.gz
wt.c - version 1.3
from: Sergey Ryzhkov, Serge Vakulenko E-mail: <sir@kiae.su>, <vak@zebub.msk.su> This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive compatible QIC-02/QIC-36 controllers. It was developed as a replacement of the old Wangtek tape driver from CMU. In comparison with the CMU driver, this version has the following enhancements: 1) Support for Archive SC402 and SC499 tape controllers added. 2) Support for up to three tape controllers on the same machine. 3) Support for BSD-style ioctls MTIOCGET, MTIOCTOP. Mt command now works adequately with this driver. 2) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 4) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 5) Tape density switching added. 6) The status of the process, blocked on the tape operation, is displayed at the WCHAN column of the `ps' command as: wtread reading data from the tape wtwrite writing data to the tape wtrfm reading the tape marker wtwfm writing the tape marker wtrew rewinding the tape wterase doing WTQICMD ERASE operation wtretens doing WTQICMD RETENS operation wtorew doing MTIOCTOP REW/OFFL operation wtorfm doing MTIOCTOP FSF operation wtowfm doing MTIOCTOP WEOF operation 7) It's possible to use the tape with "default density", useful for devices which don't support density switching or do automatic format determination. 8) Some controllers support only 1024 block length. Setting WT_BSIZE bit in device minor number turns on this mode. Minor number structure: 0bfffuuu Fields: uuu - Unit number. It's possible to install up to three tape controllers on the same machine, using DRQs 1..3. Hence, unit number can lie in range 0..2. fff - Tape format number: 0 - /dev/rwt0 - default density (auto select) 1 - /dev/rwt0a - QIC 11 (obsolete) 2 - /dev/rwt0b - QIC 24 (60 megabytes) 3 - /dev/rwt0c - QIC 120 (120 megabytes) 4 - /dev/rwt0d - QIC 150 (150 megabytes) 5 - /dev/rwt0e - QIC 300 (300 megabytes?) 6 - /dev/rwt0f - QIC 600 (600 megabytes?) b - Long block size flag. With this bit set, the driver will perform all i/o operations with the controller using 1024-byte blocks, instead of 512 ones. Some controllers need it (CMS for example). If you Wangtek controller does not stream well, you can try to use /dev/rWt0 device instead of /dev/rwt0 (uncomment needed lines in /dev/MAKEDEV to create it). Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead. Thanks to all who helped to test it on the following hardware: Controller Drive Volume Interface Thanks to --------------------------------------------------------------------------- Archive SC-499 Archive 2150L 150 Meg QIC-02 KIAE CMS? ? 150 Meg QIC-02 KIAE Everex EV 831/833 ? ? QIC-36 Joergen Haegg Wangtek ASSY Wangtek 60 Meg QIC-02 Ken Whedbee Tecmar QT150i? Wangtek 5150EQ ? QIC-02? Marko Teiste ? Wangtek 5099EK 60 Meg QIC-36 Robert Shien Archive SC400S ? 60 Meg ? Warren Toomey
Diffstat (limited to 'sys/i386/isa/wtreg.h')
-rw-r--r--sys/i386/isa/wtreg.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/sys/i386/isa/wtreg.h b/sys/i386/isa/wtreg.h
index d7658f3..e45e514 100644
--- a/sys/i386/isa/wtreg.h
+++ b/sys/i386/isa/wtreg.h
@@ -1,12 +1,12 @@
/*
* Streamer tape driver for 386bsd and FreeBSD.
- * Supports Archive QIC-02 and Wangtek QIC-02/QIC-36 boards.
+ * Supports Archive and Wangtek compatible QIC-02/QIC-36 boards.
*
* Copyright (C) 1993 by:
* Sergey Ryzhkov <sir@kiae.su>
* Serge Vakulenko <vak@zebub.msk.su>
*
- * Placed in the public domain with NO WARRANTIES, not even the implied
+ * This software is distributed with NO WARRANTIES, not even the implied
* warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors grant any other persons or organisations permission to use
@@ -18,8 +18,9 @@
* Authors thank Robert Baron, CMU and Intel and retain here
* the original CMU copyright notice.
*
- * from: Version 1.1, Fri Sep 24 02:14:42 MSD 1993
- * $Id$
+ * Version 1.3, Thu Nov 11 12:09:13 MSK 1993
+ * $Id$
+ *
*/
/*
@@ -53,8 +54,8 @@
#define WTQICMD _IO('W', 0)
/* QIC-02 commands allowed for WTQICMD */
-#define QIC_ERASE 0x22
-#define QIC_RETENS 0x24
+#define QIC_ERASE 0x22 /* erase the tape */
+#define QIC_RETENS 0x24 /* retension the tape */
/* internal QIC-02 commands */
#define QIC_RDDATA 0x80 /* read data */
@@ -67,6 +68,8 @@
#define QIC_FMT24 0x27 /* set format QIC-24 */
#define QIC_FMT120 0x28 /* set format QIC-120 */
#define QIC_FMT150 0x29 /* set format QIC-150 */
+#define QIC_FMT300 0x2a /* set format QIC-300/QIC-2100 */
+#define QIC_FMT600 0x2b /* set format QIC-600/QIC-2200 */
/* tape driver flags */
#define TPINUSE 0x0001 /* tape is already open */
@@ -97,15 +100,26 @@
#define TP_ST0 0x0080 /* Status byte 0 bits */
#define TP_ST0MASK 0x00ff /* Status byte 0 mask */
#define TP_POR 0x0100 /* Power on/reset occurred */
-#define TP_RES1 0x0200 /* Reserved for end of media */
-#define TP_RES2 0x0400 /* Reserved for bus parity */
+#define TP_ERM 0x0200 /* Reserved for end of recorded media */
+#define TP_BPE 0x0400 /* Reserved for bus parity error */
#define TP_BOM 0x0800 /* Beginning of media */
-#define TP_MBD 0x1000 /* Marginal block detected */
-#define TP_NDT 0x2000 /* No data detected */
+#define TP_MBD 0x1000 /* Marginal block detected */
+#define TP_NDT 0x2000 /* No data detected */
#define TP_ILL 0x4000 /* Illegal command - should not happen! */
-#define TP_ST1 0x8000 /* Status byte 1 bits */
+#define TP_ST1 0x8000 /* Status byte 1 bits */
#define TP_ST1MASK 0xff00 /* Status byte 1 mask */
/* formats for printing flags and error values */
#define WTDS_BITS "\20\1inuse\2read\3write\4start\5rmark\6wmark\7rew\10excep\11vol\12wo\13ro\14wany\15rany\16wp\17timer\20active"
-#define WTER_BITS "\20\1eof\2bnl\3uda\4eom\5wrp\6usl\7cni\11por\12res1\13res2\14bom\15mbd\16ndt\17ill"
+#define WTER_BITS "\20\1eof\2bnl\3uda\4eom\5wrp\6usl\7cni\11por\12erm\13bpe\14bom\15mbd\16ndt\17ill"
+
+/* device minor number */
+#define WT_BSIZE 0100 /* long block flag */
+#define WT_DENSEL 0070 /* density select mask */
+#define WT_DENSDFLT 0000 /* default density */
+#define WT_QIC11 0010 /* 11 megabytes? */
+#define WT_QIC24 0020 /* 60 megabytes */
+#define WT_QIC120 0030 /* 120 megabytes */
+#define WT_QIC150 0040 /* 150 megabytes */
+#define WT_QIC300 0050 /* 300 megabytes? */
+#define WT_QIC600 0060 /* 600 megabytes? */
OpenPOWER on IntegriCloud