sym53c8xx.h 3.99 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3
/******************************************************************************
**  High Performance device driver for the Symbios 53C896 controller.
**
Linus Torvalds's avatar
Linus Torvalds committed
4
**  Copyright (C) 1998-2001  Gerard Roudier <groudier@free.fr>
Linus Torvalds's avatar
Linus Torvalds committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
**
**  This driver also supports all the Symbios 53C8XX controller family, 
**  except 53C810 revisions < 16, 53C825 revisions < 16 and all 
**  revisions of 53C815 controllers.
**
**  This driver is based on the Linux port of the FreeBSD ncr driver.
** 
**  Copyright (C) 1994  Wolfgang Stanglmeier
**  
**-----------------------------------------------------------------------------
**  
**  This program is free software; you can redistribute it and/or modify
**  it under the terms of the GNU General Public License as published by
**  the Free Software Foundation; either version 2 of the License, or
**  (at your option) any later version.
**
**  This program is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**  GNU General Public License for more details.
**
**  You should have received a copy of the GNU General Public License
**  along with this program; if not, write to the Free Software
**  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
**-----------------------------------------------------------------------------
**
**  The Linux port of the FreeBSD ncr driver has been achieved in 
**  november 1995 by:
**
Linus Torvalds's avatar
Linus Torvalds committed
35
**          Gerard Roudier              <groudier@free.fr>
Linus Torvalds's avatar
Linus Torvalds committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
**
**  Being given that this driver originates from the FreeBSD version, and
**  in order to keep synergy on both, any suggested enhancements and corrections
**  received on Linux are automatically a potential candidate for the FreeBSD 
**  version.
**
**  The original driver has been written for 386bsd and FreeBSD by
**          Wolfgang Stanglmeier        <wolf@cologne.de>
**          Stefan Esser                <se@mi.Uni-Koeln.de>
**
**-----------------------------------------------------------------------------
**
**  Major contributions:
**  --------------------
**
**  NVRAM detection and reading.
**    Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
**
*******************************************************************************
*/

#ifndef SYM53C8XX_H
#define SYM53C8XX_H

#include "sym53c8xx_defs.h"

/*
**	Define Scsi_Host_Template parameters
**
**	Used by hosts.c and sym53c8xx.c with module configuration.
*/

Linus Torvalds's avatar
Linus Torvalds committed
68 69
#if (LINUX_VERSION_CODE >= 0x020400) || defined(HOSTS_C) || defined(MODULE)

Linus Torvalds's avatar
Linus Torvalds committed
70 71 72 73 74 75 76
#include <scsi/scsicam.h>

int sym53c8xx_abort(Scsi_Cmnd *);
int sym53c8xx_detect(Scsi_Host_Template *tpnt);
const char *sym53c8xx_info(struct Scsi_Host *host);
int sym53c8xx_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int sym53c8xx_reset(Scsi_Cmnd *, unsigned int);
Doug Ledford's avatar
Doug Ledford committed
77
int sym53c8xx_slave_attach(Scsi_Device *);
Linus Torvalds's avatar
Linus Torvalds committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

#ifdef MODULE
int sym53c8xx_release(struct Scsi_Host *);
#else
#define sym53c8xx_release NULL
#endif


#if	LINUX_VERSION_CODE >= LinuxVersionCode(2,1,75)

#define SYM53C8XX {     name:           "",			\
			detect:         sym53c8xx_detect,	\
			release:        sym53c8xx_release,	\
			info:           sym53c8xx_info, 	\
			queuecommand:   sym53c8xx_queue_command,\
Doug Ledford's avatar
Doug Ledford committed
93
			slave_attach:   sym53c8xx_slave_attach, \
Alan Cox's avatar
Alan Cox committed
94 95
			abort:          sym53c8xx_abort,	\
			reset:          sym53c8xx_reset,	\
Linus Torvalds's avatar
Linus Torvalds committed
96 97 98 99
			can_queue:      SCSI_NCR_CAN_QUEUE,	\
			this_id:        7,			\
			sg_tablesize:   SCSI_NCR_SG_TABLESIZE,	\
			cmd_per_lun:    SCSI_NCR_CMD_PER_LUN,	\
Linus Torvalds's avatar
Linus Torvalds committed
100
			max_sectors:	MAX_HW_SEGMENTS*8,	\
Linus Torvalds's avatar
Linus Torvalds committed
101 102
			use_clustering: DISABLE_CLUSTERING,	\
			highmem_io:	1} 
Linus Torvalds's avatar
Linus Torvalds committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116

#else

#define SYM53C8XX {	NULL, NULL, NULL, NULL,				\
			NULL,			sym53c8xx_detect,	\
			sym53c8xx_release,	sym53c8xx_info,	NULL,	\
			sym53c8xx_queue_command,sym53c8xx_abort,	\
			sym53c8xx_reset, NULL,	scsicam_bios_param,	\
			SCSI_NCR_CAN_QUEUE,	7,			\
			SCSI_NCR_SG_TABLESIZE,	SCSI_NCR_CMD_PER_LUN,	\
			0,	0,	DISABLE_CLUSTERING} 
 
#endif /* LINUX_VERSION_CODE */

Linus Torvalds's avatar
Linus Torvalds committed
117 118
#endif /* defined(HOSTS_C) || defined(MODULE) */ 

Linus Torvalds's avatar
Linus Torvalds committed
119
#endif /* SYM53C8XX_H */