Merge tag 'v5.1-rockchip-dtfixes-1' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / drivers / scsi / osst_options.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3    The compile-time configurable defaults for the Linux SCSI tape driver.
4
5    Copyright 1995 Kai Makisara.
6    
7    Last modified: Wed Sep  2 21:24:07 1998 by root@home
8    
9    Changed (and renamed) for OnStream SCSI drives garloff@suse.de
10    2000-06-21
11
12    $Header: /cvsroot/osst/Driver/osst_options.h,v 1.6 2003/12/23 14:22:12 wriede Exp $
13 */
14
15 #ifndef _OSST_OPTIONS_H
16 #define _OSST_OPTIONS_H
17
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
22
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
29
30 /* The tape driver buffer size in kilobytes. */
31 /* Don't change, as this is the HW blocksize */
32 #define OSST_BUFFER_BLOCKS 32
33
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
36    below. */
37 #define OSST_WRITE_THRESHOLD_BLOCKS 32
38
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
44
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 
49
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)
53
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)
57
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)
62
63
64 /* The following lines define defaults for properties that can be set
65    separately for each drive using the MTSTOPTIONS ioctl. */
66
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
69    end of data. */
70 #define OSST_TWO_FM 0
71
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
74    triggered. */
75 #define OSST_BUFFER_WRITES 1
76
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
79    tape backups. */
80 #define OSST_ASYNC_WRITES 1
81
82 /* If OSST_READ_AHEAD is non-zero, blocks are read ahead in fixed block
83    mode. */
84 #define OSST_READ_AHEAD 1
85
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
90
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
96
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
99    is zero. */
100 #define OSST_SCSI2LOGICAL 0
101
102 /* If OSST_SYSV is non-zero, the tape behaves according to the SYS V semantics.
103    The default is BSD semantics. */
104 #define OSST_SYSV 0
105
106
107 #endif