16 #include <linux/types.h>
28 #define GDTH_VERSION_STR "3.05"
29 #define GDTH_VERSION 3
30 #define GDTH_SUBVERSION 5
33 #define PROTOCOL_VERSION 1
36 #define OEM_ID_ICP 0x941c
37 #define OEM_ID_INTEL 0x8000
43 #define GDT_PCINEW 0x04
44 #define GDT_PCIMPR 0x05
46 #define GDT3_ID 0x0130941c
47 #define GDT3A_ID 0x0230941c
48 #define GDT3B_ID 0x0330941c
50 #define GDT2_ID 0x0120941c
52 #ifndef PCI_DEVICE_ID_VORTEX_GDT60x0
54 #define PCI_DEVICE_ID_VORTEX_GDT60x0 0
55 #define PCI_DEVICE_ID_VORTEX_GDT6000B 1
57 #define PCI_DEVICE_ID_VORTEX_GDT6x10 2
58 #define PCI_DEVICE_ID_VORTEX_GDT6x20 3
59 #define PCI_DEVICE_ID_VORTEX_GDT6530 4
60 #define PCI_DEVICE_ID_VORTEX_GDT6550 5
62 #define PCI_DEVICE_ID_VORTEX_GDT6x17 6
63 #define PCI_DEVICE_ID_VORTEX_GDT6x27 7
64 #define PCI_DEVICE_ID_VORTEX_GDT6537 8
65 #define PCI_DEVICE_ID_VORTEX_GDT6557 9
67 #define PCI_DEVICE_ID_VORTEX_GDT6x15 10
68 #define PCI_DEVICE_ID_VORTEX_GDT6x25 11
69 #define PCI_DEVICE_ID_VORTEX_GDT6535 12
70 #define PCI_DEVICE_ID_VORTEX_GDT6555 13
73 #ifndef PCI_DEVICE_ID_VORTEX_GDT6x17RP
75 #define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x100
76 #define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x101
77 #define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x102
78 #define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x103
80 #define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x104
81 #define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x105
83 #ifndef PCI_DEVICE_ID_VORTEX_GDT6x17RD
85 #define PCI_DEVICE_ID_VORTEX_GDT6x17RD 0x110
86 #define PCI_DEVICE_ID_VORTEX_GDT6x27RD 0x111
87 #define PCI_DEVICE_ID_VORTEX_GDT6537RD 0x112
88 #define PCI_DEVICE_ID_VORTEX_GDT6557RD 0x113
90 #define PCI_DEVICE_ID_VORTEX_GDT6x11RD 0x114
91 #define PCI_DEVICE_ID_VORTEX_GDT6x21RD 0x115
93 #define PCI_DEVICE_ID_VORTEX_GDT6x18RD 0x118
95 #define PCI_DEVICE_ID_VORTEX_GDT6x28RD 0x119
97 #define PCI_DEVICE_ID_VORTEX_GDT6x38RD 0x11A
98 #define PCI_DEVICE_ID_VORTEX_GDT6x58RD 0x11B
100 #define PCI_DEVICE_ID_VORTEX_GDT7x18RN 0x168
102 #define PCI_DEVICE_ID_VORTEX_GDT7x28RN 0x169
104 #define PCI_DEVICE_ID_VORTEX_GDT7x38RN 0x16A
105 #define PCI_DEVICE_ID_VORTEX_GDT7x58RN 0x16B
108 #ifndef PCI_DEVICE_ID_VORTEX_GDT6x19RD
110 #define PCI_DEVICE_ID_VORTEX_GDT6x19RD 0x210
111 #define PCI_DEVICE_ID_VORTEX_GDT6x29RD 0x211
113 #define PCI_DEVICE_ID_VORTEX_GDT7x19RN 0x260
114 #define PCI_DEVICE_ID_VORTEX_GDT7x29RN 0x261
117 #ifndef PCI_DEVICE_ID_VORTEX_GDTMAXRP
119 #define PCI_DEVICE_ID_VORTEX_GDTMAXRP 0x2ff
122 #ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX
124 #define PCI_DEVICE_ID_VORTEX_GDTNEWRX 0x300
127 #ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX2
129 #define PCI_DEVICE_ID_VORTEX_GDTNEWRX2 0x301
132 #ifndef PCI_DEVICE_ID_INTEL_SRC
134 #define PCI_DEVICE_ID_INTEL_SRC 0x600
137 #ifndef PCI_DEVICE_ID_INTEL_SRC_XSCALE
139 #define PCI_DEVICE_ID_INTEL_SRC_XSCALE 0x601
143 #define GDTH_SCRATCH PAGE_SIZE
144 #define GDTH_MAXCMDS 120
145 #define GDTH_MAXC_P_L 16
146 #define GDTH_MAX_RAW 2
147 #define MAXOFFSETS 128
152 #define MAX_EVENTS 100
153 #define MAX_RES_ARGS 40
164 #define UNUSED_CMND ((Scsi_Cmnd *)-1)
165 #define INTERNAL_CMND ((Scsi_Cmnd *)-2)
166 #define SCREEN_CMND ((Scsi_Cmnd *)-3)
167 #define SPECIAL_SCP(p) (p==UNUSED_CMND || p==INTERNAL_CMND || p==SCREEN_CMND)
170 #define SCSIRAWSERVICE 3
171 #define CACHESERVICE 9
172 #define SCREENSERVICE 11
175 #define MSG_INV_HANDLE -1
178 #define MSG_REQUEST 0
181 #define SECTOR_SIZE 0x200
184 #define DPMEM_MAGIC 0xC0FFEE11
185 #define IC_HEADER_BYTES 48
186 #define IC_QUEUE_BYTES 4
187 #define DPMEM_COMMAND_OFFSET IC_HEADER_BYTES+IC_QUEUE_BYTES*MAXOFFSETS
190 #define CLUSTER_DRIVE 1
191 #define CLUSTER_MOUNTED 2
192 #define CLUSTER_RESERVED 4
193 #define CLUSTER_RESERVE_STATE (CLUSTER_DRIVE|CLUSTER_MOUNTED|CLUSTER_RESERVED)
202 #define GDT_DEVTYPE 9
204 #define GDT_UNMOUNT 11
205 #define GDT_SET_FEAT 12
206 #define GDT_GET_FEAT 13
207 #define GDT_WRITE_THR 16
208 #define GDT_READ_THR 17
209 #define GDT_EXT_INFO 18
211 #define GDT_RESERVE_DRV 20
212 #define GDT_RELEASE_DRV 21
213 #define GDT_CLUST_INFO 22
214 #define GDT_RW_ATTRIBS 23
215 #define GDT_CLUST_RESET 24
216 #define GDT_FREEZE_IO 25
217 #define GDT_UNFREEZE_IO 26
218 #define GDT_X_INIT_HOST 29
219 #define GDT_X_INFO 30
222 #define GDT_RESERVE 14
223 #define GDT_RELEASE 15
224 #define GDT_RESERVE_ALL 16
225 #define GDT_RELEASE_ALL 17
226 #define GDT_RESET_BUS 18
227 #define GDT_SCAN_START 19
228 #define GDT_SCAN_END 20
229 #define GDT_X_INIT_RAW 21
232 #define GDT_REALTIME 3
233 #define GDT_X_INIT_SCR 4
236 #define SCSI_DR_INFO 0x00
237 #define SCSI_CHAN_CNT 0x05
238 #define SCSI_DR_LIST 0x06
239 #define SCSI_DEF_CNT 0x15
240 #define DSK_STATISTICS 0x4b
241 #define IOCHAN_DESC 0x5d
242 #define IOCHAN_RAW_DESC 0x5e
243 #define L_CTRL_PATTERN 0x20000000L
244 #define ARRAY_INFO 0x12
245 #define ARRAY_DRV_LIST 0x0f
246 #define ARRAY_DRV_LIST2 0x34
247 #define LA_CTRL_PATTERN 0x10000000L
248 #define CACHE_DRV_CNT 0x01
249 #define CACHE_DRV_LIST 0x02
250 #define CACHE_INFO 0x04
251 #define CACHE_CONFIG 0x05
252 #define CACHE_DRV_INFO 0x07
253 #define BOARD_FEATURES 0x15
254 #define BOARD_INFO 0x28
255 #define SET_PERF_MODES 0x82
256 #define GET_PERF_MODES 0x83
257 #define CACHE_READ_OEM_STRING_RECORD 0x84
258 #define HOST_GET 0x10001L
259 #define IO_CHANNEL 0x00020000L
260 #define INVALID_CHANNEL 0x0000ffffL
266 #define S_CACHE_UNKNOWN 12
267 #define S_RAW_SCSI 12
268 #define S_RAW_ILL 0xff
270 #define S_CACHE_RESERV -24
273 #define INIT_RETRIES 100000
274 #define INIT_TIMEOUT 100000
275 #define POLL_TIMEOUT 10000
278 #define DEFAULT_PRI 0x20
279 #define IOCTL_PRI 0x10
280 #define HIGH_PRI 0x08
283 #define GDTH_DATA_IN 0x01000000L
284 #define GDTH_DATA_OUT 0x00000000L
287 #define ID0REG 0x0c80
288 #define EINTENABREG 0x0c89
289 #define SEMA0REG 0x0c8a
290 #define SEMA1REG 0x0c8b
291 #define LDOORREG 0x0c8d
292 #define EDENABREG 0x0c8e
293 #define EDOORREG 0x0c8f
294 #define MAILBOXREG 0x0c90
295 #define EISAREG 0x0cc0
300 #define BIOS_ID_OFFS 0x10
304 #define COALINDEX (GDTH_MAXCMDS + 2)
307 #define SCATTER_GATHER 1
308 #define GDT_WR_THROUGH 0x100
309 #define GDT_64BIT 0x200
351 u32 cmd_buff_u_addr2;
470 gdth_iochan_header
hdr;
489 u8 ai_cache_drive_cnt;
498 u8 ai_controller_cnt;
500 u8 ai_write_protected;
502 gdth_arraycomp_str ai_drives[35];
527 gdth_alist_str
list[1];
561 u8 cd_write_protected;
586 u8 product_0_1_name[16];
587 u8 product_4_5_name[16];
588 u8 product_cluster_name[16];
589 u8 product_reserved[16];
590 u8 scsi_cluster_target_vendor_id[16];
591 u8 cluster_raid_fw_name[16];
592 u8 oem_brand_name[16];
593 u8 oem_raid_type[16];
596 u8 oem_company_name[37];
599 u8 validation_status[80];
601 u8 scsi_host_drive_inquiry_vendor_id[16];
602 u8 library_file_template[16];
607 u8 oem_contact_1[84];
608 u8 oem_contact_2[84];
609 u8 oem_contact_3[84];
613 gdth_oem_str_params
params;
639 char type_string[16];
640 char raid_string[16];
682 u8 volatile S_Status;
696 u32 bios_reserved[2];
731 u8 bios_area[0x4000];
751 u8 if_area[0xff0-
sizeof(gdt_pci_sram)];
771 u8 volatile sema0_reg;
772 u8 volatile sema1_reg;
780 u8 volatile edoor_reg;
791 u8 if_area[0x4000-
sizeof(gdt_pci_sram)];
799 u8 volatile sema0_reg;
801 u8 volatile sema1_reg;
808 u8 volatile edoor_reg;
819 gdt6m_i960_regs i960r;
822 u8 if_area[0x3000-
sizeof(gdt_pci_sram)];
856 gdth_coal_status *coal_stat;
906 int internal_command;
907 gdth_cmd_str *internal_cmd_str;
928 gdth_bfeat_str bfeat;
929 gdth_binfo_str binfo;
934 #ifdef GDTH_DMA_STATISTICS
935 unsigned long dma32_cnt, dma64_cnt;
940 static inline struct gdth_cmndinfo *gdth_cmnd_priv(
struct scsi_cmnd*
cmd)
1004 unsigned long b[10];