home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / mtio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  5.7 KB  |  152 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    mtio.h,v $
  29.  * Revision 2.1  92/04/21  17:17:35  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*
  36.  * Copyright (c) 1982, 1986 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)mtio.h    7.6 (Berkeley) 2/5/91
  68.  */
  69.  
  70. /*
  71.  * Structures and definitions for mag tape io control commands
  72.  */
  73.  
  74. /* structure for MTIOCTOP - mag tape op command */
  75. struct mtop {
  76.     short    mt_op;        /* operations defined below */
  77.     daddr_t    mt_count;    /* how many of them */
  78. };
  79.  
  80. /* operations */
  81. #define MTWEOF        0    /* write an end-of-file record */
  82. #define MTFSF        1    /* forward space file */
  83. #define MTBSF        2    /* backward space file */
  84. #define MTFSR        3    /* forward space record */
  85. #define MTBSR        4    /* backward space record */
  86. #define MTREW        5    /* rewind */
  87. #define MTOFFL        6    /* rewind and put the drive offline */
  88. #define MTNOP        7    /* no operation, sets status only */
  89. #define MTCACHE        8    /* enable controller cache */
  90. #define MTNOCACHE    9    /* disable controller cache */
  91.  
  92. /* structure for MTIOCGET - mag tape get status command */
  93.  
  94. struct mtget {
  95.     short    mt_type;    /* type of magtape device */
  96. /* the following two registers are grossly device dependent */
  97.     short    mt_dsreg;    /* ``drive status'' register */
  98.     short    mt_erreg;    /* ``error'' register */
  99. /* end device-dependent registers */
  100.     short    mt_resid;    /* residual count */
  101. /* the following two are not yet implemented */
  102.     daddr_t    mt_fileno;    /* file number of current position */
  103.     daddr_t    mt_blkno;    /* block number of current position */
  104. /* end not yet implemented */
  105. };
  106.  
  107. /*
  108.  * Constants for mt_type byte.  These are the same
  109.  * for controllers compatible with the types listed.
  110.  */
  111. #define    MT_ISTS        0x01        /* TS-11 */
  112. #define    MT_ISHT        0x02        /* TM03 Massbus: TE16, TU45, TU77 */
  113. #define    MT_ISTM        0x03        /* TM11/TE10 Unibus */
  114. #define    MT_ISMT        0x04        /* TM78/TU78 Massbus */
  115. #define    MT_ISUT        0x05        /* SI TU-45 emulation on Unibus */
  116. #define    MT_ISCPC    0x06        /* SUN */
  117. #define    MT_ISAR        0x07        /* SUN */
  118. #define    MT_ISTMSCP    0x08        /* DEC TMSCP protocol (TU81, TK50) */
  119. #define MT_ISCY        0x09        /* CCI Cipher */
  120. #define MT_ISCT        0x0a        /* HP 1/4 tape */
  121. #define MT_ISFHP    0x0b        /* HP 7980 1/2 tape */
  122. #define MT_ISEXABYTE    0x0c        /* Exabyte */
  123. #define MT_ISEXA8200    0x0c        /* Exabyte EXB-8200 */
  124. #define MT_ISEXA8500    0x0d        /* Exabyte EXB-8500 */
  125. #define MT_ISVIPER1    0x0e        /* Archive Viper-150 */
  126. #define MT_ISPYTHON    0x0f        /* Archive Python (DAT) */
  127. #define MT_ISHPDAT    0x10        /* HP 35450A DAT drive */
  128.  
  129. /* mag tape io control commands */
  130. #define    MTIOCTOP    _IOW('m', 1, struct mtop)    /* do a mag tape op */
  131. #define    MTIOCGET    _IOR('m', 2, struct mtget)    /* get tape status */
  132. #define MTIOCIEOT    _IO('m', 3)            /* ignore EOT error */
  133. #define MTIOCEEOT    _IO('m', 4)            /* enable EOT error */
  134.  
  135. #ifndef KERNEL
  136. #define    DEFTAPE    "/dev/rmt12"
  137. #endif
  138.  
  139. #ifdef    KERNEL
  140. /*
  141.  * minor device number
  142.  */
  143.  
  144. #define    T_UNIT        003        /* unit selection */
  145. #define    T_NOREWIND    004        /* no rewind on close */
  146. #define    T_DENSEL    030        /* density select */
  147. #define    T_800BPI    000        /* select  800 bpi */
  148. #define    T_1600BPI    010        /* select 1600 bpi */
  149. #define    T_6250BPI    020        /* select 6250 bpi */
  150. #define    T_BADBPI    030        /* undefined selection */
  151. #endif
  152.