18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci The compile-time configurable defaults for the Linux SCSI tape driver. 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci Copyright 1995-2003 Kai Makisara. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci Last modified: Thu Feb 21 21:47:07 2008 by kai.makisara 88c2ecf20Sopenharmony_ci*/ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef _ST_OPTIONS_H 118c2ecf20Sopenharmony_ci#define _ST_OPTIONS_H 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/* If TRY_DIRECT_IO is non-zero, the driver tries to transfer data directly 148c2ecf20Sopenharmony_ci between the user buffer and tape drive. If this is not possible, driver 158c2ecf20Sopenharmony_ci buffer is used. If TRY_DIRECT_IO is zero, driver buffer is always used. */ 168c2ecf20Sopenharmony_ci#define TRY_DIRECT_IO 1 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* The driver does not wait for some operations to finish before returning 198c2ecf20Sopenharmony_ci to the user program if ST_NOWAIT is non-zero. This helps if the SCSI 208c2ecf20Sopenharmony_ci adapter does not support multiple outstanding commands. However, the user 218c2ecf20Sopenharmony_ci should not give a new tape command before the previous one has finished. */ 228c2ecf20Sopenharmony_ci#define ST_NOWAIT 0 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* If ST_IN_FILE_POS is nonzero, the driver positions the tape after the 258c2ecf20Sopenharmony_ci record been read by the user program even if the tape has moved further 268c2ecf20Sopenharmony_ci because of buffered reads. Should be set to zero to support also drives 278c2ecf20Sopenharmony_ci that can't space backwards over records. NOTE: The tape will be 288c2ecf20Sopenharmony_ci spaced backwards over an "accidentally" crossed filemark in any case. */ 298c2ecf20Sopenharmony_ci#define ST_IN_FILE_POS 0 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* If ST_RECOVERED_WRITE_FATAL is non-zero, recovered errors while writing 328c2ecf20Sopenharmony_ci are considered "hard errors". */ 338c2ecf20Sopenharmony_ci#define ST_RECOVERED_WRITE_FATAL 0 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* The "guess" for the block size for devices that don't support MODE 368c2ecf20Sopenharmony_ci SENSE. */ 378c2ecf20Sopenharmony_ci#define ST_DEFAULT_BLOCK 0 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci/* The minimum tape driver buffer size in kilobytes in fixed block mode. 408c2ecf20Sopenharmony_ci Must be non-zero. */ 418c2ecf20Sopenharmony_ci#define ST_FIXED_BUFFER_BLOCKS 32 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* Maximum number of scatter/gather segments */ 448c2ecf20Sopenharmony_ci#define ST_MAX_SG 256 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci/* The number of scatter/gather segments to allocate at first try (must be 478c2ecf20Sopenharmony_ci smaller or equal to the maximum). */ 488c2ecf20Sopenharmony_ci#define ST_FIRST_SG 8 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci/* The size of the first scatter/gather segments (determines the maximum block 518c2ecf20Sopenharmony_ci size for SCSI adapters not supporting scatter/gather). The default is set 528c2ecf20Sopenharmony_ci to try to allocate the buffer as one chunk. */ 538c2ecf20Sopenharmony_ci#define ST_FIRST_ORDER 5 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* The following lines define defaults for properties that can be set 578c2ecf20Sopenharmony_ci separately for each drive using the MTSTOPTIONS ioctl. */ 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci/* If ST_TWO_FM is non-zero, the driver writes two filemarks after a 608c2ecf20Sopenharmony_ci file being written. Some drives can't handle two filemarks at the 618c2ecf20Sopenharmony_ci end of data. */ 628c2ecf20Sopenharmony_ci#define ST_TWO_FM 0 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/* If ST_BUFFER_WRITES is non-zero, writes in fixed block mode are 658c2ecf20Sopenharmony_ci buffered until the driver buffer is full or asynchronous write is 668c2ecf20Sopenharmony_ci triggered. May make detection of End-Of-Medium early enough fail. */ 678c2ecf20Sopenharmony_ci#define ST_BUFFER_WRITES 1 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci/* If ST_ASYNC_WRITES is non-zero, the SCSI write command may be started 708c2ecf20Sopenharmony_ci without waiting for it to finish. May cause problems in multiple 718c2ecf20Sopenharmony_ci tape backups. */ 728c2ecf20Sopenharmony_ci#define ST_ASYNC_WRITES 1 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci/* If ST_READ_AHEAD is non-zero, blocks are read ahead in fixed block 758c2ecf20Sopenharmony_ci mode. */ 768c2ecf20Sopenharmony_ci#define ST_READ_AHEAD 1 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci/* If ST_AUTO_LOCK is non-zero, the drive door is locked at the first 798c2ecf20Sopenharmony_ci read or write command after the device is opened. The door is opened 808c2ecf20Sopenharmony_ci when the device is closed. */ 818c2ecf20Sopenharmony_ci#define ST_AUTO_LOCK 0 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci/* If ST_FAST_MTEOM is non-zero, the MTEOM ioctl is done using the 848c2ecf20Sopenharmony_ci direct SCSI command. The file number status is lost but this method 858c2ecf20Sopenharmony_ci is fast with some drives. Otherwise MTEOM is done by spacing over 868c2ecf20Sopenharmony_ci files and the file number status is retained. */ 878c2ecf20Sopenharmony_ci#define ST_FAST_MTEOM 0 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/* If ST_SCSI2LOGICAL is nonzero, the logical block addresses are used for 908c2ecf20Sopenharmony_ci MTIOCPOS and MTSEEK by default. Vendor addresses are used if ST_SCSI2LOGICAL 918c2ecf20Sopenharmony_ci is zero. */ 928c2ecf20Sopenharmony_ci#define ST_SCSI2LOGICAL 0 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci/* If ST_SYSV is non-zero, the tape behaves according to the SYS V semantics. 958c2ecf20Sopenharmony_ci The default is BSD semantics. */ 968c2ecf20Sopenharmony_ci#define ST_SYSV 0 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci/* If ST_SILI is non-zero, the SILI bit is set when reading in variable block 998c2ecf20Sopenharmony_ci mode and the block size is determined using the residual returned by the HBA. */ 1008c2ecf20Sopenharmony_ci#define ST_SILI 0 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci/* Time to wait for the drive to become ready if blocking open */ 1038c2ecf20Sopenharmony_ci#define ST_BLOCK_SECONDS 120 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci#endif 106