11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds The compile-time configurable defaults for the Linux SCSI tape driver. 31da177e4SLinus Torvalds 41da177e4SLinus Torvalds Copyright 1995-2003 Kai Makisara. 51da177e4SLinus Torvalds 6*40f6b36cSKai Makisara Last modified: Thu Feb 21 21:47:07 2008 by kai.makisara 71da177e4SLinus Torvalds */ 81da177e4SLinus Torvalds 91da177e4SLinus Torvalds #ifndef _ST_OPTIONS_H 101da177e4SLinus Torvalds #define _ST_OPTIONS_H 111da177e4SLinus Torvalds 121da177e4SLinus Torvalds /* If TRY_DIRECT_IO is non-zero, the driver tries to transfer data directly 131da177e4SLinus Torvalds between the user buffer and tape drive. If this is not possible, driver 141da177e4SLinus Torvalds buffer is used. If TRY_DIRECT_IO is zero, driver buffer is always used. */ 151da177e4SLinus Torvalds #define TRY_DIRECT_IO 1 161da177e4SLinus Torvalds 171da177e4SLinus Torvalds /* The driver does not wait for some operations to finish before returning 181da177e4SLinus Torvalds to the user program if ST_NOWAIT is non-zero. This helps if the SCSI 191da177e4SLinus Torvalds adapter does not support multiple outstanding commands. However, the user 201da177e4SLinus Torvalds should not give a new tape command before the previous one has finished. */ 211da177e4SLinus Torvalds #define ST_NOWAIT 0 221da177e4SLinus Torvalds 231da177e4SLinus Torvalds /* If ST_IN_FILE_POS is nonzero, the driver positions the tape after the 241da177e4SLinus Torvalds record been read by the user program even if the tape has moved further 251da177e4SLinus Torvalds because of buffered reads. Should be set to zero to support also drives 261da177e4SLinus Torvalds that can't space backwards over records. NOTE: The tape will be 271da177e4SLinus Torvalds spaced backwards over an "accidentally" crossed filemark in any case. */ 281da177e4SLinus Torvalds #define ST_IN_FILE_POS 0 291da177e4SLinus Torvalds 301da177e4SLinus Torvalds /* If ST_RECOVERED_WRITE_FATAL is non-zero, recovered errors while writing 311da177e4SLinus Torvalds are considered "hard errors". */ 321da177e4SLinus Torvalds #define ST_RECOVERED_WRITE_FATAL 0 331da177e4SLinus Torvalds 341da177e4SLinus Torvalds /* The "guess" for the block size for devices that don't support MODE 351da177e4SLinus Torvalds SENSE. */ 361da177e4SLinus Torvalds #define ST_DEFAULT_BLOCK 0 371da177e4SLinus Torvalds 381da177e4SLinus Torvalds /* The minimum tape driver buffer size in kilobytes in fixed block mode. 391da177e4SLinus Torvalds Must be non-zero. */ 401da177e4SLinus Torvalds #define ST_FIXED_BUFFER_BLOCKS 32 411da177e4SLinus Torvalds 421da177e4SLinus Torvalds /* Maximum number of scatter/gather segments */ 431da177e4SLinus Torvalds #define ST_MAX_SG 256 441da177e4SLinus Torvalds 451da177e4SLinus Torvalds /* The number of scatter/gather segments to allocate at first try (must be 461da177e4SLinus Torvalds smaller or equal to the maximum). */ 471da177e4SLinus Torvalds #define ST_FIRST_SG 8 481da177e4SLinus Torvalds 491da177e4SLinus Torvalds /* The size of the first scatter/gather segments (determines the maximum block 501da177e4SLinus Torvalds size for SCSI adapters not supporting scatter/gather). The default is set 511da177e4SLinus Torvalds to try to allocate the buffer as one chunk. */ 521da177e4SLinus Torvalds #define ST_FIRST_ORDER 5 531da177e4SLinus Torvalds 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds /* The following lines define defaults for properties that can be set 561da177e4SLinus Torvalds separately for each drive using the MTSTOPTIONS ioctl. */ 571da177e4SLinus Torvalds 581da177e4SLinus Torvalds /* If ST_TWO_FM is non-zero, the driver writes two filemarks after a 591da177e4SLinus Torvalds file being written. Some drives can't handle two filemarks at the 601da177e4SLinus Torvalds end of data. */ 611da177e4SLinus Torvalds #define ST_TWO_FM 0 621da177e4SLinus Torvalds 631da177e4SLinus Torvalds /* If ST_BUFFER_WRITES is non-zero, writes in fixed block mode are 641da177e4SLinus Torvalds buffered until the driver buffer is full or asynchronous write is 651da177e4SLinus Torvalds triggered. May make detection of End-Of-Medium early enough fail. */ 661da177e4SLinus Torvalds #define ST_BUFFER_WRITES 1 671da177e4SLinus Torvalds 681da177e4SLinus Torvalds /* If ST_ASYNC_WRITES is non-zero, the SCSI write command may be started 691da177e4SLinus Torvalds without waiting for it to finish. May cause problems in multiple 701da177e4SLinus Torvalds tape backups. */ 711da177e4SLinus Torvalds #define ST_ASYNC_WRITES 1 721da177e4SLinus Torvalds 731da177e4SLinus Torvalds /* If ST_READ_AHEAD is non-zero, blocks are read ahead in fixed block 741da177e4SLinus Torvalds mode. */ 751da177e4SLinus Torvalds #define ST_READ_AHEAD 1 761da177e4SLinus Torvalds 771da177e4SLinus Torvalds /* If ST_AUTO_LOCK is non-zero, the drive door is locked at the first 781da177e4SLinus Torvalds read or write command after the device is opened. The door is opened 791da177e4SLinus Torvalds when the device is closed. */ 801da177e4SLinus Torvalds #define ST_AUTO_LOCK 0 811da177e4SLinus Torvalds 821da177e4SLinus Torvalds /* If ST_FAST_MTEOM is non-zero, the MTEOM ioctl is done using the 831da177e4SLinus Torvalds direct SCSI command. The file number status is lost but this method 841da177e4SLinus Torvalds is fast with some drives. Otherwise MTEOM is done by spacing over 851da177e4SLinus Torvalds files and the file number status is retained. */ 861da177e4SLinus Torvalds #define ST_FAST_MTEOM 0 871da177e4SLinus Torvalds 881da177e4SLinus Torvalds /* If ST_SCSI2LOGICAL is nonzero, the logical block addresses are used for 891da177e4SLinus Torvalds MTIOCPOS and MTSEEK by default. Vendor addresses are used if ST_SCSI2LOGICAL 901da177e4SLinus Torvalds is zero. */ 911da177e4SLinus Torvalds #define ST_SCSI2LOGICAL 0 921da177e4SLinus Torvalds 931da177e4SLinus Torvalds /* If ST_SYSV is non-zero, the tape behaves according to the SYS V semantics. 941da177e4SLinus Torvalds The default is BSD semantics. */ 951da177e4SLinus Torvalds #define ST_SYSV 0 961da177e4SLinus Torvalds 97*40f6b36cSKai Makisara /* If ST_SILI is non-zero, the SILI bit is set when reading in variable block 98*40f6b36cSKai Makisara mode and the block size is determined using the residual returned by the HBA. */ 99*40f6b36cSKai Makisara #define ST_SILI 0 100*40f6b36cSKai Makisara 1011da177e4SLinus Torvalds /* Time to wait for the drive to become ready if blocking open */ 1021da177e4SLinus Torvalds #define ST_BLOCK_SECONDS 120 1031da177e4SLinus Torvalds 1041da177e4SLinus Torvalds #endif 105