st_options.h 3.9 KB

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