root/drivers/scsi/st.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 
   2 #ifndef _ST_H
   3         #define _ST_H
   4 /*
   5         $Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/st.h,v 1.1 1992/04/24 18:01:50 root Exp root $
   6 */
   7 
   8 #ifndef _SCSI_H
   9 #include "scsi.h"
  10 #endif
  11 
  12 /* The tape buffer descriptor. */
  13 typedef struct {
  14   unsigned char in_use;
  15   unsigned char dma;    /* DMA-able buffer */
  16   int buffer_size;
  17   int buffer_blocks;
  18   int buffer_bytes;
  19   int read_pointer;
  20   int writing;
  21   int last_result;
  22   int last_result_fatal;
  23   unsigned char *b_data;
  24   int orig_size;
  25   unsigned char *orig_b_data;
  26 } ST_buffer;
  27 
  28 
  29 /* The tape mode definition */
  30 typedef struct {
  31   unsigned char defined;
  32   unsigned char do_async_writes;
  33   unsigned char do_buffer_writes;
  34   unsigned char defaults_for_writes;
  35   unsigned char default_compression; /* 0 = don't touch, etc */
  36   short default_density; /* Forced density, -1 = no value */
  37   int default_blksize;  /* Forced blocksize, -1 = no value */
  38 } ST_mode;
  39 
  40 #define ST_NBR_MODE_BITS 2
  41 #define ST_NBR_MODES (1 << ST_NBR_MODE_BITS)
  42 #define ST_MODE_SHIFT (7 - ST_NBR_MODE_BITS)
  43 #define ST_MODE_MASK ((ST_NBR_MODES - 1) << ST_MODE_SHIFT)
  44 
  45 /* The tape drive descriptor */
  46 typedef struct {
  47   kdev_t devt;
  48   unsigned capacity;
  49   struct wait_queue * waiting;
  50   Scsi_Device* device;
  51   Scsi_Cmnd SCpnt;
  52   struct semaphore sem;
  53   ST_buffer * buffer;
  54 
  55   /* Drive characteristics */
  56   unsigned char do_read_ahead;
  57   unsigned char do_auto_lock;
  58   unsigned char can_bsr;
  59   unsigned char two_fm;
  60   unsigned char fast_mteom;
  61   unsigned char restr_dma;
  62   unsigned char default_drvbuffer;  /* 0xff = don't touch, value 3 bits */
  63   int write_threshold;
  64 
  65   /* Mode characteristics */
  66   ST_mode modes[ST_NBR_MODES];
  67   int current_mode;
  68 
  69   /* Status variables */
  70   unsigned char dirty;
  71   unsigned char rw;
  72   unsigned char ready;
  73   unsigned char eof;
  74   unsigned char write_prot;
  75   unsigned char drv_write_prot;
  76   unsigned char in_use;
  77   unsigned char eof_hit;
  78   unsigned char moves_after_eof;
  79   unsigned char at_sm;
  80   unsigned char blksize_changed;
  81   unsigned char density_changed;
  82   unsigned char compression_changed;
  83   unsigned char drv_buffer;
  84   unsigned char density;
  85   unsigned char door_locked;
  86   unsigned char rew_at_close;
  87   int block_size;
  88   int min_block;
  89   int max_block;
  90   int recover_count;
  91   int drv_block;        /* The block where the drive head is */
  92   struct mtget * mt_status;
  93 
  94 #if DEBUG
  95   unsigned char write_pending;
  96   int nbr_finished;
  97   int nbr_waits;
  98 #endif
  99 } Scsi_Tape;
 100 
 101 extern Scsi_Tape * scsi_tapes;
 102 
 103 /* Values of eof */
 104 #define ST_NOEOF        0
 105 #define ST_FM           1
 106 #define ST_EOM_OK       2
 107 #define ST_EOM_ERROR    3
 108 #define ST_EOD          4
 109 
 110 /* Values of rw */
 111 #define ST_IDLE         0
 112 #define ST_READING      1
 113 #define ST_WRITING      2
 114 
 115 /* Values of ready state */
 116 #define ST_READY        0
 117 #define ST_NOT_READY    1
 118 #define ST_NO_TAPE      2
 119 
 120 /* Values for door lock state */
 121 #define ST_UNLOCKED     0
 122 #define ST_LOCKED_EXPLICIT 1
 123 #define ST_LOCKED_AUTO  2
 124 #define ST_LOCK_FAILS   3
 125 
 126 /* Positioning SCSI-commands for Tandberg, etc. drives */
 127 #define QFA_REQUEST_BLOCK       0x02
 128 #define QFA_SEEK_BLOCK          0x0c
 129 
 130 /* Setting the binary options */
 131 #define ST_DONT_TOUCH  0
 132 #define ST_NO          1
 133 #define ST_YES         2
 134 
 135 #endif
 136 

/* [previous][next][first][last][top][bottom][index][help] */