Linux Audio

Check our new training course

Loading...
v3.1
 
  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
 44/*
 45 *  DMA addressing mode.
 46 *
 47 *  0 : 32 bit addressing for all chips.
 48 *  1 : 40 bit addressing when supported by chip.
 49 *  2 : 64 bit addressing when supported by chip,
 50 *      limited to 16 segments of 4 GB -> 64 GB max.
 51 */
 52#define	SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
 53
 54/*
 55 *  NVRAM support.
 56 */
 57#if 1
 58#define SYM_CONF_NVRAM_SUPPORT		(1)
 59#endif
 60
 61/*
 62 *  These options are not tunable from 'make config'
 63 */
 64#if 1
 65#define	SYM_LINUX_PROC_INFO_SUPPORT
 66#define SYM_LINUX_USER_COMMAND_SUPPORT
 67#define SYM_LINUX_USER_INFO_SUPPORT
 68#define SYM_LINUX_DEBUG_CONTROL_SUPPORT
 69#endif
 70
 71/*
 72 *  Also handle old NCR chips if not (0).
 73 */
 74#define SYM_CONF_GENERIC_SUPPORT	(1)
 75
 76/*
 77 *  Allow tags from 2 to 256, default 8
 78 */
 79#ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
 80#define CONFIG_SCSI_SYM53C8XX_MAX_TAGS	(8)
 81#endif
 82
 83#if	CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
 84#define SYM_CONF_MAX_TAG	(2)
 85#elif	CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
 86#define SYM_CONF_MAX_TAG	(256)
 87#else
 88#define	SYM_CONF_MAX_TAG	CONFIG_SCSI_SYM53C8XX_MAX_TAGS
 89#endif
 90
 91#ifndef	CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
 92#define	CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS	SYM_CONF_MAX_TAG
 93#endif
 94
 95/*
 96 *  Anyway, we configure the driver for at least 64 tags per LUN. :)
 97 */
 98#if	SYM_CONF_MAX_TAG <= 64
 99#define SYM_CONF_MAX_TAG_ORDER	(6)
100#elif	SYM_CONF_MAX_TAG <= 128
101#define SYM_CONF_MAX_TAG_ORDER	(7)
102#else
103#define SYM_CONF_MAX_TAG_ORDER	(8)
104#endif
105
106/*
107 *  Max number of SG entries.
108 */
109#define SYM_CONF_MAX_SG		(96)
110
111/*
112 *  Driver setup structure.
113 *
114 *  This structure is initialized from linux config options.
115 *  It can be overridden at boot-up by the boot command line.
116 */
117struct sym_driver_setup {
118	u_short	max_tag;
119	u_char	burst_order;
120	u_char	scsi_led;
121	u_char	scsi_diff;
122	u_char	irq_mode;
123	u_char	scsi_bus_check;
124	u_char	host_id;
125
126	u_char	verbose;
127	u_char	settle_delay;
128	u_char	use_nvram;
129	u_long	excludes[8];
130};
131
132#define SYM_SETUP_MAX_TAG		sym_driver_setup.max_tag
133#define SYM_SETUP_BURST_ORDER		sym_driver_setup.burst_order
134#define SYM_SETUP_SCSI_LED		sym_driver_setup.scsi_led
135#define SYM_SETUP_SCSI_DIFF		sym_driver_setup.scsi_diff
136#define SYM_SETUP_IRQ_MODE		sym_driver_setup.irq_mode
137#define SYM_SETUP_SCSI_BUS_CHECK	sym_driver_setup.scsi_bus_check
138#define SYM_SETUP_HOST_ID		sym_driver_setup.host_id
139#define boot_verbose			sym_driver_setup.verbose
140
141/*
142 *  Initial setup.
143 *
144 *  Can be overriden at startup by a command line.
145 */
146#define SYM_LINUX_DRIVER_SETUP	{				\
147	.max_tag	= CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS,	\
148	.burst_order	= 7,					\
149	.scsi_led	= 1,					\
150	.scsi_diff	= 1,					\
151	.irq_mode	= 0,					\
152	.scsi_bus_check	= 1,					\
153	.host_id	= 7,					\
154	.verbose	= 0,					\
155	.settle_delay	= 3,					\
156	.use_nvram	= 1,					\
157}
158
159extern struct sym_driver_setup sym_driver_setup;
160extern unsigned int sym_debug_flags;
161#define DEBUG_FLAGS	sym_debug_flags
162
163/*
164 *  Max number of targets.
165 *  Maximum is 16 and you are advised not to change this value.
166 */
167#ifndef SYM_CONF_MAX_TARGET
168#define SYM_CONF_MAX_TARGET	(16)
169#endif
170
171/*
172 *  Max number of logical units.
173 *  SPI-2 allows up to 64 logical units, but in real life, target
174 *  that implements more that 7 logical units are pretty rare.
175 *  Anyway, the cost of accepting up to 64 logical unit is low in 
176 *  this driver, thus going with the maximum is acceptable.
177 */
178#ifndef SYM_CONF_MAX_LUN
179#define SYM_CONF_MAX_LUN	(64)
180#endif
181
182/*
183 *  Max number of IO control blocks queued to the controller.
184 *  Each entry needs 8 bytes and the queues are allocated contiguously.
185 *  Since we donnot want to allocate more than a page, the theorical 
186 *  maximum is PAGE_SIZE/8. For safety, we announce a bit less to the 
187 *  access method. :)
188 *  When not supplied, as it is suggested, the driver compute some 
189 *  good value for this parameter.
190 */
191/* #define SYM_CONF_MAX_START	(PAGE_SIZE/8 - 16) */
192
193/*
194 *  Support for Immediate Arbitration.
195 *  Not advised.
196 */
197/* #define SYM_CONF_IARB_SUPPORT */
198
199/*
200 *  Only relevant if IARB support configured.
201 *  - Max number of successive settings of IARB hints.
202 *  - Set IARB on arbitration lost.
203 */
204#define SYM_CONF_IARB_MAX 3
205#define SYM_CONF_SET_IARB_ON_ARB_LOST 1
206
207/*
208 *  Returning wrong residuals may make problems.
209 *  When zero, this define tells the driver to 
210 *  always return 0 as transfer residual.
211 *  Btw, all my testings of residuals have succeeded.
212 */
213#define SYM_SETUP_RESIDUAL_SUPPORT 1
214
215#endif /* SYM53C8XX_H */
v5.9
  1/* SPDX-License-Identifier: GPL-2.0-or-later */
  2/*
  3 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family 
  4 * of PCI-SCSI IO processors.
  5 *
  6 * Copyright (C) 1999-2001  Gerard Roudier <groudier@free.fr>
  7 *
  8 * This driver is derived from the Linux sym53c8xx driver.
  9 * Copyright (C) 1998-2000  Gerard Roudier
 10 *
 11 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been 
 12 * a port of the FreeBSD ncr driver to Linux-1.2.13.
 13 *
 14 * The original ncr driver has been written for 386bsd and FreeBSD by
 15 *         Wolfgang Stanglmeier        <wolf@cologne.de>
 16 *         Stefan Esser                <se@mi.Uni-Koeln.de>
 17 * Copyright (C) 1994  Wolfgang Stanglmeier
 18 *
 19 * Other major contributions:
 20 *
 21 * NVRAM detection and reading.
 22 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
 23 *
 24 *-----------------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 25 */
 26
 27#ifndef SYM53C8XX_H
 28#define SYM53C8XX_H
 29
 30
 31/*
 32 *  DMA addressing mode.
 33 *
 34 *  0 : 32 bit addressing for all chips.
 35 *  1 : 40 bit addressing when supported by chip.
 36 *  2 : 64 bit addressing when supported by chip,
 37 *      limited to 16 segments of 4 GB -> 64 GB max.
 38 */
 39#define	SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
 40
 41/*
 42 *  NVRAM support.
 43 */
 44#if 1
 45#define SYM_CONF_NVRAM_SUPPORT		(1)
 46#endif
 47
 48/*
 49 *  These options are not tunable from 'make config'
 50 */
 51#if 1
 52#define	SYM_LINUX_PROC_INFO_SUPPORT
 53#define SYM_LINUX_USER_COMMAND_SUPPORT
 54#define SYM_LINUX_USER_INFO_SUPPORT
 55#define SYM_LINUX_DEBUG_CONTROL_SUPPORT
 56#endif
 57
 58/*
 59 *  Also handle old NCR chips if not (0).
 60 */
 61#define SYM_CONF_GENERIC_SUPPORT	(1)
 62
 63/*
 64 *  Allow tags from 2 to 256, default 8
 65 */
 66#ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
 67#define CONFIG_SCSI_SYM53C8XX_MAX_TAGS	(8)
 68#endif
 69
 70#if	CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
 71#define SYM_CONF_MAX_TAG	(2)
 72#elif	CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
 73#define SYM_CONF_MAX_TAG	(256)
 74#else
 75#define	SYM_CONF_MAX_TAG	CONFIG_SCSI_SYM53C8XX_MAX_TAGS
 76#endif
 77
 78#ifndef	CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
 79#define	CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS	SYM_CONF_MAX_TAG
 80#endif
 81
 82/*
 83 *  Anyway, we configure the driver for at least 64 tags per LUN. :)
 84 */
 85#if	SYM_CONF_MAX_TAG <= 64
 86#define SYM_CONF_MAX_TAG_ORDER	(6)
 87#elif	SYM_CONF_MAX_TAG <= 128
 88#define SYM_CONF_MAX_TAG_ORDER	(7)
 89#else
 90#define SYM_CONF_MAX_TAG_ORDER	(8)
 91#endif
 92
 93/*
 94 *  Max number of SG entries.
 95 */
 96#define SYM_CONF_MAX_SG		(96)
 97
 98/*
 99 *  Driver setup structure.
100 *
101 *  This structure is initialized from linux config options.
102 *  It can be overridden at boot-up by the boot command line.
103 */
104struct sym_driver_setup {
105	u_short	max_tag;
106	u_char	burst_order;
107	u_char	scsi_led;
108	u_char	scsi_diff;
109	u_char	irq_mode;
110	u_char	scsi_bus_check;
111	u_char	host_id;
112
113	u_char	verbose;
114	u_char	settle_delay;
115	u_char	use_nvram;
116	u_long	excludes[8];
117};
118
119#define SYM_SETUP_MAX_TAG		sym_driver_setup.max_tag
120#define SYM_SETUP_BURST_ORDER		sym_driver_setup.burst_order
121#define SYM_SETUP_SCSI_LED		sym_driver_setup.scsi_led
122#define SYM_SETUP_SCSI_DIFF		sym_driver_setup.scsi_diff
123#define SYM_SETUP_IRQ_MODE		sym_driver_setup.irq_mode
124#define SYM_SETUP_SCSI_BUS_CHECK	sym_driver_setup.scsi_bus_check
125#define SYM_SETUP_HOST_ID		sym_driver_setup.host_id
126#define boot_verbose			sym_driver_setup.verbose
127
128/*
129 *  Initial setup.
130 *
131 *  Can be overriden at startup by a command line.
132 */
133#define SYM_LINUX_DRIVER_SETUP	{				\
134	.max_tag	= CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS,	\
135	.burst_order	= 7,					\
136	.scsi_led	= 1,					\
137	.scsi_diff	= 1,					\
138	.irq_mode	= 0,					\
139	.scsi_bus_check	= 1,					\
140	.host_id	= 7,					\
141	.verbose	= 0,					\
142	.settle_delay	= 3,					\
143	.use_nvram	= 1,					\
144}
145
146extern struct sym_driver_setup sym_driver_setup;
147extern unsigned int sym_debug_flags;
148#define DEBUG_FLAGS	sym_debug_flags
149
150/*
151 *  Max number of targets.
152 *  Maximum is 16 and you are advised not to change this value.
153 */
154#ifndef SYM_CONF_MAX_TARGET
155#define SYM_CONF_MAX_TARGET	(16)
156#endif
157
158/*
159 *  Max number of logical units.
160 *  SPI-2 allows up to 64 logical units, but in real life, target
161 *  that implements more that 7 logical units are pretty rare.
162 *  Anyway, the cost of accepting up to 64 logical unit is low in 
163 *  this driver, thus going with the maximum is acceptable.
164 */
165#ifndef SYM_CONF_MAX_LUN
166#define SYM_CONF_MAX_LUN	(64)
167#endif
168
169/*
170 *  Max number of IO control blocks queued to the controller.
171 *  Each entry needs 8 bytes and the queues are allocated contiguously.
172 *  Since we donnot want to allocate more than a page, the theorical 
173 *  maximum is PAGE_SIZE/8. For safety, we announce a bit less to the 
174 *  access method. :)
175 *  When not supplied, as it is suggested, the driver compute some 
176 *  good value for this parameter.
177 */
178/* #define SYM_CONF_MAX_START	(PAGE_SIZE/8 - 16) */
179
180/*
181 *  Support for Immediate Arbitration.
182 *  Not advised.
183 */
184/* #define SYM_CONF_IARB_SUPPORT */
185
186/*
187 *  Only relevant if IARB support configured.
188 *  - Max number of successive settings of IARB hints.
189 *  - Set IARB on arbitration lost.
190 */
191#define SYM_CONF_IARB_MAX 3
192#define SYM_CONF_SET_IARB_ON_ARB_LOST 1
193
194/*
195 *  Returning wrong residuals may make problems.
196 *  When zero, this define tells the driver to 
197 *  always return 0 as transfer residual.
198 *  Btw, all my testings of residuals have succeeded.
199 */
200#define SYM_SETUP_RESIDUAL_SUPPORT 1
201
202#endif /* SYM53C8XX_H */