Home | History | Annotate | Line # | Download | only in isa
wtreg.h revision 1.8.140.1
      1  1.8.140.1    skrll /*	$NetBSD: wtreg.h,v 1.8.140.1 2015/09/22 12:05:58 skrll Exp $	*/
      2        1.5      cgd 
      3        1.4  mycroft /*
      4        1.4  mycroft  * Streamer tape driver.
      5        1.4  mycroft  * Supports Archive and Wangtek compatible QIC-02/QIC-36 boards.
      6        1.4  mycroft  *
      7        1.4  mycroft  * Copyright (C) 1993 by:
      8        1.4  mycroft  *      Sergey Ryzhkov       <sir (at) kiae.su>
      9        1.4  mycroft  *      Serge Vakulenko      <vak (at) zebub.msk.su>
     10        1.4  mycroft  *
     11        1.4  mycroft  * This software is distributed with NO WARRANTIES, not even the implied
     12        1.4  mycroft  * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     13        1.4  mycroft  *
     14        1.4  mycroft  * Authors grant any other persons or organisations permission to use
     15        1.4  mycroft  * or modify this software as long as this message is kept with the software,
     16        1.4  mycroft  * all derivative works or modified versions.
     17        1.1      cgd  *
     18        1.4  mycroft  * This driver is derived from the old 386bsd Wangtek streamer tape driver,
     19        1.4  mycroft  * made by Robert Baron at CMU, based on Intel sources.
     20        1.1      cgd  */
     21        1.1      cgd 
     22        1.1      cgd /*
     23        1.1      cgd  * Copyright (c) 1989 Carnegie-Mellon University.
     24        1.1      cgd  * All rights reserved.
     25        1.1      cgd  *
     26        1.1      cgd  * Authors: Robert Baron
     27        1.7    perry  *
     28        1.1      cgd  * Permission to use, copy, modify and distribute this software and
     29        1.1      cgd  * its documentation is hereby granted, provided that both the copyright
     30        1.1      cgd  * notice and this permission notice appear in all copies of the
     31        1.1      cgd  * software, derivative works or modified versions, and any portions
     32        1.1      cgd  * thereof, and that both notices appear in supporting documentation.
     33        1.7    perry  *
     34        1.7    perry  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     35        1.7    perry  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     36        1.1      cgd  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     37        1.7    perry  *
     38        1.1      cgd  * Carnegie Mellon requests users of this software to return to
     39        1.1      cgd  *
     40        1.1      cgd  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     41        1.1      cgd  *  School of Computer Science
     42        1.1      cgd  *  Carnegie Mellon University
     43        1.1      cgd  *  Pittsburgh PA 15213-3890
     44        1.1      cgd  *
     45        1.1      cgd  * any improvements or extensions that they make and grant Carnegie the
     46        1.1      cgd  * rights to redistribute these changes.
     47        1.1      cgd  */
     48        1.1      cgd 
     49        1.1      cgd /*
     50        1.1      cgd  *  Copyright 1988, 1989 by Intel Corporation
     51        1.1      cgd  */
     52        1.1      cgd 
     53  1.8.140.1    skrll #include <sys/ioccom.h>
     54  1.8.140.1    skrll 
     55        1.4  mycroft /* ioctl for direct QIC commands */
     56        1.4  mycroft #define WTQICMD         _IO('W', 0)
     57        1.4  mycroft 
     58        1.4  mycroft /* QIC-02 commands allowed for WTQICMD */
     59        1.4  mycroft #define QIC_ERASE       0x22    /* erase the tape */
     60        1.4  mycroft #define QIC_RETENS      0x24    /* retension the tape */
     61        1.4  mycroft 
     62        1.4  mycroft /* internal QIC-02 commands */
     63        1.4  mycroft #define QIC_RDDATA      0x80    /* read data */
     64        1.4  mycroft #define QIC_READFM      0xa0    /* read file mark */
     65        1.4  mycroft #define QIC_WRTDATA     0x40    /* write data */
     66        1.4  mycroft #define QIC_WRITEFM     0x60    /* write file mark */
     67        1.4  mycroft #define QIC_RDSTAT      0xc0    /* read status command */
     68        1.4  mycroft #define QIC_REWIND      0x21    /* rewind command (position+bot) */
     69        1.4  mycroft #define QIC_FMT11       0x26    /* set format QIC-11 */
     70        1.4  mycroft #define QIC_FMT24       0x27    /* set format QIC-24 */
     71        1.4  mycroft #define QIC_FMT120      0x28    /* set format QIC-120 */
     72        1.4  mycroft #define QIC_FMT150      0x29    /* set format QIC-150 */
     73        1.4  mycroft #define QIC_FMT300      0x2a    /* set format QIC-300/QIC-2100 */
     74        1.4  mycroft #define QIC_FMT600      0x2b    /* set format QIC-600/QIC-2200 */
     75        1.4  mycroft 
     76        1.4  mycroft /* tape driver flags */
     77        1.4  mycroft #define TPINUSE         0x0001  /* tape is already open */
     78        1.4  mycroft #define TPREAD          0x0002  /* tape is only open for reading */
     79        1.4  mycroft #define TPWRITE         0x0004  /* tape is only open for writing */
     80        1.4  mycroft #define TPSTART         0x0008  /* tape must be rewound and reset */
     81        1.4  mycroft #define TPRMARK         0x0010  /* read file mark command outstanding */
     82        1.4  mycroft #define TPWMARK         0x0020  /* write file mark command outstanding */
     83        1.4  mycroft #define TPREW           0x0040  /* rewind command outstanding */
     84        1.4  mycroft #define TPEXCEP         0x0080  /* i/o exception flag */
     85        1.4  mycroft #define TPVOL           0x0100  /* read file mark or hit end of tape */
     86        1.4  mycroft #define TPWO            0x0200  /* write command outstanding */
     87        1.4  mycroft #define TPRO            0x0400  /* read command outstanding */
     88        1.4  mycroft #define TPWANY          0x0800  /* write command requested */
     89        1.4  mycroft #define TPRANY          0x1000  /* read command requested */
     90        1.4  mycroft #define TPWP            0x2000  /* write protect error seen */
     91        1.4  mycroft #define TPTIMER         0x4000  /* timer() is active */
     92        1.6      wiz #define TPACTIVE        0x8000  /* DMA i/o active */
     93        1.4  mycroft 
     94        1.4  mycroft /* controller error register bits */
     95        1.4  mycroft #define TP_FIL          0x0001  /* File mark detected */
     96        1.4  mycroft #define TP_BNL          0x0002  /* Block not located */
     97        1.4  mycroft #define TP_UDA          0x0004  /* Unrecoverable data error */
     98        1.4  mycroft #define TP_EOM          0x0008  /* End of media */
     99        1.4  mycroft #define TP_WRP          0x0010  /* Write protected cartridge */
    100        1.4  mycroft #define TP_USL          0x0020  /* Unselected drive */
    101        1.4  mycroft #define TP_CNI          0x0040  /* Cartridge not in place */
    102        1.4  mycroft #define TP_ST0          0x0080  /* Status byte 0 bits */
    103        1.4  mycroft #define TP_ST0MASK      0x00ff  /* Status byte 0 mask */
    104        1.4  mycroft #define TP_POR          0x0100  /* Power on/reset occurred */
    105        1.4  mycroft #define TP_ERM          0x0200  /* Reserved for end of recorded media */
    106        1.4  mycroft #define TP_BPE          0x0400  /* Reserved for bus parity error */
    107        1.4  mycroft #define TP_BOM          0x0800  /* Beginning of media */
    108        1.4  mycroft #define TP_MBD          0x1000  /* Marginal block detected */
    109        1.4  mycroft #define TP_NDT          0x2000  /* No data detected */
    110        1.4  mycroft #define TP_ILL          0x4000  /* Illegal command - should not happen! */
    111        1.4  mycroft #define TP_ST1          0x8000  /* Status byte 1 bits */
    112        1.4  mycroft #define TP_ST1MASK      0xff00  /* Status byte 1 mask */
    113        1.1      cgd 
    114        1.4  mycroft /* formats for printing flags and error values */
    115        1.4  mycroft #define WTDS_BITS "\20\1inuse\2read\3write\4start\5rmark\6wmark\7rew\10excep\11vol\12wo\13ro\14wany\15rany\16wp\17timer\20active"
    116        1.4  mycroft #define WTER_BITS "\20\1eof\2bnl\3uda\4eom\5wrp\6usl\7cni\11por\12erm\13bpe\14bom\15mbd\16ndt\17ill"
    117        1.1      cgd 
    118        1.4  mycroft /* device minor number */
    119        1.4  mycroft #define WT_BSIZE        0100    /* long block flag */
    120        1.4  mycroft #define WT_DENSEL       0070    /* density select mask */
    121        1.4  mycroft #define WT_DENSDFLT     0000    /* default density */
    122        1.4  mycroft #define WT_QIC11        0010    /* 11 megabytes? */
    123        1.4  mycroft #define WT_QIC24        0020    /* 60 megabytes */
    124        1.4  mycroft #define WT_QIC120       0030    /* 120 megabytes */
    125        1.4  mycroft #define WT_QIC150       0040    /* 150 megabytes */
    126        1.4  mycroft #define WT_QIC300       0050    /* 300 megabytes? */
    127        1.4  mycroft #define WT_QIC600       0060    /* 600 megabytes? */
    128