Go to the documentation of this file.
54 #include <asm/uaccess.h>
60 #define IPS_HA(x) ((ips_ha_t *) x->hostdata)
61 #define IPS_COMMAND_ID(ha, scb) (int) (scb - ha->scbs)
62 #define IPS_IS_TROMBONE(ha) (((ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) && \
63 (ha->pcidev->revision >= IPS_REVID_TROMBONE32) && \
64 (ha->pcidev->revision <= IPS_REVID_TROMBONE64)) ? 1 : 0)
65 #define IPS_IS_CLARINET(ha) (((ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) && \
66 (ha->pcidev->revision >= IPS_REVID_CLARINETP1) && \
67 (ha->pcidev->revision <= IPS_REVID_CLARINETP3)) ? 1 : 0)
68 #define IPS_IS_MORPHEUS(ha) (ha->pcidev->device == IPS_DEVICEID_MORPHEUS)
69 #define IPS_IS_MARCO(ha) (ha->pcidev->device == IPS_DEVICEID_MARCO)
70 #define IPS_USE_I2O_DELIVER(ha) ((IPS_IS_MORPHEUS(ha) || \
71 (IPS_IS_TROMBONE(ha) && \
72 (ips_force_i2o))) ? 1 : 0)
73 #define IPS_USE_MEMIO(ha) ((IPS_IS_MORPHEUS(ha) || \
74 ((IPS_IS_TROMBONE(ha) || IPS_IS_CLARINET(ha)) && \
75 (ips_force_memio))) ? 1 : 0)
77 #define IPS_HAS_ENH_SGLIST(ha) (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha))
78 #define IPS_USE_ENH_SGLIST(ha) ((ha)->flags & IPS_HA_ENH_SG)
79 #define IPS_SGLIST_SIZE(ha) (IPS_USE_ENH_SGLIST(ha) ? \
80 sizeof(IPS_ENH_SG_LIST) : sizeof(IPS_STD_SG_LIST))
82 #define IPS_PRINTK(level, pcidev, format, arg...) \
83 dev_printk(level , &((pcidev)->dev) , format , ## arg)
88 touch_nmi_watchdog(); \
92 #define min(x,y) ((x) < (y) ? x : y)
99 #define pci_dma_hi32(a) ((a >> 16) >> 16)
100 #define pci_dma_lo32(a) (a & 0xffffffff)
102 #if (BITS_PER_LONG > 32) || defined(CONFIG_HIGHMEM64G)
103 #define IPS_ENABLE_DMA64 (1)
105 #define IPS_ENABLE_DMA64 (0)
111 #define IPS_REG_HISR 0x08
112 #define IPS_REG_CCSAR 0x10
113 #define IPS_REG_CCCR 0x14
114 #define IPS_REG_SQHR 0x20
115 #define IPS_REG_SQTR 0x24
116 #define IPS_REG_SQER 0x28
117 #define IPS_REG_SQSR 0x2C
118 #define IPS_REG_SCPR 0x05
119 #define IPS_REG_ISPR 0x06
120 #define IPS_REG_CBSP 0x07
121 #define IPS_REG_FLAP 0x18
122 #define IPS_REG_FLDP 0x1C
123 #define IPS_REG_NDAE 0x38
124 #define IPS_REG_I2O_INMSGQ 0x40
125 #define IPS_REG_I2O_OUTMSGQ 0x44
126 #define IPS_REG_I2O_HIR 0x30
127 #define IPS_REG_I960_IDR 0x20
128 #define IPS_REG_I960_MSG0 0x18
129 #define IPS_REG_I960_MSG1 0x1C
130 #define IPS_REG_I960_OIMR 0x34
135 #define IPS_BIT_GHI 0x04
136 #define IPS_BIT_SQO 0x02
137 #define IPS_BIT_SCE 0x01
138 #define IPS_BIT_SEM 0x08
139 #define IPS_BIT_ILE 0x10
140 #define IPS_BIT_START_CMD 0x101A
141 #define IPS_BIT_START_STOP 0x0002
142 #define IPS_BIT_RST 0x80
143 #define IPS_BIT_EBM 0x02
144 #define IPS_BIT_EI 0x80
145 #define IPS_BIT_OP 0x01
146 #define IPS_BIT_I2O_OPQI 0x08
147 #define IPS_BIT_I960_MSG0I 0x01
148 #define IPS_BIT_I960_MSG1I 0x02
153 #define IPS_CMD_GET_LD_INFO 0x19
154 #define IPS_CMD_GET_SUBSYS 0x40
155 #define IPS_CMD_READ_CONF 0x38
156 #define IPS_CMD_RW_NVRAM_PAGE 0xBC
157 #define IPS_CMD_READ 0x02
158 #define IPS_CMD_WRITE 0x03
159 #define IPS_CMD_FFDC 0xD7
160 #define IPS_CMD_ENQUIRY 0x05
161 #define IPS_CMD_FLUSH 0x0A
162 #define IPS_CMD_READ_SG 0x82
163 #define IPS_CMD_WRITE_SG 0x83
164 #define IPS_CMD_DCDB 0x04
165 #define IPS_CMD_DCDB_SG 0x84
166 #define IPS_CMD_EXTENDED_DCDB 0x95
167 #define IPS_CMD_EXTENDED_DCDB_SG 0x96
168 #define IPS_CMD_CONFIG_SYNC 0x58
169 #define IPS_CMD_ERROR_TABLE 0x17
170 #define IPS_CMD_DOWNLOAD 0x20
171 #define IPS_CMD_RW_BIOSFW 0x22
172 #define IPS_CMD_GET_VERSION_INFO 0xC6
173 #define IPS_CMD_RESET_CHANNEL 0x1A
179 #define IPS_POCL 0x30
180 #define IPS_NORM_STATE 0x00
181 #define IPS_MAX_ADAPTER_TYPES 3
182 #define IPS_MAX_ADAPTERS 16
183 #define IPS_MAX_IOCTL 1
184 #define IPS_MAX_IOCTL_QUEUE 8
185 #define IPS_MAX_QUEUE 128
186 #define IPS_BLKSIZE 512
187 #define IPS_MAX_SG 17
189 #define IPS_MAX_CHANNELS 4
190 #define IPS_MAX_TARGETS 15
191 #define IPS_MAX_CHUNKS 16
192 #define IPS_MAX_CMDS 128
193 #define IPS_MAX_XFER 0x10000
194 #define IPS_NVRAM_P5_SIG 0xFFDDBB99
195 #define IPS_MAX_POST_BYTES 0x02
196 #define IPS_MAX_CONFIG_BYTES 0x02
197 #define IPS_GOOD_POST_STATUS 0x80
198 #define IPS_SEM_TIMEOUT 2000
199 #define IPS_IOCTL_COMMAND 0x0D
200 #define IPS_INTR_ON 0
201 #define IPS_INTR_IORL 1
203 #define IPS_ADAPTER_ID 0xF
204 #define IPS_VENDORID_IBM 0x1014
205 #define IPS_VENDORID_ADAPTEC 0x9005
206 #define IPS_DEVICEID_COPPERHEAD 0x002E
207 #define IPS_DEVICEID_MORPHEUS 0x01BD
208 #define IPS_DEVICEID_MARCO 0x0250
209 #define IPS_SUBDEVICEID_4M 0x01BE
210 #define IPS_SUBDEVICEID_4L 0x01BF
211 #define IPS_SUBDEVICEID_4MX 0x0208
212 #define IPS_SUBDEVICEID_4LX 0x020E
213 #define IPS_SUBDEVICEID_5I2 0x0259
214 #define IPS_SUBDEVICEID_5I1 0x0258
215 #define IPS_SUBDEVICEID_6M 0x0279
216 #define IPS_SUBDEVICEID_6I 0x028C
217 #define IPS_SUBDEVICEID_7k 0x028E
218 #define IPS_SUBDEVICEID_7M 0x028F
219 #define IPS_IOCTL_SIZE 8192
220 #define IPS_STATUS_SIZE 4
221 #define IPS_STATUS_Q_SIZE (IPS_MAX_CMDS+1) * IPS_STATUS_SIZE
222 #define IPS_IMAGE_SIZE 500 * 1024
223 #define IPS_MEMMAP_SIZE 128
224 #define IPS_ONE_MSEC 1
225 #define IPS_ONE_SEC 1000
230 #define IPS_COMP_HEADS 128
231 #define IPS_COMP_SECTORS 32
232 #define IPS_NORM_HEADS 254
233 #define IPS_NORM_SECTORS 63
238 #define IPS_BASIC_STATUS_MASK 0xFF
239 #define IPS_GSC_STATUS_MASK 0x0F
240 #define IPS_CMD_SUCCESS 0x00
241 #define IPS_CMD_RECOVERED_ERROR 0x01
242 #define IPS_INVAL_OPCO 0x03
243 #define IPS_INVAL_CMD_BLK 0x04
244 #define IPS_INVAL_PARM_BLK 0x05
245 #define IPS_BUSY 0x08
246 #define IPS_CMD_CMPLT_WERROR 0x0C
247 #define IPS_LD_ERROR 0x0D
248 #define IPS_CMD_TIMEOUT 0x0E
249 #define IPS_PHYS_DRV_ERROR 0x0F
254 #define IPS_ERR_SEL_TO 0xF0
255 #define IPS_ERR_OU_RUN 0xF2
256 #define IPS_ERR_HOST_RESET 0xF7
257 #define IPS_ERR_DEV_RESET 0xF8
258 #define IPS_ERR_RECOVERY 0xFC
259 #define IPS_ERR_CKCOND 0xFF
264 #define IPS_OS_WINDOWS_NT 0x01
265 #define IPS_OS_NETWARE 0x02
266 #define IPS_OS_OPENSERVER 0x03
267 #define IPS_OS_UNIXWARE 0x04
268 #define IPS_OS_SOLARIS 0x05
269 #define IPS_OS_OS2 0x06
270 #define IPS_OS_LINUX 0x07
271 #define IPS_OS_FREEBSD 0x08
276 #define IPS_REVID_SERVERAID 0x02
277 #define IPS_REVID_NAVAJO 0x03
278 #define IPS_REVID_SERVERAID2 0x04
279 #define IPS_REVID_CLARINETP1 0x05
280 #define IPS_REVID_CLARINETP2 0x07
281 #define IPS_REVID_CLARINETP3 0x0D
282 #define IPS_REVID_TROMBONE32 0x0F
283 #define IPS_REVID_TROMBONE64 0x10
288 #define IPS_ADTYPE_SERVERAID 0x01
289 #define IPS_ADTYPE_SERVERAID2 0x02
290 #define IPS_ADTYPE_NAVAJO 0x03
291 #define IPS_ADTYPE_KIOWA 0x04
292 #define IPS_ADTYPE_SERVERAID3 0x05
293 #define IPS_ADTYPE_SERVERAID3L 0x06
294 #define IPS_ADTYPE_SERVERAID4H 0x07
295 #define IPS_ADTYPE_SERVERAID4M 0x08
296 #define IPS_ADTYPE_SERVERAID4L 0x09
297 #define IPS_ADTYPE_SERVERAID4MX 0x0A
298 #define IPS_ADTYPE_SERVERAID4LX 0x0B
299 #define IPS_ADTYPE_SERVERAID5I2 0x0C
300 #define IPS_ADTYPE_SERVERAID5I1 0x0D
301 #define IPS_ADTYPE_SERVERAID6M 0x0E
302 #define IPS_ADTYPE_SERVERAID6I 0x0F
303 #define IPS_ADTYPE_SERVERAID7t 0x10
304 #define IPS_ADTYPE_SERVERAID7k 0x11
305 #define IPS_ADTYPE_SERVERAID7M 0x12
310 #define IPS_SUCCESS 0x01
311 #define IPS_SUCCESS_IMM 0x02
312 #define IPS_FAILURE 0x04
317 #define IPS_LD_OFFLINE 0x02
318 #define IPS_LD_OKAY 0x03
319 #define IPS_LD_FREE 0x00
320 #define IPS_LD_SYS 0x06
321 #define IPS_LD_CRS 0x24
326 #define IPS_NO_DISCONNECT 0x00
327 #define IPS_DISCONNECT_ALLOWED 0x80
328 #define IPS_NO_AUTO_REQSEN 0x40
329 #define IPS_DATA_NONE 0x00
330 #define IPS_DATA_UNK 0x00
331 #define IPS_DATA_IN 0x01
332 #define IPS_DATA_OUT 0x02
333 #define IPS_TRANSFER64K 0x08
334 #define IPS_NOTIMEOUT 0x00
335 #define IPS_TIMEOUT10 0x10
336 #define IPS_TIMEOUT60 0x20
337 #define IPS_TIMEOUT20M 0x30
342 #define IPS_SCSI_INQ_TYPE_DASD 0x00
343 #define IPS_SCSI_INQ_TYPE_PROCESSOR 0x03
344 #define IPS_SCSI_INQ_LU_CONNECTED 0x00
345 #define IPS_SCSI_INQ_RD_REV2 0x02
346 #define IPS_SCSI_INQ_REV2 0x02
347 #define IPS_SCSI_INQ_REV3 0x03
348 #define IPS_SCSI_INQ_Address16 0x01
349 #define IPS_SCSI_INQ_Address32 0x02
350 #define IPS_SCSI_INQ_MedChanger 0x08
351 #define IPS_SCSI_INQ_MultiPort 0x10
352 #define IPS_SCSI_INQ_EncServ 0x40
353 #define IPS_SCSI_INQ_SoftReset 0x01
354 #define IPS_SCSI_INQ_CmdQue 0x02
355 #define IPS_SCSI_INQ_Linked 0x08
356 #define IPS_SCSI_INQ_Sync 0x10
357 #define IPS_SCSI_INQ_WBus16 0x20
358 #define IPS_SCSI_INQ_WBus32 0x40
359 #define IPS_SCSI_INQ_RelAdr 0x80
364 #define IPS_SCSI_REQSEN_VALID 0x80
365 #define IPS_SCSI_REQSEN_CURRENT_ERR 0x70
366 #define IPS_SCSI_REQSEN_NO_SENSE 0x00
371 #define IPS_SCSI_MP3_SoftSector 0x01
372 #define IPS_SCSI_MP3_HardSector 0x02
373 #define IPS_SCSI_MP3_Removeable 0x04
374 #define IPS_SCSI_MP3_AllocateSurface 0x08
380 #define IPS_HA_ENH_SG 0x1
385 #define IPS_SCB_MAP_SG 0x00008
386 #define IPS_SCB_MAP_SINGLE 0X00010
391 #define IPS_COPPUSRCMD (('C'<<8) | 65)
392 #define IPS_COPPIOCCMD (('C'<<8) | 66)
393 #define IPS_NUMCTRLS (('C'<<8) | 68)
394 #define IPS_CTRLINFO (('C'<<8) | 69)
397 #define IPS_FW_IMAGE 0x00
398 #define IPS_BIOS_IMAGE 0x01
399 #define IPS_WRITE_FW 0x01
400 #define IPS_WRITE_BIOS 0x02
401 #define IPS_ERASE_BIOS 0x03
402 #define IPS_BIOS_HEADER 0xC0
405 #define IPS_IS_LEAP_YEAR(y) (((y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0))) ? 1 : 0)
406 #define IPS_NUM_LEAP_YEARS_THROUGH(y) ((y) / 4 - (y) / 100 + (y) / 400)
408 #define IPS_SECS_MIN 60
409 #define IPS_SECS_HOUR 3600
410 #define IPS_SECS_8HOURS 28800
411 #define IPS_SECS_DAY 86400
412 #define IPS_DAYS_NORMAL_YEAR 365
413 #define IPS_DAYS_LEAP_YEAR 366
414 #define IPS_EPOCH_YEAR 1970
419 static int ips_proc_info(
struct Scsi_Host *,
char *,
char **,
off_t,
int,
int);
422 static int ips_slave_configure(
struct scsi_device *SDptr);
790 #define IPS_GET_VERSION_SUPPORT 0x00018000
1169 #define IPS_VER_MAJOR 7
1170 #define IPS_VER_MAJOR_STRING __stringify(IPS_VER_MAJOR)
1171 #define IPS_VER_MINOR 12
1172 #define IPS_VER_MINOR_STRING __stringify(IPS_VER_MINOR)
1173 #define IPS_VER_BUILD 05
1174 #define IPS_VER_BUILD_STRING __stringify(IPS_VER_BUILD)
1175 #define IPS_VER_STRING IPS_VER_MAJOR_STRING "." \
1176 IPS_VER_MINOR_STRING "." IPS_VER_BUILD_STRING
1177 #define IPS_RELEASE_ID 0x00020000
1178 #define IPS_BUILD_IDENT 761
1179 #define IPS_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2002. All Rights Reserved."
1180 #define IPS_ADAPTECCOPYRIGHT_STRING "(c) Copyright Adaptec, Inc. 2002 to 2004. All Rights Reserved."
1181 #define IPS_DELLCOPYRIGHT_STRING "(c) Copyright Dell 2004. All Rights Reserved."
1182 #define IPS_NT_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2002."
1185 #define IPS_VER_SERVERAID1 "2.25.01"
1186 #define IPS_VER_SERVERAID2 "2.88.13"
1187 #define IPS_VER_NAVAJO "2.88.13"
1188 #define IPS_VER_SERVERAID3 "6.10.24"
1189 #define IPS_VER_SERVERAID4H "7.12.02"
1190 #define IPS_VER_SERVERAID4MLx "7.12.02"
1191 #define IPS_VER_SARASOTA "7.12.02"
1192 #define IPS_VER_MARCO "7.12.02"
1193 #define IPS_VER_SEBRING "7.12.02"
1194 #define IPS_VER_KEYWEST "7.12.02"
1197 #define IPS_COMPAT_UNKNOWN ""
1198 #define IPS_COMPAT_CURRENT "KW710"
1199 #define IPS_COMPAT_SERVERAID1 "2.25.01"
1200 #define IPS_COMPAT_SERVERAID2 "2.88.13"
1201 #define IPS_COMPAT_NAVAJO "2.88.13"
1202 #define IPS_COMPAT_KIOWA "2.88.13"
1203 #define IPS_COMPAT_SERVERAID3H "SB610"
1204 #define IPS_COMPAT_SERVERAID3L "SB610"
1205 #define IPS_COMPAT_SERVERAID4H "KW710"
1206 #define IPS_COMPAT_SERVERAID4M "KW710"
1207 #define IPS_COMPAT_SERVERAID4L "KW710"
1208 #define IPS_COMPAT_SERVERAID4Mx "KW710"
1209 #define IPS_COMPAT_SERVERAID4Lx "KW710"
1210 #define IPS_COMPAT_SARASOTA "KW710"
1211 #define IPS_COMPAT_MARCO "KW710"
1212 #define IPS_COMPAT_SEBRING "KW710"
1213 #define IPS_COMPAT_TAMPA "KW710"
1214 #define IPS_COMPAT_KEYWEST "KW710"
1215 #define IPS_COMPAT_BIOS "KW710"
1217 #define IPS_COMPAT_MAX_ADAPTER_TYPE 18
1218 #define IPS_COMPAT_ID_LENGTH 8
1220 #define IPS_DEFINE_COMPAT_TABLE(tablename) \
1221 char tablename[IPS_COMPAT_MAX_ADAPTER_TYPE] [IPS_COMPAT_ID_LENGTH] = { \
1222 IPS_COMPAT_UNKNOWN, \
1223 IPS_COMPAT_SERVERAID1, \
1224 IPS_COMPAT_SERVERAID2, \
1225 IPS_COMPAT_NAVAJO, \
1227 IPS_COMPAT_SERVERAID3H, \
1228 IPS_COMPAT_SERVERAID3L, \
1229 IPS_COMPAT_SERVERAID4H, \
1230 IPS_COMPAT_SERVERAID4M, \
1231 IPS_COMPAT_SERVERAID4L, \
1232 IPS_COMPAT_SERVERAID4Mx, \
1233 IPS_COMPAT_SERVERAID4Lx, \
1234 IPS_COMPAT_SARASOTA, \
1235 IPS_COMPAT_SARASOTA, \
1237 IPS_COMPAT_SEBRING, \
1239 IPS_COMPAT_KEYWEST \