5 $Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/st.h,v 1.1 1992/04/24 18:01:50 root Exp root $
11 #include <linux/devfs_fs_kernel.h>
13 /* The tape buffer descriptor. */
16 unsigned char dma
; /* DMA-able buffer */
24 Scsi_Request
*last_SRpnt
;
25 unsigned char *b_data
;
26 unsigned short use_sg
; /* zero or number of segments for this adapter */
27 unsigned short sg_segs
; /* total number of allocated segments */
28 unsigned short orig_sg_segs
; /* number of segments allocated at first try */
29 struct scatterlist sg
[1]; /* MUST BE last item */
33 /* The tape mode definition */
35 unsigned char defined
;
36 unsigned char sysv
; /* SYS V semantics? */
37 unsigned char do_async_writes
;
38 unsigned char do_buffer_writes
;
39 unsigned char do_read_ahead
;
40 unsigned char defaults_for_writes
;
41 unsigned char default_compression
; /* 0 = don't touch, etc */
42 short default_density
; /* Forced density, -1 = no value */
43 int default_blksize
; /* Forced blocksize, -1 = no value */
46 #define ST_NBR_MODE_BITS 2
47 #define ST_NBR_MODES (1 << ST_NBR_MODE_BITS)
48 #define ST_MODE_SHIFT (7 - ST_NBR_MODE_BITS)
49 #define ST_MODE_MASK ((ST_NBR_MODES - 1) << ST_MODE_SHIFT)
50 #define ST_MAX_TAPES (1 << ST_MODE_SHIFT)
52 /* The status related to each partition */
57 unsigned char last_block_valid
;
58 u32 last_block_visited
;
59 int drv_block
; /* The block where the drive head is */
63 #define ST_NBR_PARTITIONS 4
65 /* The tape drive descriptor */
72 /* Drive characteristics */
73 unsigned char omit_blklims
;
74 unsigned char do_auto_lock
;
75 unsigned char can_bsr
;
76 unsigned char can_partitions
;
78 unsigned char fast_mteom
;
79 unsigned char restr_dma
;
80 unsigned char scsi2_logical
;
81 unsigned char default_drvbuffer
; /* 0xff = don't touch, value 3 bits */
84 int timeout
; /* timeout for normal commands */
85 int long_timeout
; /* timeout for commands known to take long time */
87 /* Mode characteristics */
88 ST_mode modes
[ST_NBR_MODES
];
90 devfs_handle_t de_r
[ST_NBR_MODES
]; /* Rewind entries */
91 devfs_handle_t de_n
[ST_NBR_MODES
]; /* No-rewind entries */
93 /* Status variables */
96 int nbr_partitions
; /* zero until partition support enabled */
97 ST_partstat ps
[ST_NBR_PARTITIONS
];
100 unsigned char write_prot
;
101 unsigned char drv_write_prot
;
102 unsigned char in_use
;
103 unsigned char blksize_changed
;
104 unsigned char density_changed
;
105 unsigned char compression_changed
;
106 unsigned char drv_buffer
;
107 unsigned char density
;
108 unsigned char door_locked
;
109 unsigned char autorew_dev
; /* auto-rewind device */
110 unsigned char rew_at_close
; /* rewind necessary at close */
111 unsigned char inited
;
115 int recover_count
; /* From tape opening */
116 int recover_reg
; /* From last status call */
119 unsigned char write_pending
;
122 unsigned char last_cmnd
[6];
123 unsigned char last_sense
[16];
133 #define ST_EOM_ERROR 4
137 /* EOD hit while reading => ST_EOD_1 => return zero => ST_EOD_2 =>
138 return zero => ST_EOD, return ENOSPC */
145 /* Values of ready state */
147 #define ST_NOT_READY 1
150 /* Values for door lock state */
151 #define ST_UNLOCKED 0
152 #define ST_LOCKED_EXPLICIT 1
153 #define ST_LOCKED_AUTO 2
154 #define ST_LOCK_FAILS 3
156 /* Positioning SCSI-commands for Tandberg, etc. drives */
157 #define QFA_REQUEST_BLOCK 0x02
158 #define QFA_SEEK_BLOCK 0x0c
160 /* Setting the binary options */
161 #define ST_DONT_TOUCH 0