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