freebsd-skq/sys/i386/isa/wt.c

903 lines
26 KiB
C
Raw Normal View History

>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Streamer tape driver for 386bsd and FreeBSD.
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
1993-12-13 18:38:44 +00:00
* Supports Archive and Wangtek compatible QIC-02/QIC-36 boards.
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
*
* Copyright (C) 1993 by:
* Sergey Ryzhkov <sir@kiae.su>
* Serge Vakulenko <vak@zebub.msk.su>
*
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
1993-12-13 18:38:44 +00:00
* This software is distributed with NO WARRANTIES, not even the implied
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1993-06-12 14:58:17 +00:00
*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* Authors grant any other persons or organisations permission to use
* or modify this software as long as this message is kept with the software,
* all derivative works or modified versions.
1993-06-12 14:58:17 +00:00
*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* This driver is derived from the old 386bsd Wangtek streamer tape driver,
* made by Robert Baron at CMU, based on Intel sources.
* Authors thank Robert Baron, CMU and Intel and retain here
* the original CMU copyright notice.
*
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
1993-12-13 18:38:44 +00:00
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
* $Id: wt.c,v 1.4 1993/12/13 18:38:43 alm Exp $
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
1993-12-13 18:38:44 +00:00
*
1993-06-12 14:58:17 +00:00
*/
/*
* Copyright (c) 1989 Carnegie-Mellon University.
* All rights reserved.
*
* Authors: Robert Baron
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include "wt.h"
#if NWT > 0
#include "sys/param.h"
#include "systm.h"
#include "kernel.h"
1993-06-12 14:58:17 +00:00
#include "sys/buf.h"
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
#include "sys/fcntl.h"
#include "sys/malloc.h"
#include "sys/ioctl.h"
#include "sys/mtio.h"
#include "vm/vm_param.h"
#include "i386/include/pio.h"
#include "i386/isa/isa_device.h"
1993-06-12 14:58:17 +00:00
#include "i386/isa/wtreg.h"
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
1993-12-13 18:38:44 +00:00
/*
* Uncomment this to enable internal device tracing.
*/
#define DEBUG(s) /* printf s */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
#define WTPRI (PZERO+10) /* sleep priority */
1993-06-12 14:58:17 +00:00
/*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* Wangtek controller ports
1993-06-12 14:58:17 +00:00
*/
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
#define WT_CTLPORT(base) ((base)+0) /* control, write only */
#define WT_STATPORT(base) ((base)+0) /* status, read only */
#define WT_CMDPORT(base) ((base)+1) /* command, write only */
#define WT_DATAPORT(base) ((base)+1) /* data, read only */
#define WT_NPORT 2 /* 2 i/o ports */
/* status port bits */
#define WT_BUSY 0x01 /* not ready bit define */
#define WT_NOEXCEP 0x02 /* no exception bit define */
#define WT_RESETMASK 0x07 /* to check after reset */
#define WT_RESETVAL 0x05 /* state after reset */
/* control port bits */
#define WT_ONLINE 0x01 /* device selected */
#define WT_RESET 0x02 /* reset command */
#define WT_REQUEST 0x04 /* request command */
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
1993-12-13 18:38:44 +00:00
#define WT_IEN 0x08 /* enable dma */
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Archive controller ports
*/
#define AV_DATAPORT(base) ((base)+0) /* data, read only */
#define AV_CMDPORT(base) ((base)+0) /* command, write only */
#define AV_STATPORT(base) ((base)+1) /* status, read only */
#define AV_CTLPORT(base) ((base)+1) /* control, write only */
#define AV_SDMAPORT(base) ((base)+2) /* start dma */
#define AV_RDMAPORT(base) ((base)+3) /* reset dma */
#define AV_NPORT 4 /* 4 i/o ports */
/* status port bits */
#define AV_BUSY 0x40 /* not ready bit define */
#define AV_NOEXCEP 0x20 /* no exception bit define */
#define AV_RESETMASK 0xf8 /* to check after reset */
#define AV_RESETVAL 0x50 /* state after reset */
/* control port bits */
#define AV_RESET 0x80 /* reset command */
#define AV_REQUEST 0x40 /* request command */
#define AV_IEN 0x20 /* enable interrupts */
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
1993-12-13 18:38:44 +00:00
enum wttype {
UNKNOWN = 0, /* unknown type, driver disabled */
ARCHIVE, /* Archive Viper SC499, SC402 etc */
WANGTEK, /* Wangtek */
};
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
typedef struct {
unsigned short err; /* code for error encountered */
unsigned short ercnt; /* number of error blocks */
unsigned short urcnt; /* number of underruns */
} wtstatus_t;
typedef struct {
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
1993-12-13 18:38:44 +00:00
enum wttype type; /* type of controller */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
unsigned unit; /* unit number */
unsigned port; /* base i/o port */
unsigned chan; /* dma channel number, 1..3 */
unsigned flags; /* state of tape drive */
unsigned dens; /* tape density */
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
1993-12-13 18:38:44 +00:00
int bsize; /* tape block size */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
void *buf; /* internal i/o buffer */
void *dmavaddr; /* virtual address of dma i/o buffer */
unsigned dmatotal; /* size of i/o buffer */
unsigned dmaflags; /* i/o direction, B_READ or B_WRITE */
unsigned dmacount; /* resulting length of dma i/o */
wtstatus_t error; /* status of controller */
unsigned short DATAPORT, CMDPORT, STATPORT, CTLPORT, SDMAPORT, RDMAPORT;
unsigned char BUSY, NOEXCEP, RESETMASK, RESETVAL;
unsigned char ONLINE, RESET, REQUEST, IEN;
} wtinfo_t;
wtinfo_t wttab[NWT]; /* tape info by unit number */
static int wtwait (wtinfo_t *t, int catch, char *msg);
static int wtcmd (wtinfo_t *t, int cmd);
static int wtstart (wtinfo_t *t, unsigned mode, void *vaddr, unsigned len);
static void wtdma (wtinfo_t *t);
static void wtimer (caddr_t);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
static void wtclock (wtinfo_t *t);
static int wtreset (wtinfo_t *t);
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
1993-12-13 18:38:44 +00:00
static int wtsense (wtinfo_t *t, int verb, int ignor);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
static int wtstatus (wtinfo_t *t);
static void wtrewind (wtinfo_t *t);
static int wtreadfm (wtinfo_t *t);
static int wtwritefm (wtinfo_t *t);
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
1993-12-13 18:38:44 +00:00
static int wtpoll (wtinfo_t *t, int mask, int bits);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* XXX */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
extern void DELAY (int usec);
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Probe for the presence of the device.
*/
int wtprobe (struct isa_device *id)
{
wtinfo_t *t = wttab + id->id_unit;
t->unit = id->id_unit;
t->chan = id->id_drq;
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
1993-12-13 18:38:44 +00:00
t->port = id->id_iobase;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (t->chan<1 || t->chan>3) {
printf ("wt%d: Bad drq=%d, should be 1..3\n", t->unit, t->chan);
return (0);
}
/* Try Wangtek. */
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
1993-12-13 18:38:44 +00:00
t->type = WANGTEK;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->CTLPORT = WT_CTLPORT (t->port); t->STATPORT = WT_STATPORT (t->port);
t->CMDPORT = WT_CMDPORT (t->port); t->DATAPORT = WT_DATAPORT (t->port);
t->SDMAPORT = 0; t->RDMAPORT = 0;
t->BUSY = WT_BUSY; t->NOEXCEP = WT_NOEXCEP;
t->RESETMASK = WT_RESETMASK; t->RESETVAL = WT_RESETVAL;
t->ONLINE = WT_ONLINE; t->RESET = WT_RESET;
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
1993-12-13 18:38:44 +00:00
t->REQUEST = WT_REQUEST; t->IEN = WT_IEN;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (wtreset (t))
return (WT_NPORT);
/* Try Archive. */
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
1993-12-13 18:38:44 +00:00
t->type = ARCHIVE;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->CTLPORT = AV_CTLPORT (t->port); t->STATPORT = AV_STATPORT (t->port);
t->CMDPORT = AV_CMDPORT (t->port); t->DATAPORT = AV_DATAPORT (t->port);
t->SDMAPORT = AV_SDMAPORT (t->port); t->RDMAPORT = AV_RDMAPORT (t->port);
t->BUSY = AV_BUSY; t->NOEXCEP = AV_NOEXCEP;
t->RESETMASK = AV_RESETMASK; t->RESETVAL = AV_RESETVAL;
t->ONLINE = 0; t->RESET = AV_RESET;
t->REQUEST = AV_REQUEST; t->IEN = AV_IEN;
if (wtreset (t))
return (AV_NPORT);
/* Tape controller not found. */
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
1993-12-13 18:38:44 +00:00
t->type = UNKNOWN;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (0);
1993-06-12 14:58:17 +00:00
}
/*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* Device is found, configure it.
1993-06-12 14:58:17 +00:00
*/
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int wtattach (struct isa_device *id)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
wtinfo_t *t = wttab + id->id_unit;
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
if (t->type == ARCHIVE) {
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
printf ("wt%d: type <Archive>\n", t->unit);
outb (t->RDMAPORT, 0); /* reset dma */
} else
printf ("wt%d: type <Wangtek>\n", t->unit);
t->flags = TPSTART; /* tape is rewound */
t->dens = -1; /* unknown density */
return (1);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
struct isa_driver wtdriver = { wtprobe, wtattach, "wt", };
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int wtdump (int dev)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* Not implemented */
return (EINVAL);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int wtsize (int dev)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* Not implemented */
return (-1);
1993-06-12 14:58:17 +00:00
}
/*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* Open routine, called on every device open.
1993-06-12 14:58:17 +00:00
*/
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int wtopen (int dev, int flag)
{
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
int error;
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
1993-12-13 18:38:44 +00:00
if (u >= NWT || t->type == UNKNOWN)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (ENXIO);
/* Check that device is not in use */
if (t->flags & TPINUSE)
return (EBUSY);
/* If the tape is in rewound state, check the status and set density. */
if (t->flags & TPSTART) {
/* If rewind is going on, wait */
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
1993-12-13 18:38:44 +00:00
if (error = wtwait (t, PCATCH, "wtrew"))
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (error);
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
1993-12-13 18:38:44 +00:00
/* Check the controller status */
if (! wtsense (t, 0, (flag & FWRITE) ? 0 : TP_WRP)) {
/* Bad status, reset the controller */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (! wtreset (t))
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
1993-12-13 18:38:44 +00:00
return (EIO);
if (! wtsense (t, 1, (flag & FWRITE) ? 0 : TP_WRP))
return (EIO);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* Set up tape density. */
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
1993-12-13 18:38:44 +00:00
if (t->dens != (minor (dev) & WT_DENSEL)) {
int d = 0;
switch (minor (dev) & WT_DENSEL) {
case WT_DENSDFLT: default: break; /* default density */
case WT_QIC11: d = QIC_FMT11; break; /* minor 010 */
case WT_QIC24: d = QIC_FMT24; break; /* minor 020 */
case WT_QIC120: d = QIC_FMT120; break; /* minor 030 */
case WT_QIC150: d = QIC_FMT150; break; /* minor 040 */
case WT_QIC300: d = QIC_FMT300; break; /* minor 050 */
case WT_QIC600: d = QIC_FMT600; break; /* minor 060 */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
}
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
1993-12-13 18:38:44 +00:00
if (d) {
/* Change tape density. */
if (! wtcmd (t, d))
return (EIO);
if (! wtsense (t, 1, TP_WRP | TP_ILL))
return (EIO);
/* Check the status of the controller. */
if (t->error.err & TP_ILL) {
printf ("wt%d: invalid tape density\n", t->unit);
return (ENODEV);
}
}
t->dens = minor (dev) & WT_DENSEL;
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~TPSTART;
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
1993-12-13 18:38:44 +00:00
} else if (t->dens != (minor (dev) & WT_DENSEL))
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (ENXIO);
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
t->bsize = (minor (dev) & WT_BSIZE) ? 1024 : 512;
t->buf = malloc (t->bsize, M_TEMP, M_WAITOK);
if (! t->buf)
return (EAGAIN);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags = TPINUSE;
1993-06-12 14:58:17 +00:00
if (flag & FREAD)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags |= TPREAD;
1993-06-12 14:58:17 +00:00
if (flag & FWRITE)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags |= TPWRITE;
return (0);
1993-06-12 14:58:17 +00:00
}
/*
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
* Close routine, called on last device close.
1993-06-12 14:58:17 +00:00
*/
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int wtclose (int dev)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
if (u >= NWT || t->type == UNKNOWN)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (ENXIO);
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* If rewind is pending, do nothing */
if (t->flags & TPREW)
goto done;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* If seek forward is pending and no rewind on close, do nothing */
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
1993-12-13 18:38:44 +00:00
if (t->flags & TPRMARK) {
if (minor (dev) & T_NOREWIND)
goto done;
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
/* If read file mark is going on, wait */
wtwait (t, 0, "wtrfm");
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (t->flags & TPWANY)
/* Tape was written. Write file mark. */
wtwritefm (t);
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (! (minor (dev) & T_NOREWIND)) {
/* Rewind tape to beginning of tape. */
/* Don't wait until rewind, though. */
wtrewind (t);
goto done;
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if ((t->flags & TPRANY) && ! (t->flags & (TPVOL | TPWANY)))
/* Space forward to after next file mark if no writing done. */
/* Don't wait for completion. */
wtreadfm (t);
done:
t->flags &= TPREW | TPRMARK | TPSTART | TPTIMER;
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
1993-12-13 18:38:44 +00:00
free (t->buf, M_TEMP);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (0);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Ioctl routine. Compatible with BSD ioctls.
* Direct QIC-02 commands ERASE and RETENSION added.
* There are three 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 (int dev, int cmd, void *arg, int mode)
{
int u = minor (dev) & T_UNIT;
wtinfo_t *t = wttab + u;
int error, count, op;
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
1993-12-13 18:38:44 +00:00
if (u >= NWT || t->type == UNKNOWN)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (ENXIO);
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);
1993-06-12 14:58:17 +00:00
break;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
case QIC_RETENS: /* retension the tape */
if (error = wtwait (t, PCATCH, "wtretens"))
return (error);
1993-06-12 14:58:17 +00:00
break;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
}
/* 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);
case MTIOCGET:
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
1993-12-13 18:38:44 +00:00
((struct mtget*)arg)->mt_type =
t->type == ARCHIVE ? MT_ISVIPER1 : 0x11;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
((struct mtget*)arg)->mt_dsreg = t->flags; /* status */
((struct mtget*)arg)->mt_erreg = t->error.err; /* errors */
((struct mtget*)arg)->mt_resid = 0;
((struct mtget*)arg)->mt_fileno = 0; /* file */
((struct mtget*)arg)->mt_blkno = 0; /* block */
return (0);
case MTIOCTOP:
break;
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
switch ((short) ((struct mtop*)arg)->mt_op) {
default:
case MTFSR: /* forward space record */
case MTBSR: /* backward space record */
case MTBSF: /* backward space file */
break;
case MTNOP: /* no operation, sets status only */
case MTCACHE: /* enable controller cache */
case MTNOCACHE: /* disable controller cache */
return (0);
case MTREW: /* rewind */
case MTOFFL: /* rewind and put the drive offline */
if (t->flags & TPREW) /* rewind is running */
return (0);
if (error = wtwait (t, PCATCH, "wtorew"))
return (error);
wtrewind (t);
return (0);
case MTFSF: /* forward space file */
for (count=((struct mtop*)arg)->mt_count; count>0; --count) {
if (error = wtwait (t, PCATCH, "wtorfm"))
return (error);
if (error = wtreadfm (t))
return (error);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (0);
case MTWEOF: /* write an end-of-file record */
if (! (t->flags & TPWRITE) || (t->flags & TPWP))
return (EACCES);
if (error = wtwait (t, PCATCH, "wtowfm"))
return (error);
if (error = wtwritefm (t))
return (error);
return (0);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (EINVAL);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Strategy routine.
*/
void wtstrategy (struct buf *bp)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int u = minor (bp->b_dev) & T_UNIT;
wtinfo_t *t = wttab + u;
int s;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
bp->b_resid = bp->b_bcount;
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
1993-12-13 18:38:44 +00:00
if (u >= NWT || t->type == UNKNOWN)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
goto errxit;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* at file marks and end of tape, we just return '0 bytes available' */
if (t->flags & TPVOL)
goto xit;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (bp->b_flags & B_READ) {
/* Check read access and no previous write to this tape. */
if (! (t->flags & TPREAD) || (t->flags & TPWANY))
goto errxit;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* For now, we assume that all data will be copied out */
/* If read command outstanding, just skip down */
if (! (t->flags & TPRO)) {
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
1993-12-13 18:38:44 +00:00
if (! wtsense (t, 1, TP_WRP)) /* clear status */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
goto errxit;
if (! wtcmd (t, QIC_RDDATA)) { /* sed read mode */
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
1993-12-13 18:38:44 +00:00
wtsense (t, 1, TP_WRP);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
goto errxit;
}
t->flags |= TPRO | TPRANY;
}
} else {
/* Check write access and write protection. */
/* No previous read from this tape allowed. */
if (! (t->flags & TPWRITE) || (t->flags & (TPWP | TPRANY)))
goto errxit;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* If write command outstanding, just skip down */
if (! (t->flags & TPWO)) {
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
1993-12-13 18:38:44 +00:00
if (! wtsense (t, 1, 0)) /* clear status */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
goto errxit;
if (! wtcmd (t, QIC_WRTDATA)) { /* set write mode */
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
1993-12-13 18:38:44 +00:00
wtsense (t, 1, 0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
goto errxit;
}
t->flags |= TPWO | TPWANY;
}
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (! bp->b_bcount)
goto xit;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~TPEXCEP;
s = splbio ();
if (wtstart (t, bp->b_flags, bp->b_un.b_addr, bp->b_bcount)) {
wtwait (t, 0, (bp->b_flags & B_READ) ? "wtread" : "wtwrite");
bp->b_resid -= t->dmacount;
}
splx (s);
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (t->flags & TPEXCEP) {
errxit: bp->b_flags |= B_ERROR;
bp->b_error = EIO;
}
xit: biodone (bp);
return;
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Interrupt routine.
*/
void wtintr (int u)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
wtinfo_t *t = wttab + u;
unsigned char s;
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
if (u >= NWT || t->type == UNKNOWN) {
DEBUG (("wtintr() -- device not configured\n"));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
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
1993-12-13 18:38:44 +00:00
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
s = inb (t->STATPORT); /* get status */
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
1993-12-13 18:38:44 +00:00
DEBUG (("wtintr() status=0x%x -- ", s));
if ((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP)) {
DEBUG (("busy\n"));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return; /* device is busy */
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
1993-12-13 18:38:44 +00:00
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Check if rewind finished.
*/
if (t->flags & TPREW) {
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
1993-12-13 18:38:44 +00:00
DEBUG (((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP) ?
"rewind busy?\n" : "rewind finished\n"));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~TPREW; /* Rewind finished. */
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
1993-12-13 18:38:44 +00:00
wtsense (t, 1, TP_WRP);
wakeup ((caddr_t)t);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Check if writing/reading of file mark finished.
*/
if (t->flags & (TPRMARK | TPWMARK)) {
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
1993-12-13 18:38:44 +00:00
DEBUG (((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP) ?
"marker r/w busy?\n" : "marker r/w finished\n"));
if (! (s & t->NOEXCEP)) /* operation failed */
wtsense (t, 1, (t->flags & TPRMARK) ? TP_WRP : 0);
t->flags &= ~(TPRMARK | TPWMARK); /* operation finished */
wakeup ((caddr_t)t);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Do we started any i/o? If no, just return.
*/
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
1993-12-13 18:38:44 +00:00
if (! (t->flags & TPACTIVE)) {
DEBUG (("unexpected interrupt\n"));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
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
1993-12-13 18:38:44 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~TPACTIVE;
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
1993-12-13 18:38:44 +00:00
t->dmacount += t->bsize; /* increment counter */
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Clean up dma.
*/
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
1993-12-13 18:38:44 +00:00
if ((t->dmaflags & B_READ) && (t->dmatotal - t->dmacount) < t->bsize) {
/* If reading short block, copy the internal buffer
* to the user memory. */
isa_dmadone (t->dmaflags, t->buf, t->bsize, t->chan);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
bcopy (t->buf, t->dmavaddr, t->dmatotal - t->dmacount);
} else
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
1993-12-13 18:38:44 +00:00
isa_dmadone (t->dmaflags, t->dmavaddr, t->bsize, t->chan);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* On exception, check for end of file and end of volume.
*/
if (! (s & t->NOEXCEP)) {
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
1993-12-13 18:38:44 +00:00
DEBUG (("i/o exception\n"));
wtsense (t, 1, (t->dmaflags & B_READ) ? TP_WRP : 0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (t->error.err & (TP_EOM | TP_FIL))
t->flags |= TPVOL; /* end of file */
else
t->flags |= TPEXCEP; /* i/o error */
wakeup ((caddr_t)t);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
}
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (t->dmacount < t->dmatotal) { /* continue i/o */
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
1993-12-13 18:38:44 +00:00
t->dmavaddr += t->bsize;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
wtdma (t);
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
1993-12-13 18:38:44 +00:00
DEBUG (("continue i/o, %d\n", t->dmacount));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
}
if (t->dmacount > t->dmatotal) /* short last block */
t->dmacount = t->dmatotal;
wakeup ((caddr_t)t); /* wake up user level */
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
1993-12-13 18:38:44 +00:00
DEBUG (("i/o finished, %d\n", t->dmacount));
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* start the rewind operation */
static void wtrewind (wtinfo_t *t)
1993-06-12 14:58:17 +00:00
{
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
1993-12-13 18:38:44 +00:00
int rwmode = (t->flags & (TPRO | TPWO));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~(TPRO | TPWO | TPVOL);
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
1993-12-13 18:38:44 +00:00
/*
* Wangtek strictly follows QIC-02 standard:
* clearing ONLINE in read/write modes causes rewind.
* REWIND command is not allowed in read/write mode
* and gives `illegal command' error.
*/
if (t->type==WANGTEK && rwmode) {
outb (t->CTLPORT, 0);
} else if (! wtcmd (t, QIC_REWIND))
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return;
t->flags |= TPSTART | TPREW;
wtclock (t);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* start the `read marker' operation */
static int wtreadfm (wtinfo_t *t)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~(TPRO | TPWO | TPVOL);
if (! wtcmd (t, QIC_READFM)) {
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
1993-12-13 18:38:44 +00:00
wtsense (t, 1, TP_WRP);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (EIO);
}
t->flags |= TPRMARK | TPRANY;
wtclock (t);
/* Don't wait for completion here. */
return (0);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* write marker to the tape */
static int wtwritefm (wtinfo_t *t)
1993-06-12 14:58:17 +00:00
{
tsleep ((caddr_t)wtwritefm, WTPRI, "wtwfm", hz); /* timeout: 1 second */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~(TPRO | TPWO);
if (! wtcmd (t, QIC_WRITEFM)) {
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
1993-12-13 18:38:44 +00:00
wtsense (t, 1, 0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (EIO);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags |= TPWMARK | TPWANY;
wtclock (t);
return (wtwait (t, 0, "wtwfm"));
1993-06-12 14:58:17 +00:00
}
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
1993-12-13 18:38:44 +00:00
/* while controller status & mask == bits continue waiting */
static int wtpoll (wtinfo_t *t, int mask, int bits)
1993-06-12 14:58:17 +00:00
{
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
1993-12-13 18:38:44 +00:00
int s, i;
/* Poll status port, waiting for specified bits. */
for (i=0; i<1000; ++i) { /* up to 1 msec */
s = inb (t->STATPORT);
if ((s & mask) != bits)
return (s);
DELAY (1);
}
for (i=0; i<100; ++i) { /* up to 10 msec */
s = inb (t->STATPORT);
if ((s & mask) != bits)
return (s);
DELAY (100);
}
for (;;) { /* forever */
s = inb (t->STATPORT);
if ((s & mask) != bits)
return (s);
tsleep ((caddr_t)wtpoll, WTPRI, "wtpoll", 1); /* timeout: 1 tick */
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
1993-12-13 18:38:44 +00:00
}
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* execute QIC command */
static int wtcmd (wtinfo_t *t, int cmd)
1993-06-12 14:58:17 +00:00
{
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
1993-12-13 18:38:44 +00:00
int s;
DEBUG (("wtcmd() cmd=0x%x\n", cmd));
s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */
if (! (s & t->NOEXCEP)) /* error */
return (0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->CMDPORT, cmd); /* output the command */
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */
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
1993-12-13 18:38:44 +00:00
wtpoll (t, t->BUSY, t->BUSY); /* wait for ready */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->CTLPORT, t->IEN | t->ONLINE); /* reset request */
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
1993-12-13 18:38:44 +00:00
wtpoll (t, t->BUSY, 0); /* wait for not ready */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (1);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* wait for the end of i/o, seeking marker or rewind operation */
static int wtwait (wtinfo_t *t, int catch, char *msg)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int error;
1993-06-12 14:58:17 +00:00
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
1993-12-13 18:38:44 +00:00
DEBUG (("wtwait() `%s'\n", msg));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
while (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK))
if (error = tsleep ((caddr_t)t, WTPRI | catch, msg, 0))
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (error);
return (0);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* initialize dma for the i/o operation */
static void wtdma (wtinfo_t *t)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags |= TPACTIVE;
wtclock (t);
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
1993-12-13 18:38:44 +00:00
if (t->type == ARCHIVE)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->SDMAPORT, 0); /* set dma */
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
1993-12-13 18:38:44 +00:00
if ((t->dmaflags & B_READ) && (t->dmatotal - t->dmacount) < t->bsize)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* Reading short block. Do it through the internal buffer. */
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
1993-12-13 18:38:44 +00:00
isa_dmastart (t->dmaflags, t->buf, t->bsize, t->chan);
1993-06-12 14:58:17 +00:00
else
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
1993-12-13 18:38:44 +00:00
isa_dmastart (t->dmaflags, t->dmavaddr, t->bsize, t->chan);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* start i/o operation */
static int wtstart (wtinfo_t *t, unsigned flags, void *vaddr, unsigned len)
1993-06-12 14:58:17 +00:00
{
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
1993-12-13 18:38:44 +00:00
int s;
DEBUG (("wtstart()\n"));
s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */
if (! (s & t->NOEXCEP)) {
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags |= TPEXCEP; /* error */
return (0);
}
t->flags &= ~TPEXCEP; /* clear exception flag */
t->dmavaddr = vaddr;
t->dmatotal = len;
t->dmacount = 0;
t->dmaflags = flags;
wtdma (t);
return (1);
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* start timer */
static void wtclock (wtinfo_t *t)
1993-06-12 14:58:17 +00:00
{
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
if (! (t->flags & TPTIMER)) {
t->flags |= TPTIMER;
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
1993-12-13 18:38:44 +00:00
/* Some controllers seem to lose dma interrupts too often.
* To make the tape stream we need 1 tick timeout. */
timeout ((timeout_func_t)wtimer, (caddr_t)t, (t->flags & TPACTIVE) ? 1 : hz);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
}
1993-06-12 14:58:17 +00:00
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/*
* Simulate an interrupt periodically while i/o is going.
* This is necessary in case interrupts get eaten due to
* multiple devices on a single IRQ line.
*/
static void wtimer (caddr_t xt)
1993-06-12 14:58:17 +00:00
{
wtinfo_t *t = (wtinfo_t *)xt;
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
int s;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~TPTIMER;
if (! (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK)))
return;
1993-06-12 14:58:17 +00:00
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* If i/o going, simulate interrupt. */
s = splbio ();
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
1993-12-13 18:38:44 +00:00
if ((inb (t->STATPORT) & (t->BUSY | t->NOEXCEP)) != (t->BUSY | t->NOEXCEP)) {
DEBUG (("wtimer() -- "));
wtintr (t->unit);
}
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
splx (s);
/* Restart timer if i/o pending. */
if (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK))
wtclock (t);
}
/* reset the controller */
static int wtreset (wtinfo_t *t)
{
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
1993-12-13 18:38:44 +00:00
/* Perform QIC-02 and QIC-36 compatible reset sequence. */
/* Thanks to Mikael Hybsch <micke@dynas.se>. */
int s, i;
outb (t->CTLPORT, t->RESET | t->ONLINE); /* send reset */
DELAY (30);
outb (t->CTLPORT, t->ONLINE); /* turn off reset */
DELAY (30);
/* Read the controller status. */
s = inb (t->STATPORT);
if (s == 0xff) /* no port at this address? */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
return (0);
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
1993-12-13 18:38:44 +00:00
/* Wait 3 sec for reset to complete. Needed for QIC-36 boards? */
for (i=0; i<3000; ++i) {
if (! (s & t->BUSY) || ! (s & t->NOEXCEP))
break;
DELAY (1000);
s = inb (t->STATPORT);
}
return ((s & t->RESETMASK) == t->RESETVAL);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
}
/* get controller status information */
/* return 0 if user i/o request should receive an i/o error code */
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
1993-12-13 18:38:44 +00:00
static int wtsense (wtinfo_t *t, int verb, int ignor)
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
{
char *msg = 0;
int err;
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
1993-12-13 18:38:44 +00:00
DEBUG (("wtsense() ignor=0x%x\n", ignor));
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
t->flags &= ~(TPRO | TPWO);
if (! wtstatus (t))
return (0);
if (! (t->error.err & TP_ST0))
t->error.err &= ~TP_ST0MASK;
if (! (t->error.err & TP_ST1))
t->error.err &= ~TP_ST1MASK;
t->error.err &= ~ignor; /* ignore certain errors */
err = t->error.err & (TP_FIL | TP_BNL | TP_UDA | TP_EOM | TP_WRP |
TP_USL | TP_CNI | TP_MBD | TP_NDT | TP_ILL);
if (! err)
return (1);
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
1993-12-13 18:38:44 +00:00
if (! verb)
return (0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
/* lifted from tdriver.c from Wangtek */
if (err & TP_USL) msg = "Drive not online";
else if (err & TP_CNI) msg = "No cartridge";
else if ((err & TP_WRP) && !(t->flags & TPWP)) {
msg = "Tape is write protected";
t->flags |= TPWP;
}
else if (err & TP_FIL) msg = 0 /*"Filemark detected"*/;
else if (err & TP_EOM) msg = 0 /*"End of tape"*/;
else if (err & TP_BNL) msg = "Block not located";
else if (err & TP_UDA) msg = "Unrecoverable data error";
else if (err & TP_NDT) msg = "No data detected";
else if (err & TP_ILL) msg = "Illegal command";
if (msg)
printf ("wt%d: %s\n", t->unit, msg);
return (0);
}
/* get controller status information */
static int wtstatus (wtinfo_t *t)
{
char *p;
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
1993-12-13 18:38:44 +00:00
wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->CMDPORT, QIC_RDSTAT); /* send `read status' command */
outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */
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
1993-12-13 18:38:44 +00:00
wtpoll (t, t->BUSY, t->BUSY); /* wait for ready */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
outb (t->CTLPORT, t->ONLINE); /* reset request */
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
1993-12-13 18:38:44 +00:00
wtpoll (t, t->BUSY, 0); /* wait for not ready */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
p = (char*) &t->error;
while (p < (char*)&t->error + 6) {
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
1993-12-13 18:38:44 +00:00
int s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP);
if (! (s & t->NOEXCEP)) /* error */
return (0);
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
*p++ = inb (t->DATAPORT); /* read status byte */
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
1993-12-13 18:38:44 +00:00
outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */
wtpoll (t, t->BUSY, 0); /* wait for not ready */
outb (t->CTLPORT, t->ONLINE); /* unset request */
>From: vak@zebub.msk.su (Serge V.Vakulenko) Date: Thu, 30 Sep 1993 15:13:17 +0300 Description: Old wt driver is too incomplete and buggy. It does not support Archive controllers, BSD-like tape ioctls, multiple tape controllers, different tape density etc. Fix: This driver is a replacement of the old one. It was not tested on different controllers, though. This is the streamer tape driver for 386bsd and FreeBSD, which supports Wangtek and Archive 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. 4) Asynchronous REWIND and FSF operations, close() will not wait until they finish. The next open() will wait for it instead. 5) Use of WTQICMD ioctl is limited to ERASE and RETENS operations. This prevents the user from locking the tape driver by strange tape operations. 6) Tape density switching added. 7) 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 Block interface (writing blocks less than 2048 bytes) is not functioning pwoperly. Use raw interface instead.
1993-09-30 20:12:37 +00:00
}
return (1);
}
#endif /* NWT */