xref: /linux/drivers/scsi/st_options.h (revision 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2)
1*1da177e4SLinus Torvalds /*
2*1da177e4SLinus Torvalds    The compile-time configurable defaults for the Linux SCSI tape driver.
3*1da177e4SLinus Torvalds 
4*1da177e4SLinus Torvalds    Copyright 1995-2003 Kai Makisara.
5*1da177e4SLinus Torvalds 
6*1da177e4SLinus Torvalds    Last modified: Mon Apr  7 22:49:18 2003 by makisara
7*1da177e4SLinus Torvalds */
8*1da177e4SLinus Torvalds 
9*1da177e4SLinus Torvalds #ifndef _ST_OPTIONS_H
10*1da177e4SLinus Torvalds #define _ST_OPTIONS_H
11*1da177e4SLinus Torvalds 
12*1da177e4SLinus Torvalds /* If TRY_DIRECT_IO is non-zero, the driver tries to transfer data directly
13*1da177e4SLinus Torvalds    between the user buffer and tape drive. If this is not possible, driver
14*1da177e4SLinus Torvalds    buffer is used. If TRY_DIRECT_IO is zero, driver buffer is always used. */
15*1da177e4SLinus Torvalds #define TRY_DIRECT_IO 1
16*1da177e4SLinus Torvalds 
17*1da177e4SLinus Torvalds /* The driver does not wait for some operations to finish before returning
18*1da177e4SLinus Torvalds    to the user program if ST_NOWAIT is non-zero. This helps if the SCSI
19*1da177e4SLinus Torvalds    adapter does not support multiple outstanding commands. However, the user
20*1da177e4SLinus Torvalds    should not give a new tape command before the previous one has finished. */
21*1da177e4SLinus Torvalds #define ST_NOWAIT 0
22*1da177e4SLinus Torvalds 
23*1da177e4SLinus Torvalds /* If ST_IN_FILE_POS is nonzero, the driver positions the tape after the
24*1da177e4SLinus Torvalds    record been read by the user program even if the tape has moved further
25*1da177e4SLinus Torvalds    because of buffered reads. Should be set to zero to support also drives
26*1da177e4SLinus Torvalds    that can't space backwards over records. NOTE: The tape will be
27*1da177e4SLinus Torvalds    spaced backwards over an "accidentally" crossed filemark in any case. */
28*1da177e4SLinus Torvalds #define ST_IN_FILE_POS 0
29*1da177e4SLinus Torvalds 
30*1da177e4SLinus Torvalds /* If ST_RECOVERED_WRITE_FATAL is non-zero, recovered errors while writing
31*1da177e4SLinus Torvalds    are considered "hard errors". */
32*1da177e4SLinus Torvalds #define ST_RECOVERED_WRITE_FATAL 0
33*1da177e4SLinus Torvalds 
34*1da177e4SLinus Torvalds /* The "guess" for the block size for devices that don't support MODE
35*1da177e4SLinus Torvalds    SENSE. */
36*1da177e4SLinus Torvalds #define ST_DEFAULT_BLOCK 0
37*1da177e4SLinus Torvalds 
38*1da177e4SLinus Torvalds /* The minimum tape driver buffer size in kilobytes in fixed block mode.
39*1da177e4SLinus Torvalds    Must be non-zero. */
40*1da177e4SLinus Torvalds #define ST_FIXED_BUFFER_BLOCKS 32
41*1da177e4SLinus Torvalds 
42*1da177e4SLinus Torvalds /* Maximum number of scatter/gather segments */
43*1da177e4SLinus Torvalds #define ST_MAX_SG      256
44*1da177e4SLinus Torvalds 
45*1da177e4SLinus Torvalds /* The number of scatter/gather segments to allocate at first try (must be
46*1da177e4SLinus Torvalds    smaller or equal to the maximum). */
47*1da177e4SLinus Torvalds #define ST_FIRST_SG    8
48*1da177e4SLinus Torvalds 
49*1da177e4SLinus Torvalds /* The size of the first scatter/gather segments (determines the maximum block
50*1da177e4SLinus Torvalds    size for SCSI adapters not supporting scatter/gather). The default is set
51*1da177e4SLinus Torvalds    to try to allocate the buffer as one chunk. */
52*1da177e4SLinus Torvalds #define ST_FIRST_ORDER  5
53*1da177e4SLinus Torvalds 
54*1da177e4SLinus Torvalds 
55*1da177e4SLinus Torvalds /* The following lines define defaults for properties that can be set
56*1da177e4SLinus Torvalds    separately for each drive using the MTSTOPTIONS ioctl. */
57*1da177e4SLinus Torvalds 
58*1da177e4SLinus Torvalds /* If ST_TWO_FM is non-zero, the driver writes two filemarks after a
59*1da177e4SLinus Torvalds    file being written. Some drives can't handle two filemarks at the
60*1da177e4SLinus Torvalds    end of data. */
61*1da177e4SLinus Torvalds #define ST_TWO_FM 0
62*1da177e4SLinus Torvalds 
63*1da177e4SLinus Torvalds /* If ST_BUFFER_WRITES is non-zero, writes in fixed block mode are
64*1da177e4SLinus Torvalds    buffered until the driver buffer is full or asynchronous write is
65*1da177e4SLinus Torvalds    triggered. May make detection of End-Of-Medium early enough fail. */
66*1da177e4SLinus Torvalds #define ST_BUFFER_WRITES 1
67*1da177e4SLinus Torvalds 
68*1da177e4SLinus Torvalds /* If ST_ASYNC_WRITES is non-zero, the SCSI write command may be started
69*1da177e4SLinus Torvalds    without waiting for it to finish. May cause problems in multiple
70*1da177e4SLinus Torvalds    tape backups. */
71*1da177e4SLinus Torvalds #define ST_ASYNC_WRITES 1
72*1da177e4SLinus Torvalds 
73*1da177e4SLinus Torvalds /* If ST_READ_AHEAD is non-zero, blocks are read ahead in fixed block
74*1da177e4SLinus Torvalds    mode. */
75*1da177e4SLinus Torvalds #define ST_READ_AHEAD 1
76*1da177e4SLinus Torvalds 
77*1da177e4SLinus Torvalds /* If ST_AUTO_LOCK is non-zero, the drive door is locked at the first
78*1da177e4SLinus Torvalds    read or write command after the device is opened. The door is opened
79*1da177e4SLinus Torvalds    when the device is closed. */
80*1da177e4SLinus Torvalds #define ST_AUTO_LOCK 0
81*1da177e4SLinus Torvalds 
82*1da177e4SLinus Torvalds /* If ST_FAST_MTEOM is non-zero, the MTEOM ioctl is done using the
83*1da177e4SLinus Torvalds    direct SCSI command. The file number status is lost but this method
84*1da177e4SLinus Torvalds    is fast with some drives. Otherwise MTEOM is done by spacing over
85*1da177e4SLinus Torvalds    files and the file number status is retained. */
86*1da177e4SLinus Torvalds #define ST_FAST_MTEOM 0
87*1da177e4SLinus Torvalds 
88*1da177e4SLinus Torvalds /* If ST_SCSI2LOGICAL is nonzero, the logical block addresses are used for
89*1da177e4SLinus Torvalds    MTIOCPOS and MTSEEK by default. Vendor addresses are used if ST_SCSI2LOGICAL
90*1da177e4SLinus Torvalds    is zero. */
91*1da177e4SLinus Torvalds #define ST_SCSI2LOGICAL 0
92*1da177e4SLinus Torvalds 
93*1da177e4SLinus Torvalds /* If ST_SYSV is non-zero, the tape behaves according to the SYS V semantics.
94*1da177e4SLinus Torvalds    The default is BSD semantics. */
95*1da177e4SLinus Torvalds #define ST_SYSV 0
96*1da177e4SLinus Torvalds 
97*1da177e4SLinus Torvalds /* Time to wait for the drive to become ready if blocking open */
98*1da177e4SLinus Torvalds #define ST_BLOCK_SECONDS     120
99*1da177e4SLinus Torvalds 
100*1da177e4SLinus Torvalds #endif
101