1 |
1626 |
jcastillo |
/* $Id: advansys.h,v 1.1 2005-12-20 10:17:45 jcastillo Exp $ */
|
2 |
|
|
|
3 |
|
|
/*
|
4 |
|
|
* advansys.h - Linux Host Driver for AdvanSys SCSI Adapters
|
5 |
|
|
*
|
6 |
|
|
* Copyright (c) 1995-1998 Advanced System Products, Inc.
|
7 |
|
|
* All Rights Reserved.
|
8 |
|
|
*
|
9 |
|
|
* Redistribution and use in source and binary forms, with or without
|
10 |
|
|
* modification, are permitted provided that redistributions of source
|
11 |
|
|
* code retain the above copyright notice and this comment without
|
12 |
|
|
* modification.
|
13 |
|
|
*
|
14 |
|
|
* There is an AdvanSys Linux WWW page at:
|
15 |
|
|
* http://www.advansys.com/linux.html
|
16 |
|
|
*
|
17 |
|
|
* The latest version of the AdvanSys driver is available at:
|
18 |
|
|
* ftp://ftp.advansys.com/pub/linux
|
19 |
|
|
*
|
20 |
|
|
* Please send questions, comments, bug reports to:
|
21 |
|
|
* bobf@advansys.com (Bob Frey)
|
22 |
|
|
*/
|
23 |
|
|
|
24 |
|
|
#ifndef _ADVANSYS_H
|
25 |
|
|
#define _ADVANSYS_H
|
26 |
|
|
|
27 |
|
|
/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */
|
28 |
|
|
#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S))
|
29 |
|
|
|
30 |
|
|
#ifndef LINUX_VERSION_CODE
|
31 |
|
|
#include <linux/version.h>
|
32 |
|
|
#endif /* LINUX_VERSION_CODE */
|
33 |
|
|
|
34 |
|
|
/*
|
35 |
|
|
* Scsi_Host_Template function prototypes.
|
36 |
|
|
*/
|
37 |
|
|
int advansys_detect(Scsi_Host_Template *);
|
38 |
|
|
int advansys_release(struct Scsi_Host *);
|
39 |
|
|
const char *advansys_info(struct Scsi_Host *);
|
40 |
|
|
int advansys_command(Scsi_Cmnd *);
|
41 |
|
|
int advansys_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
|
42 |
|
|
int advansys_abort(Scsi_Cmnd *);
|
43 |
|
|
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,89)
|
44 |
|
|
int advansys_reset(Scsi_Cmnd *);
|
45 |
|
|
#else /* version >= v1.3.89 */
|
46 |
|
|
int advansys_reset(Scsi_Cmnd *, unsigned int);
|
47 |
|
|
#endif /* version >= v1.3.89 */
|
48 |
|
|
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0)
|
49 |
|
|
int advansys_biosparam(Disk *, int, int[]);
|
50 |
|
|
#else /* version >= v1.3.0 */
|
51 |
|
|
int advansys_biosparam(Disk *, kdev_t, int[]);
|
52 |
|
|
extern struct proc_dir_entry proc_scsi_advansys;
|
53 |
|
|
int advansys_proc_info(char *, char **, off_t, int, int, int);
|
54 |
|
|
#endif /* version >= v1.3.0 */
|
55 |
|
|
|
56 |
|
|
/* init/main.c setup function */
|
57 |
|
|
void advansys_setup(char *, int *);
|
58 |
|
|
|
59 |
|
|
/*
|
60 |
|
|
* AdvanSys Host Driver Scsi_Host_Template (struct SHT) from hosts.h.
|
61 |
|
|
*/
|
62 |
|
|
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,0)
|
63 |
|
|
#define ADVANSYS { \
|
64 |
|
|
NULL, /* struct SHT *next */ \
|
65 |
|
|
NULL, /* int *usage_count */ \
|
66 |
|
|
"advansys", /* char *name */ \
|
67 |
|
|
advansys_detect, /* int (*detect)(struct SHT *) */ \
|
68 |
|
|
advansys_release, /* int (*release)(struct Scsi_Host *) */ \
|
69 |
|
|
advansys_info, /* const char *(*info)(struct Scsi_Host *) */ \
|
70 |
|
|
advansys_command, /* int (*command)(Scsi_Cmnd *) */ \
|
71 |
|
|
advansys_queuecommand, \
|
72 |
|
|
/* int (*queuecommand)(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)) */ \
|
73 |
|
|
advansys_abort, /* int (*abort)(Scsi_Cmnd *) */ \
|
74 |
|
|
advansys_reset, /* int (*reset)(Scsi_Cmnd *) */ \
|
75 |
|
|
NULL, /* int (*slave_attach)(int, int) */ \
|
76 |
|
|
advansys_biosparam, /* int (* bios_param)(Disk *, int, int []) */ \
|
77 |
|
|
/* \
|
78 |
|
|
* The following fields are set per adapter in advansys_detect(). \
|
79 |
|
|
*/ \
|
80 |
|
|
0, /* int can_queue */ \
|
81 |
|
|
0, /* int this_id */ \
|
82 |
|
|
0, /* short unsigned int sg_tablesize */ \
|
83 |
|
|
0, /* short cmd_per_lun */ \
|
84 |
|
|
0, /* unsigned char present */ \
|
85 |
|
|
/* \
|
86 |
|
|
* Because the driver may control an ISA adapter 'unchecked_isa_dma' \
|
87 |
|
|
* must be set. The flag will be cleared in advansys_detect for non-ISA \
|
88 |
|
|
* adapters. Refer to the comment in scsi_module.c for more information. \
|
89 |
|
|
*/ \
|
90 |
|
|
1, /* unsigned unchecked_isa_dma:1 */ \
|
91 |
|
|
/* \
|
92 |
|
|
* All adapters controlled by this driver are capable of large \
|
93 |
|
|
* scatter-gather lists. According to the mid-level SCSI documentation \
|
94 |
|
|
* this obviates any performance gain provided by setting \
|
95 |
|
|
* 'use_clustering'. But empirically while CPU utilization is increased \
|
96 |
|
|
* by enabling clustering, I/O throughput increases as well. \
|
97 |
|
|
*/ \
|
98 |
|
|
ENABLE_CLUSTERING, /* unsigned use_clustering:1 */ \
|
99 |
|
|
}
|
100 |
|
|
#elif LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,75)
|
101 |
|
|
#define ADVANSYS { \
|
102 |
|
|
NULL, /* struct SHT *next */ \
|
103 |
|
|
NULL, \
|
104 |
|
|
/* version < v2.1.23 long *usage_count */ \
|
105 |
|
|
/* version >= v2.1.23 struct module * */ \
|
106 |
|
|
&proc_scsi_advansys, /* struct proc_dir_entry *proc_dir */ \
|
107 |
|
|
advansys_proc_info, \
|
108 |
|
|
/* int (*proc_info)(char *, char **, off_t, int, int, int) */ \
|
109 |
|
|
"advansys", /* const char *name */ \
|
110 |
|
|
advansys_detect, /* int (*detect)(struct SHT *) */ \
|
111 |
|
|
advansys_release, /* int (*release)(struct Scsi_Host *) */ \
|
112 |
|
|
advansys_info, /* const char *(*info)(struct Scsi_Host *) */ \
|
113 |
|
|
advansys_command, /* int (*command)(Scsi_Cmnd *) */ \
|
114 |
|
|
advansys_queuecommand, \
|
115 |
|
|
/* int (*queuecommand)(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)) */ \
|
116 |
|
|
advansys_abort, /* int (*abort)(Scsi_Cmnd *) */ \
|
117 |
|
|
advansys_reset, \
|
118 |
|
|
/* version < v1.3.89 int (*reset)(Scsi_Cmnd *) */ \
|
119 |
|
|
/* version >= v1.3.89 int (*reset)(Scsi_Cmnd *, unsigned int) */ \
|
120 |
|
|
NULL, /* int (*slave_attach)(int, int) */ \
|
121 |
|
|
advansys_biosparam, /* int (* bios_param)(Disk *, kdev_t, int []) */ \
|
122 |
|
|
/* \
|
123 |
|
|
* The following fields are set per adapter in advansys_detect(). \
|
124 |
|
|
*/ \
|
125 |
|
|
0, /* int can_queue */ \
|
126 |
|
|
0, /* int this_id */ \
|
127 |
|
|
0, /* short unsigned int sg_tablesize */ \
|
128 |
|
|
0, /* short cmd_per_lun */ \
|
129 |
|
|
0, /* unsigned char present */ \
|
130 |
|
|
/* \
|
131 |
|
|
* Because the driver may control an ISA adapter 'unchecked_isa_dma' \
|
132 |
|
|
* must be set. The flag will be cleared in advansys_detect for non-ISA \
|
133 |
|
|
* adapters. Refer to the comment in scsi_module.c for more information. \
|
134 |
|
|
*/ \
|
135 |
|
|
1, /* unsigned unchecked_isa_dma:1 */ \
|
136 |
|
|
/* \
|
137 |
|
|
* All adapters controlled by this driver are capable of large \
|
138 |
|
|
* scatter-gather lists. According to the mid-level SCSI documentation \
|
139 |
|
|
* this obviates any performance gain provided by setting \
|
140 |
|
|
* 'use_clustering'. But empirically while CPU utilization is increased \
|
141 |
|
|
* by enabling clustering, I/O throughput increases as well. \
|
142 |
|
|
*/ \
|
143 |
|
|
ENABLE_CLUSTERING, /* unsigned use_clustering:1 */ \
|
144 |
|
|
}
|
145 |
|
|
#else /* version >= v2.1.75 */
|
146 |
|
|
#define ADVANSYS { \
|
147 |
|
|
proc_dir: &proc_scsi_advansys, \
|
148 |
|
|
proc_info: advansys_proc_info, \
|
149 |
|
|
name: "advansys", \
|
150 |
|
|
detect: advansys_detect, \
|
151 |
|
|
release: advansys_release, \
|
152 |
|
|
info: advansys_info, \
|
153 |
|
|
command: advansys_command, \
|
154 |
|
|
queuecommand: advansys_queuecommand, \
|
155 |
|
|
abort: advansys_abort, \
|
156 |
|
|
reset: advansys_reset, \
|
157 |
|
|
bios_param: advansys_biosparam, \
|
158 |
|
|
/* \
|
159 |
|
|
* Because the driver may control an ISA adapter 'unchecked_isa_dma' \
|
160 |
|
|
* must be set. The flag will be cleared in advansys_detect for non-ISA \
|
161 |
|
|
* adapters. Refer to the comment in scsi_module.c for more information. \
|
162 |
|
|
*/ \
|
163 |
|
|
unchecked_isa_dma: 1, \
|
164 |
|
|
/* \
|
165 |
|
|
* All adapters controlled by this driver are capable of large \
|
166 |
|
|
* scatter-gather lists. According to the mid-level SCSI documentation \
|
167 |
|
|
* this obviates any performance gain provided by setting \
|
168 |
|
|
* 'use_clustering'. But empirically while CPU utilization is increased \
|
169 |
|
|
* by enabling clustering, I/O throughput increases as well. \
|
170 |
|
|
*/ \
|
171 |
|
|
use_clustering: ENABLE_CLUSTERING, \
|
172 |
|
|
}
|
173 |
|
|
#endif /* version >= v2.1.75 */
|
174 |
|
|
#endif /* _ADVANSYS_H */
|