Return to BSD News archive
Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!usenet.coe.montana.edu!nate
From: nate@cs.montana.edu (Nate Williams)
Subject: FWD: include files for st driver.
Message-ID: <1993May26.185212.348@coe.montana.edu>
Sender: usenet@coe.montana.edu (USENET News System)
Organization: CS
Date: Wed, 26 May 1993 18:52:12 GMT
Lines: 420
---------
From: Julian Elischer <julian@jules.dialix.oz.au>
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# scsi/scsi_tape.h
# sys/mtio.h
#
echo x - scsi/scsi_tape.h
sed 's/^X//' >scsi/scsi_tape.h << 'END-of-scsi/scsi_tape.h'
X/*
X * HISTORY
X * $Log: scsi_tape.h,v $
X * Revision 1.2 93/05/10 23:57:23 root
X * added some special stuff for some OLD scsi tapes (CIPHER ST150S)
X *
X * Revision 1.1 93/04/12 21:51:06 root
X * checkin for 'jules'
X *
X * Revision 1.2 1993/01/26 18:39:08 julian
X * add the 'write protected' bit in the device status struct.
X *
X * Revision 1.1 1992/09/26 22:10:21 julian
X * Initial revision
X *
X *
X * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
X * -------------------- ----- ----------------------
X * CURRENT PATCH LEVEL: 1 00098
X * -------------------- ----- ----------------------
X *
X * 16 Feb 93 Julian Elischer ADDED for SCSI system
X *
X */
X
X/*
X * SCSI tape interface description
X */
X
X/*
X * Written by Julian Elischer (julian@tfs.com)
X * for TRW Financial Systems.
X *
X * TRW Financial Systems, in accordance with their agreement with Carnegie
X * Mellon University, makes this software available to CMU to distribute
X * or use in any manner that they see fit as long as this message is kept with
X * the software. For this reason TFS also grants any other persons or
X * organisations permission to use or modify this software.
X *
X * TFS supplies this software to be publicly redistributed
X * on the understanding that TFS is not responsible for the correct
X * functioning of this software in any circumstances.
X *
X */
X
X/*
X * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
X */
X
X
X
X
X
X/*
X * SCSI command format
X */
X
X
Xstruct scsi_rw_tape
X{
X u_char op_code;
X u_char fixed:1;
X u_char :4;
X u_char lun:3;
X u_char len[3];
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} rw_tape;
X
Xstruct scsi_space
X{
X u_char op_code;
X u_char code:2;
X u_char :3;
X u_char lun:3;
X u_char number[3];
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} space;
X#define SP_BLKS 0
X#define SP_FILEMARKS 1
X#define SP_SEQ_FILEMARKS 2
X#define SP_EOM 3
X
Xstruct scsi_write_filemarks
X{
X u_char op_code;
X u_char :5;
X u_char lun:3;
X u_char number[3];
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} write_filemarks;
X
Xstruct scsi_rewind
X{
X u_char op_code;
X u_char immed:1;
X u_char :4;
X u_char lun:3;
X u_char unused[3];
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} rewind;
X
Xstruct scsi_load
X{
X u_char op_code;
X u_char immed:1;
X u_char :4;
X u_char lun:3;
X u_char unused[2];
X u_char load:1;
X u_char reten:1;
X u_char :6;
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} load;
X#define LD_UNLOAD 0
X#define LD_LOAD 1
X
Xstruct scsi_blk_limits
X{
X u_char op_code;
X u_char :5;
X u_char lun:3;
X u_char unused[3];
X u_char link:1;
X u_char flag:1;
X u_char :6;
X} blk_limits;
X
X/*
X * Opcodes
X */
X
X#define REWIND 0x01
X#define READ_BLK_LIMITS 0x05
X#define READ_COMMAND_TAPE 0x08
X#define WRITE_COMMAND_TAPE 0x0a
X#define WRITE_FILEMARKS 0x10
X#define SPACE 0x11
X#define LOAD_UNLOAD 0x1b /* same as above */
X
X
X
Xstruct scsi_blk_limits_data
X{
X u_char reserved;
X u_char max_length_2; /* Most significant */
X u_char max_length_1;
X u_char max_length_0; /* Least significant */
X u_char min_length_1; /* Most significant */
X u_char min_length_0; /* Least significant */
X};
X
Xstruct scsi_mode_header_tape
X{
X u_char data_length; /* Sense data length */
X u_char medium_type;
X u_char speed:4;
X u_char buf_mode:3;
X u_char write_protected:1;
X u_char blk_desc_len;
X};
X
X/* A special for the CIPHER ST150S(old drive) */
Xstruct blk_desc_cipher
X{
X u_char density;
X u_char nblocks[3];
X u_char reserved;
X u_char blklen[3];
X u_char sec:1; /* soft error count */
X u_char aui:1; /* autoload inhibit */
X u_char :6;
X};
X
X
X
X/**********************************************************************
X from the scsi2 spec
X Value Tracks Density(bpi) Code Type Reference Note
X 0x1 9 800 NRZI R X3.22-1983 2
X 0x2 9 1600 PE R X3.39-1986 2
X 0x3 9 6250 GCR R X3.54-1986 2
X 0x5 4/9 8000 GCR C X3.136-1986 1
X 0x6 9 3200 PE R X3.157-1987 2
X 0x7 4 6400 IMFM C X3.116-1986 1
X 0x8 4 8000 GCR CS X3.158-1986 1
X 0x9 18 37871 GCR C X3B5/87-099 2
X 0xA 22 6667 MFM C X3B5/86-199 1
X 0xB 4 1600 PE C X3.56-1986 1
X 0xC 24 12690 GCR C HI-TC1 1,5
X 0xD 24 25380 GCR C HI-TC2 1,5
X 0xF 15 10000 GCR C QIC-120 1,5
X 0x10 18 10000 GCR C QIC-150 1,5
X 0x11 26 16000 GCR C QIC-320(525?) 1,5
X 0x12 30 51667 RLL C QIC-1350 1,5
X 0x13 1 61000 DDS CS X3B5/88-185A 4
X 0x14 1 43245 RLL CS X3.202-1991 4
X 0x15 1 45434 RLL CS ECMA TC17 4
X 0x16 48 10000 MFM C X3.193-1990 1
X 0x17 48 42500 MFM C X3B5/91-174 1
X
X where Code means:
X NRZI Non Return to Zero, change on ones
X GCR Group Code Recording
X PE Phase Encoded
X IMFM Inverted Modified Frequency Modulation
X MFM Modified Frequency Modulation
X DDS Dat Data Storage
X RLL Run Length Encoding
X
X where Type means:
X R Real-to-Real
X C Cartridge
X CS cassette
X
X where Notes means:
X 1 Serial Recorded
X 2 Parallel Recorded
X 3 Old format know as QIC-11
X 4 Helical Scan
X 5 Not ANSI standard, rather industry standard.
X
X********************************************************************/
X
X#define HALFINCH_800 0x01
X#define HALFINCH_1600 0x02
X#define HALFINCH_6250 0x03
X#define QIC_24 0x05 /* may be bad, works for CIPHER ST150S XXX */
X#define QIC_120 0x0f
X#define QIC_150 0x10
X#define QIC_320 0x11
X#define QIC_525 0x11
X#define QIC_1320 0x12
X
X
END-of-scsi/scsi_tape.h
echo x - sys/mtio.h
sed 's/^X//' >sys/mtio.h << 'END-of-sys/mtio.h'
X/*
X * Copyright (c) 1982, 1986 The Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by the University of
X * California, Berkeley and its contributors.
X * 4. Neither the name of the University nor the names of its contributors
X * may be used to endorse or promote products derived from this software
X * without specific prior written permission.
X *
X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X * @(#)mtio.h 7.6 (Berkeley) 2/5/91
X */
X
X/*
X * Structures and definitions for mag tape io control commands
X */
X
X/* structure for MTIOCTOP - mag tape op command */
Xstruct mtop {
X short mt_op; /* operations defined below */
X daddr_t mt_count; /* how many of them */
X};
X
X/* operations */
X#define MTWEOF 0 /* write an end-of-file record */
X#define MTFSF 1 /* forward space file */
X#define MTBSF 2 /* backward space file */
X#define MTFSR 3 /* forward space record */
X#define MTBSR 4 /* backward space record */
X#define MTREW 5 /* rewind */
X#define MTOFFL 6 /* rewind and put the drive offline */
X#define MTNOP 7 /* no operation, sets status only */
X#define MTCACHE 8 /* enable controller cache */
X#define MTNOCACHE 9 /* disable controller cache */
X#if defined(__386BSD__)
X#define MTSETBSIZ 10 /* Set block size for device */
X /* If device is a variable size dev */
X /* a non zero parameter will change */
X /* the device to a fixed block size */
X /* device with block size set to */
X /* that of the parameter passed in. */
X /* Resetting the block size to 0 will */
X /* restore the device to a variable */
X /* block size device. */
X
X /* This ioctl is a noop on fixed block */
X /* devices. */
X
X#define MTSETHDNSTY 11 /* Set default high density values for device */
X#define MTSETMDNSTY 12 /* Set default medium density values for device */
X#define MTSETLDNSTY 13 /* Set default low density values for device */
X /* These values are as defined in SCSI II spec */
X /* and range from 0 to 0x17 */
X#endif
X
X/* structure for MTIOCGET - mag tape get status command */
X
Xstruct mtget {
X short mt_type; /* type of magtape device */
X/* the following two registers are grossly device dependent */
X short mt_dsreg; /* ``drive status'' register */
X short mt_erreg; /* ``error'' register */
X/* end device-dependent registers */
X daddr_t mt_resid; /* residual count */
X#if defined (__386BSD__)
X daddr_t mt_bsiz; /* block size, 0 is variable */
X short mt_dns_high; /* density setting for high density */
X short mt_dns_medium; /* density setting for medium density */
X short mt_dns_low; /* density setting for low density */
X#endif
X/* the following two are not yet implemented */
X daddr_t mt_fileno; /* file number of current position */
X daddr_t mt_blkno; /* block number of current position */
X/* end not yet implemented */
X u_short mt_flags; /* Solbourne compatiable way of getting r/w status */
X};
X
X/*
X * Constants for mt_type byte. These are the same
X * for controllers compatible with the types listed.
X */
X#define MT_ISTS 0x01 /* TS-11 */
X#define MT_ISHT 0x02 /* TM03 Massbus: TE16, TU45, TU77 */
X#define MT_ISTM 0x03 /* TM11/TE10 Unibus */
X#define MT_ISMT 0x04 /* TM78/TU78 Massbus */
X#define MT_ISUT 0x05 /* SI TU-45 emulation on Unibus */
X#define MT_ISCPC 0x06 /* SUN */
X#define MT_ISAR 0x07 /* SUN */
X#define MT_ISTMSCP 0x08 /* DEC TMSCP protocol (TU81, TK50) */
X#define MT_ISCY 0x09 /* CCI Cipher */
X#define MT_ISCT 0x0a /* HP 1/4 tape */
X#define MT_ISFHP 0x0b /* HP 7980 1/2 tape */
X#define MT_ISEXABYTE 0x0c /* Exabyte */
X#define MT_ISEXA8200 0x0c /* Exabyte EXB-8200 */
X#define MT_ISEXA8500 0x0d /* Exabyte EXB-8500 */
X#define MT_ISVIPER1 0x0e /* Archive Viper-150 */
X#define MT_ISPYTHON 0x0f /* Archive Python (DAT) */
X#define MT_ISHPDAT 0x10 /* HP 35450A DAT drive */
X
X/*
X * Constants for mt_flags structure.
X */
X#define MTF_WRITE_PROT 0x8000 /* write protect status of tape */
X
X/* mag tape io control commands */
X#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
X#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
X#define MTIOCIEOT _IO('m', 3) /* ignore EOT error */
X#define MTIOCEEOT _IO('m', 4) /* enable EOT error */
X
X#ifndef KERNEL
X#define DEFTAPE "/dev/rmt12"
X#endif
X
X#ifdef KERNEL
X/*
X * minor device number
X */
X
X#define T_UNIT 003 /* unit selection */
X#define T_NOREWIND 004 /* no rewind on close */
X#define T_DENSEL 030 /* density select */
X#define T_800BPI 000 /* select 800 bpi */
X#define T_1600BPI 010 /* select 1600 bpi */
X#define T_6250BPI 020 /* select 6250 bpi */
X#define T_BADBPI 030 /* undefined selection */
X#endif
END-of-sys/mtio.h
exit
--
osynw@terra.oscs.montana.edu | Still trying to find a good reason for
nate@cs.montana.edu | these 'computer' things. Personally,
work #: (406) 994-4836 | I don't think they'll catch on -
home #: (406) 586-0579 | Don Hammerstrom