osst_options.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. The compile-time configurable defaults for the Linux SCSI tape driver.
  4. Copyright 1995 Kai Makisara.
  5. Last modified: Wed Sep 2 21:24:07 1998 by root@home
  6. Changed (and renamed) for OnStream SCSI drives garloff@suse.de
  7. 2000-06-21
  8. $Header: /cvsroot/osst/Driver/osst_options.h,v 1.6 2003/12/23 14:22:12 wriede Exp $
  9. */
  10. #ifndef _OSST_OPTIONS_H
  11. #define _OSST_OPTIONS_H
  12. /* The minimum limit for the number of SCSI tape devices is determined by
  13. OSST_MAX_TAPES. If the number of tape devices and the "slack" defined by
  14. OSST_EXTRA_DEVS exceeds OSST_MAX_TAPES, the large number is used. */
  15. #define OSST_MAX_TAPES 4
  16. /* If OSST_IN_FILE_POS is nonzero, the driver positions the tape after the
  17. record been read by the user program even if the tape has moved further
  18. because of buffered reads. Should be set to zero to support also drives
  19. that can't space backwards over records. NOTE: The tape will be
  20. spaced backwards over an "accidentally" crossed filemark in any case. */
  21. #define OSST_IN_FILE_POS 1
  22. /* The tape driver buffer size in kilobytes. */
  23. /* Don't change, as this is the HW blocksize */
  24. #define OSST_BUFFER_BLOCKS 32
  25. /* The number of kilobytes of data in the buffer that triggers an
  26. asynchronous write in fixed block mode. See also OSST_ASYNC_WRITES
  27. below. */
  28. #define OSST_WRITE_THRESHOLD_BLOCKS 32
  29. /* OSST_EOM_RESERVE defines the number of frames are kept in reserve for
  30. * * write error recovery when writing near end of medium. ENOSPC is returned
  31. * * when write() is called and the tape write position is within this number
  32. * * of blocks from the tape capacity. */
  33. #define OSST_EOM_RESERVE 300
  34. /* The maximum number of tape buffers the driver allocates. The number
  35. is also constrained by the number of drives detected. Determines the
  36. maximum number of concurrently active tape drives. */
  37. #define OSST_MAX_BUFFERS OSST_MAX_TAPES
  38. /* Maximum number of scatter/gather segments */
  39. /* Fit one buffer in pages and add one for the AUX header */
  40. #define OSST_MAX_SG (((OSST_BUFFER_BLOCKS*1024) / PAGE_SIZE) + 1)
  41. /* The number of scatter/gather segments to allocate at first try (must be
  42. smaller or equal to the maximum). */
  43. #define OSST_FIRST_SG ((OSST_BUFFER_BLOCKS*1024) / PAGE_SIZE)
  44. /* The size of the first scatter/gather segments (determines the maximum block
  45. size for SCSI adapters not supporting scatter/gather). The default is set
  46. to try to allocate the buffer as one chunk. */
  47. #define OSST_FIRST_ORDER (15-PAGE_SHIFT)
  48. /* The following lines define defaults for properties that can be set
  49. separately for each drive using the MTSTOPTIONS ioctl. */
  50. /* If OSST_TWO_FM is non-zero, the driver writes two filemarks after a
  51. file being written. Some drives can't handle two filemarks at the
  52. end of data. */
  53. #define OSST_TWO_FM 0
  54. /* If OSST_BUFFER_WRITES is non-zero, writes in fixed block mode are
  55. buffered until the driver buffer is full or asynchronous write is
  56. triggered. */
  57. #define OSST_BUFFER_WRITES 1
  58. /* If OSST_ASYNC_WRITES is non-zero, the SCSI write command may be started
  59. without waiting for it to finish. May cause problems in multiple
  60. tape backups. */
  61. #define OSST_ASYNC_WRITES 1
  62. /* If OSST_READ_AHEAD is non-zero, blocks are read ahead in fixed block
  63. mode. */
  64. #define OSST_READ_AHEAD 1
  65. /* If OSST_AUTO_LOCK is non-zero, the drive door is locked at the first
  66. read or write command after the device is opened. The door is opened
  67. when the device is closed. */
  68. #define OSST_AUTO_LOCK 0
  69. /* If OSST_FAST_MTEOM is non-zero, the MTEOM ioctl is done using the
  70. direct SCSI command. The file number status is lost but this method
  71. is fast with some drives. Otherwise MTEOM is done by spacing over
  72. files and the file number status is retained. */
  73. #define OSST_FAST_MTEOM 0
  74. /* If OSST_SCSI2LOGICAL is nonzero, the logical block addresses are used for
  75. MTIOCPOS and MTSEEK by default. Vendor addresses are used if OSST_SCSI2LOGICAL
  76. is zero. */
  77. #define OSST_SCSI2LOGICAL 0
  78. /* If OSST_SYSV is non-zero, the tape behaves according to the SYS V semantics.
  79. The default is BSD semantics. */
  80. #define OSST_SYSV 0
  81. #endif