File: /usr/src/linux/drivers/scsi/qlogicisp.h

1     /*
2      * QLogic ISP1020 Intelligent SCSI Processor Driver (PCI)
3      * Written by Erik H. Moe, ehm@cris.com
4      * Copyright 1995, Erik H. Moe
5      *
6      * This program is free software; you can redistribute it and/or modify it
7      * under the terms of the GNU General Public License as published by the
8      * Free Software Foundation; either version 2, or (at your option) any
9      * later version.
10      *
11      * This program is distributed in the hope that it will be useful, but
12      * WITHOUT ANY WARRANTY; without even the implied warranty of
13      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14      * General Public License for more details.
15      */
16     
17     /* Renamed and updated to 1.3.x by Michael Griffith <grif@cs.ucr.edu> */
18     
19     /*
20      * $Date: 1995/09/22 02:32:56 $
21      * $Revision: 0.5 $
22      *
23      * $Log: isp1020.h,v $
24      * Revision 0.5  1995/09/22  02:32:56  root
25      * do auto request sense
26      *
27      * Revision 0.4  1995/08/07  04:48:28  root
28      * supply firmware with driver.
29      * numerous bug fixes/general cleanup of code.
30      *
31      * Revision 0.3  1995/07/16  16:17:16  root
32      * added reset/abort code.
33      *
34      * Revision 0.2  1995/06/29  03:19:43  root
35      * fixed biosparam.
36      * added queue protocol.
37      *
38      * Revision 0.1  1995/06/25  01:56:13  root
39      * Initial release.
40      *
41      */
42     
43     #ifndef _QLOGICISP_H
44     #define _QLOGICISP_H
45     
46     /*
47      * With the qlogic interface, every queue slot can hold a SCSI
48      * command with up to 4 scatter/gather entries.  If we need more
49      * than 4 entries, continuation entries can be used that hold
50      * another 7 entries each.  Unlike for other drivers, this means
51      * that the maximum number of scatter/gather entries we can
52      * support at any given time is a function of the number of queue
53      * slots available.  That is, host->can_queue and host->sg_tablesize
54      * are dynamic and _not_ independent.  This all works fine because
55      * requests are queued serially and the scatter/gather limit is
56      * determined for each queue request anew.
57      */
58     #define QLOGICISP_REQ_QUEUE_LEN	63	/* must be power of two - 1 */
59     #define QLOGICISP_MAX_SG(ql)	(4 + ((ql) > 0) ? 7*((ql) - 1) : 0)
60     
61     int isp1020_detect(Scsi_Host_Template *);
62     int isp1020_release(struct Scsi_Host *);
63     const char * isp1020_info(struct Scsi_Host *);
64     int isp1020_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
65     int isp1020_abort(Scsi_Cmnd *);
66     int isp1020_reset(Scsi_Cmnd *, unsigned int);
67     int isp1020_biosparam(Disk *, kdev_t, int[]);
68     
69     #ifndef NULL
70     #define NULL (0)
71     #endif
72     
73     #define QLOGICISP {							   \
74     	detect:			isp1020_detect,				   \
75     	release:		isp1020_release,			   \
76     	info:			isp1020_info,				   \
77     	queuecommand:		isp1020_queuecommand,			   \
78     	abort:			isp1020_abort,				   \
79     	reset:			isp1020_reset,				   \
80     	bios_param:		isp1020_biosparam,			   \
81     	can_queue:		QLOGICISP_REQ_QUEUE_LEN,		   \
82     	this_id:		-1,					   \
83     	sg_tablesize:		QLOGICISP_MAX_SG(QLOGICISP_REQ_QUEUE_LEN), \
84     	cmd_per_lun:		1,					   \
85     	present:		0,					   \
86     	unchecked_isa_dma:	0,					   \
87     	use_clustering:		DISABLE_CLUSTERING			   \
88     }
89     
90     #endif /* _QLOGICISP_H */
91