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