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