home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / sys / mtio.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  3KB  |  109 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  **********************************************************************
  9.  * HISTORY
  10.  * 27-Mar-90    Doug Mitchell
  11.  *    Added MT_ISGS, MT_ISEXB
  12.  * 
  13.  * 27-Feb-89    Doug Mitchell at NeXT
  14.  *    Added extended error fields in mtget
  15.  *
  16.  * 23-Feb-89    Doug Mitchell at NeXT
  17.  *    Added NeXT-specific SCSI mt_ops
  18.  *
  19.  * 25-Jan-86  Avadis Tevanian (avie) at Carnegie-Mellon University
  20.  *    Upgraded to 4.3
  21.  *
  22.  ************************************************************************
  23.  */
  24.  
  25. /*
  26.  * Copyright (c) 1982, 1986 Regents of the University of California.
  27.  * All rights reserved.  The Berkeley software License Agreement
  28.  * specifies the terms and conditions for redistribution.
  29.  *
  30.  *    @(#)mtio.h    7.1 (Berkeley) 6/4/86
  31.  */
  32.  
  33. /*
  34.  * Structures and definitions for mag tape io control commands
  35.  */
  36. #ifndef    _MTIO_
  37. #define _MTIO_
  38.  
  39. /* structure for MTIOCTOP - mag tape op command */
  40. struct    mtop    {
  41.     short    mt_op;        /* operations defined below */
  42.     daddr_t    mt_count;    /* how many of them */
  43. };
  44.  
  45. /* operations */
  46. #define MTWEOF    0    /* write an end-of-file record */
  47. #define MTFSF    1    /* forward space file */
  48. #define MTBSF    2    /* backward space file */
  49. #define MTFSR    3    /* forward space record */
  50. #define MTBSR    4    /* backward space record */
  51. #define MTREW    5    /* rewind */
  52. #define MTOFFL    6    /* rewind and put the drive offline */
  53. #define MTNOP    7    /* no operation, sets status only */
  54. #define MTCACHE    8    /* enable controller cache */
  55. #define MTNOCACHE 9    /* disable controller cache */
  56. /*
  57.  * Additional NeXT-specific SCSI ops.
  58.  */
  59. #ifdef    NeXT
  60. #define MTRETEN 10      /* retension the tape */
  61. #define MTERASE 11      /* erase the entire tape */
  62. #endif    NeXT
  63.  
  64. /* structure for MTIOCGET - mag tape get status command */
  65.  
  66. struct    mtget    {
  67.     short    mt_type;    /* type of magtape device */
  68. /* the following four registers are grossly device dependent */
  69.     u_short    mt_dsreg;    /* ``drive status'' register. SCSI sense byte
  70.                  * 0x02.  */
  71.     u_short    mt_erreg;    /* ``error'' register. SCSI sense byte 0x0C. */
  72.     u_short mt_ext_err0;    /* SCSI sense bytes 0x13..0x14 */
  73.     u_short mt_ext_err1;    /* SCSI sense bytes 0x15..0x16 */
  74. /* end device-dependent registers */
  75.     u_int    mt_resid;    /* residual count. SCSI Info bytes. */
  76. /* the following two are not yet implemented */
  77.     daddr_t    mt_fileno;    /* file number of current position */
  78.     daddr_t    mt_blkno;    /* block number of current position */
  79. /* end not yet implemented */
  80. };
  81.  
  82. /*
  83.  * Constants for mt_type byte.  These are the same
  84.  * for controllers compatible with the types listed.
  85.  */
  86. #define    MT_ISTS        0x01        /* TS-11 */
  87. #define    MT_ISHT        0x02        /* TM03 Massbus: TE16, TU45, TU77 */
  88. #define    MT_ISTM        0x03        /* TM11/TE10 Unibus */
  89. #define    MT_ISMT        0x04        /* TM78/TU78 Massbus */
  90. #define    MT_ISUT        0x05        /* SI TU-45 emulation on Unibus */
  91. #define    MT_ISCPC    0x06        /* SUN */
  92. #define    MT_ISAR        0x07        /* SUN */
  93. #define    MT_ISTMSCP    0x08        /* DEC TMSCP protocol (TU81, TK50) */
  94. #define MT_ISGS        0x09        /* Generic SCSI Tape */
  95. #define MT_ISEXB    0x0A        /* Exabyte Tape */
  96.  
  97. /* mag tape io control commands */
  98. #define    MTIOCTOP    _IOW('m', 1, struct mtop)    /* do a mag tape op */
  99. #define    MTIOCGET    _IOR('m', 2, struct mtget)    /* get tape status */
  100. #define MTIOCIEOT    _IO('m',  3)            /* ignore EOT error */
  101. #define MTIOCEEOT    _IO('m',  4)            /* enable EOT error */
  102.  
  103. #ifndef KERNEL
  104. #define    DEFTAPE    "/dev/rxt0"
  105. #endif
  106.  
  107. #endif    _MTIO_
  108.  
  109.