vserver 1.9.5.x5
[linux-2.6.git] / drivers / scsi / sym53c8xx_2 / sym53c8xx.h
1 /*
2  * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family 
3  * of PCI-SCSI IO processors.
4  *
5  * Copyright (C) 1999-2001  Gerard Roudier <groudier@free.fr>
6  *
7  * This driver is derived from the Linux sym53c8xx driver.
8  * Copyright (C) 1998-2000  Gerard Roudier
9  *
10  * The sym53c8xx driver is derived from the ncr53c8xx driver that had been 
11  * a port of the FreeBSD ncr driver to Linux-1.2.13.
12  *
13  * The original ncr driver has been written for 386bsd and FreeBSD by
14  *         Wolfgang Stanglmeier        <wolf@cologne.de>
15  *         Stefan Esser                <se@mi.Uni-Koeln.de>
16  * Copyright (C) 1994  Wolfgang Stanglmeier
17  *
18  * Other major contributions:
19  *
20  * NVRAM detection and reading.
21  * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
22  *
23  *-----------------------------------------------------------------------------
24  *
25  * This program is free software; you can redistribute it and/or modify
26  * it under the terms of the GNU General Public License as published by
27  * the Free Software Foundation; either version 2 of the License, or
28  * (at your option) any later version.
29  *
30  * This program is distributed in the hope that it will be useful,
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33  * GNU General Public License for more details.
34  *
35  * You should have received a copy of the GNU General Public License
36  * along with this program; if not, write to the Free Software
37  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
38  */
39
40 #ifndef SYM53C8XX_H
41 #define SYM53C8XX_H
42
43 #include <linux/config.h>
44
45 #ifdef CONFIG_SCSI_SYM53C8XX_IOMAPPED
46 #define SYM_CONF_IOMAPPED
47 #endif
48
49 /*
50  *  DMA addressing mode.
51  *
52  *  0 : 32 bit addressing for all chips.
53  *  1 : 40 bit addressing when supported by chip.
54  *  2 : 64 bit addressing when supported by chip,
55  *      limited to 16 segments of 4 GB -> 64 GB max.
56  */
57 #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
58
59 /*
60  *  NVRAM support.
61  */
62 #if 1
63 #define SYM_CONF_NVRAM_SUPPORT          (1)
64 #endif
65
66 /*
67  *  These options are not tunable from 'make config'
68  */
69 #if 1
70 #define SYM_LINUX_PROC_INFO_SUPPORT
71 #define SYM_LINUX_USER_COMMAND_SUPPORT
72 #define SYM_LINUX_USER_INFO_SUPPORT
73 #define SYM_LINUX_DEBUG_CONTROL_SUPPORT
74 #endif
75
76 /*
77  *  Also handle old NCR chips if not (0).
78  */
79 #define SYM_CONF_GENERIC_SUPPORT        (1)
80
81 /*
82  *  Allow tags from 2 to 256, default 8
83  */
84 #ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
85 #define CONFIG_SCSI_SYM53C8XX_MAX_TAGS  (8)
86 #endif
87
88 #if     CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
89 #define SYM_CONF_MAX_TAG        (2)
90 #elif   CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
91 #define SYM_CONF_MAX_TAG        (256)
92 #else
93 #define SYM_CONF_MAX_TAG        CONFIG_SCSI_SYM53C8XX_MAX_TAGS
94 #endif
95
96 #ifndef CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
97 #define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS      SYM_CONF_MAX_TAG
98 #endif
99
100 /*
101  *  Anyway, we configure the driver for at least 64 tags per LUN. :)
102  */
103 #if     SYM_CONF_MAX_TAG <= 64
104 #define SYM_CONF_MAX_TAG_ORDER  (6)
105 #elif   SYM_CONF_MAX_TAG <= 128
106 #define SYM_CONF_MAX_TAG_ORDER  (7)
107 #else
108 #define SYM_CONF_MAX_TAG_ORDER  (8)
109 #endif
110
111 /*
112  *  Max number of SG entries.
113  */
114 #define SYM_CONF_MAX_SG         (96)
115
116 /*
117  *  Driver setup structure.
118  *
119  *  This structure is initialized from linux config options.
120  *  It can be overridden at boot-up by the boot command line.
121  */
122 struct sym_driver_setup {
123         u_short max_tag;
124         u_char  burst_order;
125         u_char  scsi_led;
126         u_char  scsi_diff;
127         u_char  irq_mode;
128         u_char  scsi_bus_check;
129         u_char  host_id;
130
131         u_char  verbose;
132         u_char  settle_delay;
133         u_char  use_nvram;
134         u_long  excludes[8];
135         char    tag_ctrl[100];
136 };
137
138 #define SYM_SETUP_MAX_TAG               sym_driver_setup.max_tag
139 #define SYM_SETUP_BURST_ORDER           sym_driver_setup.burst_order
140 #define SYM_SETUP_SCSI_LED              sym_driver_setup.scsi_led
141 #define SYM_SETUP_SCSI_DIFF             sym_driver_setup.scsi_diff
142 #define SYM_SETUP_IRQ_MODE              sym_driver_setup.irq_mode
143 #define SYM_SETUP_SCSI_BUS_CHECK        sym_driver_setup.scsi_bus_check
144 #define SYM_SETUP_HOST_ID               sym_driver_setup.host_id
145 #define boot_verbose                    sym_driver_setup.verbose
146
147 /* Always enable parity. */
148 #define SYM_SETUP_PCI_PARITY            1
149 #define SYM_SETUP_SCSI_PARITY           1
150
151 /*
152  *  Initial setup.
153  *
154  *  Can be overriden at startup by a command line.
155  */
156 #define SYM_LINUX_DRIVER_SETUP  {                               \
157         .max_tag        = CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS,   \
158         .burst_order    = 7,                                    \
159         .scsi_led       = 1,                                    \
160         .scsi_diff      = 1,                                    \
161         .irq_mode       = 0,                                    \
162         .scsi_bus_check = 1,                                    \
163         .host_id        = 7,                                    \
164         .verbose        = 0,                                    \
165         .settle_delay   = 3,                                    \
166         .use_nvram      = 1,                                    \
167 }
168
169 extern struct sym_driver_setup sym_driver_setup;
170 extern unsigned int sym_debug_flags;
171 #define DEBUG_FLAGS     sym_debug_flags
172
173 #endif /* SYM53C8XX_H */