Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003    The compile-time configurable defaults for the Linux SCSI tape driver.
0004 
0005    Copyright 1995-2003 Kai Makisara.
0006 
0007    Last modified: Thu Feb 21 21:47:07 2008 by kai.makisara
0008 */
0009 
0010 #ifndef _ST_OPTIONS_H
0011 #define _ST_OPTIONS_H
0012 
0013 /* If TRY_DIRECT_IO is non-zero, the driver tries to transfer data directly
0014    between the user buffer and tape drive. If this is not possible, driver
0015    buffer is used. If TRY_DIRECT_IO is zero, driver buffer is always used. */
0016 #define TRY_DIRECT_IO 1
0017 
0018 /* The driver does not wait for some operations to finish before returning
0019    to the user program if ST_NOWAIT is non-zero. This helps if the SCSI
0020    adapter does not support multiple outstanding commands. However, the user
0021    should not give a new tape command before the previous one has finished. */
0022 #define ST_NOWAIT 0
0023 
0024 /* If ST_IN_FILE_POS is nonzero, the driver positions the tape after the
0025    record been read by the user program even if the tape has moved further
0026    because of buffered reads. Should be set to zero to support also drives
0027    that can't space backwards over records. NOTE: The tape will be
0028    spaced backwards over an "accidentally" crossed filemark in any case. */
0029 #define ST_IN_FILE_POS 0
0030 
0031 /* If ST_RECOVERED_WRITE_FATAL is non-zero, recovered errors while writing
0032    are considered "hard errors". */
0033 #define ST_RECOVERED_WRITE_FATAL 0
0034 
0035 /* The "guess" for the block size for devices that don't support MODE
0036    SENSE. */
0037 #define ST_DEFAULT_BLOCK 0
0038 
0039 /* The minimum tape driver buffer size in kilobytes in fixed block mode.
0040    Must be non-zero. */
0041 #define ST_FIXED_BUFFER_BLOCKS 32
0042 
0043 /* Maximum number of scatter/gather segments */
0044 #define ST_MAX_SG      256
0045 
0046 /* The number of scatter/gather segments to allocate at first try (must be
0047    smaller or equal to the maximum). */
0048 #define ST_FIRST_SG    8
0049 
0050 /* The size of the first scatter/gather segments (determines the maximum block
0051    size for SCSI adapters not supporting scatter/gather). The default is set
0052    to try to allocate the buffer as one chunk. */
0053 #define ST_FIRST_ORDER  5
0054 
0055 
0056 /* The following lines define defaults for properties that can be set
0057    separately for each drive using the MTSTOPTIONS ioctl. */
0058 
0059 /* If ST_TWO_FM is non-zero, the driver writes two filemarks after a
0060    file being written. Some drives can't handle two filemarks at the
0061    end of data. */
0062 #define ST_TWO_FM 0
0063 
0064 /* If ST_BUFFER_WRITES is non-zero, writes in fixed block mode are
0065    buffered until the driver buffer is full or asynchronous write is
0066    triggered. May make detection of End-Of-Medium early enough fail. */
0067 #define ST_BUFFER_WRITES 1
0068 
0069 /* If ST_ASYNC_WRITES is non-zero, the SCSI write command may be started
0070    without waiting for it to finish. May cause problems in multiple
0071    tape backups. */
0072 #define ST_ASYNC_WRITES 1
0073 
0074 /* If ST_READ_AHEAD is non-zero, blocks are read ahead in fixed block
0075    mode. */
0076 #define ST_READ_AHEAD 1
0077 
0078 /* If ST_AUTO_LOCK is non-zero, the drive door is locked at the first
0079    read or write command after the device is opened. The door is opened
0080    when the device is closed. */
0081 #define ST_AUTO_LOCK 0
0082 
0083 /* If ST_FAST_MTEOM is non-zero, the MTEOM ioctl is done using the
0084    direct SCSI command. The file number status is lost but this method
0085    is fast with some drives. Otherwise MTEOM is done by spacing over
0086    files and the file number status is retained. */
0087 #define ST_FAST_MTEOM 0
0088 
0089 /* If ST_SCSI2LOGICAL is nonzero, the logical block addresses are used for
0090    MTIOCPOS and MTSEEK by default. Vendor addresses are used if ST_SCSI2LOGICAL
0091    is zero. */
0092 #define ST_SCSI2LOGICAL 0
0093 
0094 /* If ST_SYSV is non-zero, the tape behaves according to the SYS V semantics.
0095    The default is BSD semantics. */
0096 #define ST_SYSV 0
0097 
0098 /* If ST_SILI is non-zero, the SILI bit is set when reading in variable block
0099    mode and the block size is determined using the residual returned by the HBA. */
0100 #define ST_SILI 0
0101 
0102 /* Time to wait for the drive to become ready if blocking open */
0103 #define ST_BLOCK_SECONDS     120
0104 
0105 #endif