1
2 #ifndef _ST_H
3 #define _ST_H
4
5
6
7
8 #ifndef _SCSI_H
9 #include "scsi.h"
10 #endif
11
12 typedef struct {
13 int in_use;
14 int buffer_size;
15 int buffer_blocks;
16 int buffer_bytes;
17 int read_pointer;
18 int writing;
19 int last_result;
20 int last_result_fatal;
21 unsigned char b_data[1];
22 } ST_buffer;
23
24 typedef struct {
25 unsigned capacity;
26 struct wait_queue * waiting;
27 Scsi_Device* device;
28 unsigned char dirty;
29 unsigned char write_pending;
30 unsigned char rw;
31 unsigned char ready;
32 unsigned char eof;
33 unsigned char write_prot;
34 unsigned char drv_write_prot;
35 unsigned char in_use;
36 unsigned char eof_hit;
37 unsigned char drv_buffer;
38 unsigned char do_buffer_writes;
39 unsigned char do_async_writes;
40 unsigned char do_read_ahead;
41 unsigned char do_auto_lock;
42 unsigned char two_fm;
43 unsigned char fast_mteom;
44 unsigned char density;
45 unsigned char door_locked;
46 ST_buffer * buffer;
47 int block_size;
48 int min_block;
49 int max_block;
50 int write_threshold;
51 int recover_count;
52 int drv_block;
53 unsigned char moves_after_eof;
54 unsigned char at_sm;
55 struct mtget * mt_status;
56 Scsi_Cmnd SCpnt;
57 #if DEBUG
58 int nbr_finished;
59 int nbr_waits;
60 #endif
61 } Scsi_Tape;
62
63 extern Scsi_Tape * scsi_tapes;
64
65
66 #define ST_NOEOF 0
67 #define ST_FM 1
68 #define ST_EOM_OK 2
69 #define ST_EOM_ERROR 3
70 #define ST_EOD 4
71
72
73 #define ST_IDLE 0
74 #define ST_READING 1
75 #define ST_WRITING 2
76
77
78 #define ST_READY 0
79 #define ST_NOT_READY 1
80 #define ST_NO_TAPE 2
81
82
83 #define ST_UNLOCKED 0
84 #define ST_LOCKED_EXPLICIT 1
85 #define ST_LOCKED_AUTO 2
86 #define ST_LOCK_FAILS 3
87
88
89 #define QFA_REQUEST_BLOCK 0x02
90 #define QFA_SEEK_BLOCK 0x0c
91
92 #endif
93