gdth.h 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038
  1. #ifndef _GDTH_H
  2. #define _GDTH_H
  3. /*
  4. * Header file for the GDT Disk Array/Storage RAID controllers driver for Linux
  5. *
  6. * gdth.h Copyright (C) 1995-03 ICP vortex, Achim Leubner
  7. * See gdth.c for further informations and
  8. * below for supported controller types
  9. *
  10. * <achim_leubner@adaptec.com>
  11. *
  12. * $Id: gdth.h,v 1.57 2004/03/31 11:52:09 achim Exp $
  13. */
  14. #include <linux/version.h>
  15. #include <linux/types.h>
  16. #ifndef TRUE
  17. #define TRUE 1
  18. #endif
  19. #ifndef FALSE
  20. #define FALSE 0
  21. #endif
  22. /* defines, macros */
  23. /* driver version */
  24. #define GDTH_VERSION_STR "3.04"
  25. #define GDTH_VERSION 3
  26. #define GDTH_SUBVERSION 4
  27. /* protocol version */
  28. #define PROTOCOL_VERSION 1
  29. /* OEM IDs */
  30. #define OEM_ID_ICP 0x941c
  31. #define OEM_ID_INTEL 0x8000
  32. /* controller classes */
  33. #define GDT_ISA 0x01 /* ISA controller */
  34. #define GDT_EISA 0x02 /* EISA controller */
  35. #define GDT_PCI 0x03 /* PCI controller */
  36. #define GDT_PCINEW 0x04 /* new PCI controller */
  37. #define GDT_PCIMPR 0x05 /* PCI MPR controller */
  38. /* GDT_EISA, controller subtypes EISA */
  39. #define GDT3_ID 0x0130941c /* GDT3000/3020 */
  40. #define GDT3A_ID 0x0230941c /* GDT3000A/3020A/3050A */
  41. #define GDT3B_ID 0x0330941c /* GDT3000B/3010A */
  42. /* GDT_ISA */
  43. #define GDT2_ID 0x0120941c /* GDT2000/2020 */
  44. /* vendor ID, device IDs (PCI) */
  45. /* these defines should already exist in <linux/pci.h> */
  46. #ifndef PCI_VENDOR_ID_VORTEX
  47. #define PCI_VENDOR_ID_VORTEX 0x1119 /* PCI controller vendor ID */
  48. #endif
  49. #ifndef PCI_VENDOR_ID_INTEL
  50. #define PCI_VENDOR_ID_INTEL 0x8086
  51. #endif
  52. #ifndef PCI_DEVICE_ID_VORTEX_GDT60x0
  53. /* GDT_PCI */
  54. #define PCI_DEVICE_ID_VORTEX_GDT60x0 0 /* GDT6000/6020/6050 */
  55. #define PCI_DEVICE_ID_VORTEX_GDT6000B 1 /* GDT6000B/6010 */
  56. /* GDT_PCINEW */
  57. #define PCI_DEVICE_ID_VORTEX_GDT6x10 2 /* GDT6110/6510 */
  58. #define PCI_DEVICE_ID_VORTEX_GDT6x20 3 /* GDT6120/6520 */
  59. #define PCI_DEVICE_ID_VORTEX_GDT6530 4 /* GDT6530 */
  60. #define PCI_DEVICE_ID_VORTEX_GDT6550 5 /* GDT6550 */
  61. /* GDT_PCINEW, wide/ultra SCSI controllers */
  62. #define PCI_DEVICE_ID_VORTEX_GDT6x17 6 /* GDT6117/6517 */
  63. #define PCI_DEVICE_ID_VORTEX_GDT6x27 7 /* GDT6127/6527 */
  64. #define PCI_DEVICE_ID_VORTEX_GDT6537 8 /* GDT6537 */
  65. #define PCI_DEVICE_ID_VORTEX_GDT6557 9 /* GDT6557/6557-ECC */
  66. /* GDT_PCINEW, wide SCSI controllers */
  67. #define PCI_DEVICE_ID_VORTEX_GDT6x15 10 /* GDT6115/6515 */
  68. #define PCI_DEVICE_ID_VORTEX_GDT6x25 11 /* GDT6125/6525 */
  69. #define PCI_DEVICE_ID_VORTEX_GDT6535 12 /* GDT6535 */
  70. #define PCI_DEVICE_ID_VORTEX_GDT6555 13 /* GDT6555/6555-ECC */
  71. #endif
  72. #ifndef PCI_DEVICE_ID_VORTEX_GDT6x17RP
  73. /* GDT_MPR, RP series, wide/ultra SCSI */
  74. #define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x100 /* GDT6117RP/GDT6517RP */
  75. #define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x101 /* GDT6127RP/GDT6527RP */
  76. #define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x102 /* GDT6537RP */
  77. #define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x103 /* GDT6557RP */
  78. /* GDT_MPR, RP series, narrow/ultra SCSI */
  79. #define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x104 /* GDT6111RP/GDT6511RP */
  80. #define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x105 /* GDT6121RP/GDT6521RP */
  81. #endif
  82. #ifndef PCI_DEVICE_ID_VORTEX_GDT6x17RD
  83. /* GDT_MPR, RD series, wide/ultra SCSI */
  84. #define PCI_DEVICE_ID_VORTEX_GDT6x17RD 0x110 /* GDT6117RD/GDT6517RD */
  85. #define PCI_DEVICE_ID_VORTEX_GDT6x27RD 0x111 /* GDT6127RD/GDT6527RD */
  86. #define PCI_DEVICE_ID_VORTEX_GDT6537RD 0x112 /* GDT6537RD */
  87. #define PCI_DEVICE_ID_VORTEX_GDT6557RD 0x113 /* GDT6557RD */
  88. /* GDT_MPR, RD series, narrow/ultra SCSI */
  89. #define PCI_DEVICE_ID_VORTEX_GDT6x11RD 0x114 /* GDT6111RD/GDT6511RD */
  90. #define PCI_DEVICE_ID_VORTEX_GDT6x21RD 0x115 /* GDT6121RD/GDT6521RD */
  91. /* GDT_MPR, RD series, wide/ultra2 SCSI */
  92. #define PCI_DEVICE_ID_VORTEX_GDT6x18RD 0x118 /* GDT6118RD/GDT6518RD/
  93. GDT6618RD */
  94. #define PCI_DEVICE_ID_VORTEX_GDT6x28RD 0x119 /* GDT6128RD/GDT6528RD/
  95. GDT6628RD */
  96. #define PCI_DEVICE_ID_VORTEX_GDT6x38RD 0x11A /* GDT6538RD/GDT6638RD */
  97. #define PCI_DEVICE_ID_VORTEX_GDT6x58RD 0x11B /* GDT6558RD/GDT6658RD */
  98. /* GDT_MPR, RN series (64-bit PCI), wide/ultra2 SCSI */
  99. #define PCI_DEVICE_ID_VORTEX_GDT7x18RN 0x168 /* GDT7118RN/GDT7518RN/
  100. GDT7618RN */
  101. #define PCI_DEVICE_ID_VORTEX_GDT7x28RN 0x169 /* GDT7128RN/GDT7528RN/
  102. GDT7628RN */
  103. #define PCI_DEVICE_ID_VORTEX_GDT7x38RN 0x16A /* GDT7538RN/GDT7638RN */
  104. #define PCI_DEVICE_ID_VORTEX_GDT7x58RN 0x16B /* GDT7558RN/GDT7658RN */
  105. #endif
  106. #ifndef PCI_DEVICE_ID_VORTEX_GDT6x19RD
  107. /* GDT_MPR, RD series, Fibre Channel */
  108. #define PCI_DEVICE_ID_VORTEX_GDT6x19RD 0x210 /* GDT6519RD/GDT6619RD */
  109. #define PCI_DEVICE_ID_VORTEX_GDT6x29RD 0x211 /* GDT6529RD/GDT6629RD */
  110. /* GDT_MPR, RN series (64-bit PCI), Fibre Channel */
  111. #define PCI_DEVICE_ID_VORTEX_GDT7x19RN 0x260 /* GDT7519RN/GDT7619RN */
  112. #define PCI_DEVICE_ID_VORTEX_GDT7x29RN 0x261 /* GDT7529RN/GDT7629RN */
  113. #endif
  114. #ifndef PCI_DEVICE_ID_VORTEX_GDTMAXRP
  115. /* GDT_MPR, last device ID */
  116. #define PCI_DEVICE_ID_VORTEX_GDTMAXRP 0x2ff
  117. #endif
  118. #ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX
  119. /* new GDT Rx Controller */
  120. #define PCI_DEVICE_ID_VORTEX_GDTNEWRX 0x300
  121. #endif
  122. #ifndef PCI_DEVICE_ID_VORTEX_GDTNEWRX2
  123. /* new(2) GDT Rx Controller */
  124. #define PCI_DEVICE_ID_VORTEX_GDTNEWRX2 0x301
  125. #endif
  126. #ifndef PCI_DEVICE_ID_INTEL_SRC
  127. /* Intel Storage RAID Controller */
  128. #define PCI_DEVICE_ID_INTEL_SRC 0x600
  129. #endif
  130. #ifndef PCI_DEVICE_ID_INTEL_SRC_XSCALE
  131. /* Intel Storage RAID Controller */
  132. #define PCI_DEVICE_ID_INTEL_SRC_XSCALE 0x601
  133. #endif
  134. /* limits */
  135. #define GDTH_SCRATCH PAGE_SIZE /* 4KB scratch buffer */
  136. #define GDTH_MAXCMDS 120
  137. #define GDTH_MAXC_P_L 16 /* max. cmds per lun */
  138. #define GDTH_MAX_RAW 2 /* max. cmds per raw device */
  139. #define MAXOFFSETS 128
  140. #define MAXHA 16
  141. #define MAXID 127
  142. #define MAXLUN 8
  143. #define MAXBUS 6
  144. #define MAX_EVENTS 100 /* event buffer count */
  145. #define MAX_RES_ARGS 40 /* device reservation,
  146. must be a multiple of 4 */
  147. #define MAXCYLS 1024
  148. #define HEADS 64
  149. #define SECS 32 /* mapping 64*32 */
  150. #define MEDHEADS 127
  151. #define MEDSECS 63 /* mapping 127*63 */
  152. #define BIGHEADS 255
  153. #define BIGSECS 63 /* mapping 255*63 */
  154. /* special command ptr. */
  155. #define UNUSED_CMND ((Scsi_Cmnd *)-1)
  156. #define INTERNAL_CMND ((Scsi_Cmnd *)-2)
  157. #define SCREEN_CMND ((Scsi_Cmnd *)-3)
  158. #define SPECIAL_SCP(p) (p==UNUSED_CMND || p==INTERNAL_CMND || p==SCREEN_CMND)
  159. /* controller services */
  160. #define SCSIRAWSERVICE 3
  161. #define CACHESERVICE 9
  162. #define SCREENSERVICE 11
  163. /* screenservice defines */
  164. #define MSG_INV_HANDLE -1 /* special message handle */
  165. #define MSGLEN 16 /* size of message text */
  166. #define MSG_SIZE 34 /* size of message structure */
  167. #define MSG_REQUEST 0 /* async. event: message */
  168. /* cacheservice defines */
  169. #define SECTOR_SIZE 0x200 /* always 512 bytes per sec. */
  170. /* DPMEM constants */
  171. #define DPMEM_MAGIC 0xC0FFEE11
  172. #define IC_HEADER_BYTES 48
  173. #define IC_QUEUE_BYTES 4
  174. #define DPMEM_COMMAND_OFFSET IC_HEADER_BYTES+IC_QUEUE_BYTES*MAXOFFSETS
  175. /* cluster_type constants */
  176. #define CLUSTER_DRIVE 1
  177. #define CLUSTER_MOUNTED 2
  178. #define CLUSTER_RESERVED 4
  179. #define CLUSTER_RESERVE_STATE (CLUSTER_DRIVE|CLUSTER_MOUNTED|CLUSTER_RESERVED)
  180. /* commands for all services, cache service */
  181. #define GDT_INIT 0 /* service initialization */
  182. #define GDT_READ 1 /* read command */
  183. #define GDT_WRITE 2 /* write command */
  184. #define GDT_INFO 3 /* information about devices */
  185. #define GDT_FLUSH 4 /* flush dirty cache buffers */
  186. #define GDT_IOCTL 5 /* ioctl command */
  187. #define GDT_DEVTYPE 9 /* additional information */
  188. #define GDT_MOUNT 10 /* mount cache device */
  189. #define GDT_UNMOUNT 11 /* unmount cache device */
  190. #define GDT_SET_FEAT 12 /* set feat. (scatter/gather) */
  191. #define GDT_GET_FEAT 13 /* get features */
  192. #define GDT_WRITE_THR 16 /* write through */
  193. #define GDT_READ_THR 17 /* read through */
  194. #define GDT_EXT_INFO 18 /* extended info */
  195. #define GDT_RESET 19 /* controller reset */
  196. #define GDT_RESERVE_DRV 20 /* reserve host drive */
  197. #define GDT_RELEASE_DRV 21 /* release host drive */
  198. #define GDT_CLUST_INFO 22 /* cluster info */
  199. #define GDT_RW_ATTRIBS 23 /* R/W attribs (write thru,..)*/
  200. #define GDT_CLUST_RESET 24 /* releases the cluster drives*/
  201. #define GDT_FREEZE_IO 25 /* freezes all IOs */
  202. #define GDT_UNFREEZE_IO 26 /* unfreezes all IOs */
  203. #define GDT_X_INIT_HOST 29 /* ext. init: 64 bit support */
  204. #define GDT_X_INFO 30 /* ext. info for drives>2TB */
  205. /* raw service commands */
  206. #define GDT_RESERVE 14 /* reserve dev. to raw serv. */
  207. #define GDT_RELEASE 15 /* release device */
  208. #define GDT_RESERVE_ALL 16 /* reserve all devices */
  209. #define GDT_RELEASE_ALL 17 /* release all devices */
  210. #define GDT_RESET_BUS 18 /* reset bus */
  211. #define GDT_SCAN_START 19 /* start device scan */
  212. #define GDT_SCAN_END 20 /* stop device scan */
  213. #define GDT_X_INIT_RAW 21 /* ext. init: 64 bit support */
  214. /* screen service commands */
  215. #define GDT_REALTIME 3 /* realtime clock to screens. */
  216. #define GDT_X_INIT_SCR 4 /* ext. init: 64 bit support */
  217. /* IOCTL command defines */
  218. #define SCSI_DR_INFO 0x00 /* SCSI drive info */
  219. #define SCSI_CHAN_CNT 0x05 /* SCSI channel count */
  220. #define SCSI_DR_LIST 0x06 /* SCSI drive list */
  221. #define SCSI_DEF_CNT 0x15 /* grown/primary defects */
  222. #define DSK_STATISTICS 0x4b /* SCSI disk statistics */
  223. #define IOCHAN_DESC 0x5d /* description of IO channel */
  224. #define IOCHAN_RAW_DESC 0x5e /* description of raw IO chn. */
  225. #define L_CTRL_PATTERN 0x20000000L /* SCSI IOCTL mask */
  226. #define ARRAY_INFO 0x12 /* array drive info */
  227. #define ARRAY_DRV_LIST 0x0f /* array drive list */
  228. #define ARRAY_DRV_LIST2 0x34 /* array drive list (new) */
  229. #define LA_CTRL_PATTERN 0x10000000L /* array IOCTL mask */
  230. #define CACHE_DRV_CNT 0x01 /* cache drive count */
  231. #define CACHE_DRV_LIST 0x02 /* cache drive list */
  232. #define CACHE_INFO 0x04 /* cache info */
  233. #define CACHE_CONFIG 0x05 /* cache configuration */
  234. #define CACHE_DRV_INFO 0x07 /* cache drive info */
  235. #define BOARD_FEATURES 0x15 /* controller features */
  236. #define BOARD_INFO 0x28 /* controller info */
  237. #define SET_PERF_MODES 0x82 /* set mode (coalescing,..) */
  238. #define GET_PERF_MODES 0x83 /* get mode */
  239. #define CACHE_READ_OEM_STRING_RECORD 0x84 /* read OEM string record */
  240. #define HOST_GET 0x10001L /* get host drive list */
  241. #define IO_CHANNEL 0x00020000L /* default IO channel */
  242. #define INVALID_CHANNEL 0x0000ffffL /* invalid channel */
  243. /* service errors */
  244. #define S_OK 1 /* no error */
  245. #define S_GENERR 6 /* general error */
  246. #define S_BSY 7 /* controller busy */
  247. #define S_CACHE_UNKNOWN 12 /* cache serv.: drive unknown */
  248. #define S_RAW_SCSI 12 /* raw serv.: target error */
  249. #define S_RAW_ILL 0xff /* raw serv.: illegal */
  250. #define S_NOFUNC -2 /* unknown function */
  251. #define S_CACHE_RESERV -24 /* cache: reserv. conflict */
  252. /* timeout values */
  253. #define INIT_RETRIES 100000 /* 100000 * 1ms = 100s */
  254. #define INIT_TIMEOUT 100000 /* 100000 * 1ms = 100s */
  255. #define POLL_TIMEOUT 10000 /* 10000 * 1ms = 10s */
  256. /* priorities */
  257. #define DEFAULT_PRI 0x20
  258. #define IOCTL_PRI 0x10
  259. #define HIGH_PRI 0x08
  260. /* data directions */
  261. #define GDTH_DATA_IN 0x01000000L /* data from target */
  262. #define GDTH_DATA_OUT 0x00000000L /* data to target */
  263. /* BMIC registers (EISA controllers) */
  264. #define ID0REG 0x0c80 /* board ID */
  265. #define EINTENABREG 0x0c89 /* interrupt enable */
  266. #define SEMA0REG 0x0c8a /* command semaphore */
  267. #define SEMA1REG 0x0c8b /* status semaphore */
  268. #define LDOORREG 0x0c8d /* local doorbell */
  269. #define EDENABREG 0x0c8e /* EISA system doorbell enab. */
  270. #define EDOORREG 0x0c8f /* EISA system doorbell */
  271. #define MAILBOXREG 0x0c90 /* mailbox reg. (16 bytes) */
  272. #define EISAREG 0x0cc0 /* EISA configuration */
  273. /* DMA memory mappings */
  274. #define GDTH_MAP_NONE 0
  275. #define GDTH_MAP_SINGLE 1
  276. #define GDTH_MAP_SG 2
  277. #define GDTH_MAP_IOCTL 3
  278. /* other defines */
  279. #define LINUX_OS 8 /* used for cache optim. */
  280. #define SCATTER_GATHER 1 /* s/g feature */
  281. #define SECS32 0x1f /* round capacity */
  282. #define BIOS_ID_OFFS 0x10 /* offset contr-ID in ISABIOS */
  283. #define LOCALBOARD 0 /* board node always 0 */
  284. #define ASYNCINDEX 0 /* cmd index async. event */
  285. #define SPEZINDEX 1 /* cmd index unknown service */
  286. #define COALINDEX (GDTH_MAXCMDS + 2)
  287. /* features */
  288. #define SCATTER_GATHER 1 /* s/g feature */
  289. #define GDT_WR_THROUGH 0x100 /* WRITE_THROUGH supported */
  290. #define GDT_64BIT 0x200 /* 64bit / drv>2TB support */
  291. #include "gdth_ioctl.h"
  292. /* screenservice message */
  293. typedef struct {
  294. ulong32 msg_handle; /* message handle */
  295. ulong32 msg_len; /* size of message */
  296. ulong32 msg_alen; /* answer length */
  297. unchar msg_answer; /* answer flag */
  298. unchar msg_ext; /* more messages */
  299. unchar msg_reserved[2];
  300. char msg_text[MSGLEN+2]; /* the message text */
  301. } PACKED gdth_msg_str;
  302. /* IOCTL data structures */
  303. /* Status coalescing buffer for returning multiple requests per interrupt */
  304. typedef struct {
  305. ulong32 status;
  306. ulong32 ext_status;
  307. ulong32 info0;
  308. ulong32 info1;
  309. } PACKED gdth_coal_status;
  310. /* performance mode data structure */
  311. typedef struct {
  312. ulong32 version; /* The version of this IOCTL structure. */
  313. ulong32 st_mode; /* 0=dis., 1=st_buf_addr1 valid, 2=both */
  314. ulong32 st_buff_addr1; /* physical address of status buffer 1 */
  315. ulong32 st_buff_u_addr1; /* reserved for 64 bit addressing */
  316. ulong32 st_buff_indx1; /* reserved command idx. for this buffer */
  317. ulong32 st_buff_addr2; /* physical address of status buffer 1 */
  318. ulong32 st_buff_u_addr2; /* reserved for 64 bit addressing */
  319. ulong32 st_buff_indx2; /* reserved command idx. for this buffer */
  320. ulong32 st_buff_size; /* size of each buffer in bytes */
  321. ulong32 cmd_mode; /* 0 = mode disabled, 1 = cmd_buff_addr1 */
  322. ulong32 cmd_buff_addr1; /* physical address of cmd buffer 1 */
  323. ulong32 cmd_buff_u_addr1; /* reserved for 64 bit addressing */
  324. ulong32 cmd_buff_indx1; /* cmd buf addr1 unique identifier */
  325. ulong32 cmd_buff_addr2; /* physical address of cmd buffer 1 */
  326. ulong32 cmd_buff_u_addr2; /* reserved for 64 bit addressing */
  327. ulong32 cmd_buff_indx2; /* cmd buf addr1 unique identifier */
  328. ulong32 cmd_buff_size; /* size of each cmd bufer in bytes */
  329. ulong32 reserved1;
  330. ulong32 reserved2;
  331. } PACKED gdth_perf_modes;
  332. /* SCSI drive info */
  333. typedef struct {
  334. unchar vendor[8]; /* vendor string */
  335. unchar product[16]; /* product string */
  336. unchar revision[4]; /* revision */
  337. ulong32 sy_rate; /* current rate for sync. tr. */
  338. ulong32 sy_max_rate; /* max. rate for sync. tr. */
  339. ulong32 no_ldrive; /* belongs to this log. drv.*/
  340. ulong32 blkcnt; /* number of blocks */
  341. ushort blksize; /* size of block in bytes */
  342. unchar available; /* flag: access is available */
  343. unchar init; /* medium is initialized */
  344. unchar devtype; /* SCSI devicetype */
  345. unchar rm_medium; /* medium is removable */
  346. unchar wp_medium; /* medium is write protected */
  347. unchar ansi; /* SCSI I/II or III? */
  348. unchar protocol; /* same as ansi */
  349. unchar sync; /* flag: sync. transfer enab. */
  350. unchar disc; /* flag: disconnect enabled */
  351. unchar queueing; /* flag: command queing enab. */
  352. unchar cached; /* flag: caching enabled */
  353. unchar target_id; /* target ID of device */
  354. unchar lun; /* LUN id of device */
  355. unchar orphan; /* flag: drive fragment */
  356. ulong32 last_error; /* sense key or drive state */
  357. ulong32 last_result; /* result of last command */
  358. ulong32 check_errors; /* err. in last surface check */
  359. unchar percent; /* progress for surface check */
  360. unchar last_check; /* IOCTRL operation */
  361. unchar res[2];
  362. ulong32 flags; /* from 1.19/2.19: raw reserv.*/
  363. unchar multi_bus; /* multi bus dev? (fibre ch.) */
  364. unchar mb_status; /* status: available? */
  365. unchar res2[2];
  366. unchar mb_alt_status; /* status on second bus */
  367. unchar mb_alt_bid; /* number of second bus */
  368. unchar mb_alt_tid; /* target id on second bus */
  369. unchar res3;
  370. unchar fc_flag; /* from 1.22/2.22: info valid?*/
  371. unchar res4;
  372. ushort fc_frame_size; /* frame size (bytes) */
  373. char wwn[8]; /* world wide name */
  374. } PACKED gdth_diskinfo_str;
  375. /* get SCSI channel count */
  376. typedef struct {
  377. ulong32 channel_no; /* number of channel */
  378. ulong32 drive_cnt; /* drive count */
  379. unchar siop_id; /* SCSI processor ID */
  380. unchar siop_state; /* SCSI processor state */
  381. } PACKED gdth_getch_str;
  382. /* get SCSI drive numbers */
  383. typedef struct {
  384. ulong32 sc_no; /* SCSI channel */
  385. ulong32 sc_cnt; /* sc_list[] elements */
  386. ulong32 sc_list[MAXID]; /* minor device numbers */
  387. } PACKED gdth_drlist_str;
  388. /* get grown/primary defect count */
  389. typedef struct {
  390. unchar sddc_type; /* 0x08: grown, 0x10: prim. */
  391. unchar sddc_format; /* list entry format */
  392. unchar sddc_len; /* list entry length */
  393. unchar sddc_res;
  394. ulong32 sddc_cnt; /* entry count */
  395. } PACKED gdth_defcnt_str;
  396. /* disk statistics */
  397. typedef struct {
  398. ulong32 bid; /* SCSI channel */
  399. ulong32 first; /* first SCSI disk */
  400. ulong32 entries; /* number of elements */
  401. ulong32 count; /* (R) number of init. el. */
  402. ulong32 mon_time; /* time stamp */
  403. struct {
  404. unchar tid; /* target ID */
  405. unchar lun; /* LUN */
  406. unchar res[2];
  407. ulong32 blk_size; /* block size in bytes */
  408. ulong32 rd_count; /* bytes read */
  409. ulong32 wr_count; /* bytes written */
  410. ulong32 rd_blk_count; /* blocks read */
  411. ulong32 wr_blk_count; /* blocks written */
  412. ulong32 retries; /* retries */
  413. ulong32 reassigns; /* reassigns */
  414. } PACKED list[1];
  415. } PACKED gdth_dskstat_str;
  416. /* IO channel header */
  417. typedef struct {
  418. ulong32 version; /* version (-1UL: newest) */
  419. unchar list_entries; /* list entry count */
  420. unchar first_chan; /* first channel number */
  421. unchar last_chan; /* last channel number */
  422. unchar chan_count; /* (R) channel count */
  423. ulong32 list_offset; /* offset of list[0] */
  424. } PACKED gdth_iochan_header;
  425. /* get IO channel description */
  426. typedef struct {
  427. gdth_iochan_header hdr;
  428. struct {
  429. ulong32 address; /* channel address */
  430. unchar type; /* type (SCSI, FCAL) */
  431. unchar local_no; /* local number */
  432. ushort features; /* channel features */
  433. } PACKED list[MAXBUS];
  434. } PACKED gdth_iochan_str;
  435. /* get raw IO channel description */
  436. typedef struct {
  437. gdth_iochan_header hdr;
  438. struct {
  439. unchar proc_id; /* processor id */
  440. unchar proc_defect; /* defect ? */
  441. unchar reserved[2];
  442. } PACKED list[MAXBUS];
  443. } PACKED gdth_raw_iochan_str;
  444. /* array drive component */
  445. typedef struct {
  446. ulong32 al_controller; /* controller ID */
  447. unchar al_cache_drive; /* cache drive number */
  448. unchar al_status; /* cache drive state */
  449. unchar al_res[2];
  450. } PACKED gdth_arraycomp_str;
  451. /* array drive information */
  452. typedef struct {
  453. unchar ai_type; /* array type (RAID0,4,5) */
  454. unchar ai_cache_drive_cnt; /* active cachedrives */
  455. unchar ai_state; /* array drive state */
  456. unchar ai_master_cd; /* master cachedrive */
  457. ulong32 ai_master_controller; /* ID of master controller */
  458. ulong32 ai_size; /* user capacity [sectors] */
  459. ulong32 ai_striping_size; /* striping size [sectors] */
  460. ulong32 ai_secsize; /* sector size [bytes] */
  461. ulong32 ai_err_info; /* failed cache drive */
  462. unchar ai_name[8]; /* name of the array drive */
  463. unchar ai_controller_cnt; /* number of controllers */
  464. unchar ai_removable; /* flag: removable */
  465. unchar ai_write_protected; /* flag: write protected */
  466. unchar ai_devtype; /* type: always direct access */
  467. gdth_arraycomp_str ai_drives[35]; /* drive components: */
  468. unchar ai_drive_entries; /* number of drive components */
  469. unchar ai_protected; /* protection flag */
  470. unchar ai_verify_state; /* state of a parity verify */
  471. unchar ai_ext_state; /* extended array drive state */
  472. unchar ai_expand_state; /* array expand state (>=2.18)*/
  473. unchar ai_reserved[3];
  474. } PACKED gdth_arrayinf_str;
  475. /* get array drive list */
  476. typedef struct {
  477. ulong32 controller_no; /* controller no. */
  478. unchar cd_handle; /* master cachedrive */
  479. unchar is_arrayd; /* Flag: is array drive? */
  480. unchar is_master; /* Flag: is array master? */
  481. unchar is_parity; /* Flag: is parity drive? */
  482. unchar is_hotfix; /* Flag: is hotfix drive? */
  483. unchar res[3];
  484. } PACKED gdth_alist_str;
  485. typedef struct {
  486. ulong32 entries_avail; /* allocated entries */
  487. ulong32 entries_init; /* returned entries */
  488. ulong32 first_entry; /* first entry number */
  489. ulong32 list_offset; /* offset of following list */
  490. gdth_alist_str list[1]; /* list */
  491. } PACKED gdth_arcdl_str;
  492. /* cache info/config IOCTL */
  493. typedef struct {
  494. ulong32 version; /* firmware version */
  495. ushort state; /* cache state (on/off) */
  496. ushort strategy; /* cache strategy */
  497. ushort write_back; /* write back state (on/off) */
  498. ushort block_size; /* cache block size */
  499. } PACKED gdth_cpar_str;
  500. typedef struct {
  501. ulong32 csize; /* cache size */
  502. ulong32 read_cnt; /* read/write counter */
  503. ulong32 write_cnt;
  504. ulong32 tr_hits; /* hits */
  505. ulong32 sec_hits;
  506. ulong32 sec_miss; /* misses */
  507. } PACKED gdth_cstat_str;
  508. typedef struct {
  509. gdth_cpar_str cpar;
  510. gdth_cstat_str cstat;
  511. } PACKED gdth_cinfo_str;
  512. /* cache drive info */
  513. typedef struct {
  514. unchar cd_name[8]; /* cache drive name */
  515. ulong32 cd_devtype; /* SCSI devicetype */
  516. ulong32 cd_ldcnt; /* number of log. drives */
  517. ulong32 cd_last_error; /* last error */
  518. unchar cd_initialized; /* drive is initialized */
  519. unchar cd_removable; /* media is removable */
  520. unchar cd_write_protected; /* write protected */
  521. unchar cd_flags; /* Pool Hot Fix? */
  522. ulong32 ld_blkcnt; /* number of blocks */
  523. ulong32 ld_blksize; /* blocksize */
  524. ulong32 ld_dcnt; /* number of disks */
  525. ulong32 ld_slave; /* log. drive index */
  526. ulong32 ld_dtype; /* type of logical drive */
  527. ulong32 ld_last_error; /* last error */
  528. unchar ld_name[8]; /* log. drive name */
  529. unchar ld_error; /* error */
  530. } PACKED gdth_cdrinfo_str;
  531. /* OEM string */
  532. typedef struct {
  533. ulong32 ctl_version;
  534. ulong32 file_major_version;
  535. ulong32 file_minor_version;
  536. ulong32 buffer_size;
  537. ulong32 cpy_count;
  538. ulong32 ext_error;
  539. ulong32 oem_id;
  540. ulong32 board_id;
  541. } PACKED gdth_oem_str_params;
  542. typedef struct {
  543. unchar product_0_1_name[16];
  544. unchar product_4_5_name[16];
  545. unchar product_cluster_name[16];
  546. unchar product_reserved[16];
  547. unchar scsi_cluster_target_vendor_id[16];
  548. unchar cluster_raid_fw_name[16];
  549. unchar oem_brand_name[16];
  550. unchar oem_raid_type[16];
  551. unchar bios_type[13];
  552. unchar bios_title[50];
  553. unchar oem_company_name[37];
  554. ulong32 pci_id_1;
  555. ulong32 pci_id_2;
  556. unchar validation_status[80];
  557. unchar reserved_1[4];
  558. unchar scsi_host_drive_inquiry_vendor_id[16];
  559. unchar library_file_template[16];
  560. unchar reserved_2[16];
  561. unchar tool_name_1[32];
  562. unchar tool_name_2[32];
  563. unchar tool_name_3[32];
  564. unchar oem_contact_1[84];
  565. unchar oem_contact_2[84];
  566. unchar oem_contact_3[84];
  567. } PACKED gdth_oem_str;
  568. typedef struct {
  569. gdth_oem_str_params params;
  570. gdth_oem_str text;
  571. } PACKED gdth_oem_str_ioctl;
  572. /* board features */
  573. typedef struct {
  574. unchar chaining; /* Chaining supported */
  575. unchar striping; /* Striping (RAID-0) supp. */
  576. unchar mirroring; /* Mirroring (RAID-1) supp. */
  577. unchar raid; /* RAID-4/5/10 supported */
  578. } PACKED gdth_bfeat_str;
  579. /* board info IOCTL */
  580. typedef struct {
  581. ulong32 ser_no; /* serial no. */
  582. unchar oem_id[2]; /* OEM ID */
  583. ushort ep_flags; /* eprom flags */
  584. ulong32 proc_id; /* processor ID */
  585. ulong32 memsize; /* memory size (bytes) */
  586. unchar mem_banks; /* memory banks */
  587. unchar chan_type; /* channel type */
  588. unchar chan_count; /* channel count */
  589. unchar rdongle_pres; /* dongle present? */
  590. ulong32 epr_fw_ver; /* (eprom) firmware version */
  591. ulong32 upd_fw_ver; /* (update) firmware version */
  592. ulong32 upd_revision; /* update revision */
  593. char type_string[16]; /* controller name */
  594. char raid_string[16]; /* RAID firmware name */
  595. unchar update_pres; /* update present? */
  596. unchar xor_pres; /* XOR engine present? */
  597. unchar prom_type; /* ROM type (eprom/flash) */
  598. unchar prom_count; /* number of ROM devices */
  599. ulong32 dup_pres; /* duplexing module present? */
  600. ulong32 chan_pres; /* number of expansion chn. */
  601. ulong32 mem_pres; /* memory expansion inst. ? */
  602. unchar ft_bus_system; /* fault bus supported? */
  603. unchar subtype_valid; /* board_subtype valid? */
  604. unchar board_subtype; /* subtype/hardware level */
  605. unchar ramparity_pres; /* RAM parity check hardware? */
  606. } PACKED gdth_binfo_str;
  607. /* get host drive info */
  608. typedef struct {
  609. char name[8]; /* host drive name */
  610. ulong32 size; /* size (sectors) */
  611. unchar host_drive; /* host drive number */
  612. unchar log_drive; /* log. drive (master) */
  613. unchar reserved;
  614. unchar rw_attribs; /* r/w attribs */
  615. ulong32 start_sec; /* start sector */
  616. } PACKED gdth_hentry_str;
  617. typedef struct {
  618. ulong32 entries; /* entry count */
  619. ulong32 offset; /* offset of entries */
  620. unchar secs_p_head; /* sectors/head */
  621. unchar heads_p_cyl; /* heads/cylinder */
  622. unchar reserved;
  623. unchar clust_drvtype; /* cluster drive type */
  624. ulong32 location; /* controller number */
  625. gdth_hentry_str entry[MAX_HDRIVES]; /* entries */
  626. } PACKED gdth_hget_str;
  627. /* DPRAM structures */
  628. /* interface area ISA/PCI */
  629. typedef struct {
  630. unchar S_Cmd_Indx; /* special command */
  631. unchar volatile S_Status; /* status special command */
  632. ushort reserved1;
  633. ulong32 S_Info[4]; /* add. info special command */
  634. unchar volatile Sema0; /* command semaphore */
  635. unchar reserved2[3];
  636. unchar Cmd_Index; /* command number */
  637. unchar reserved3[3];
  638. ushort volatile Status; /* command status */
  639. ushort Service; /* service(for async.events) */
  640. ulong32 Info[2]; /* additional info */
  641. struct {
  642. ushort offset; /* command offs. in the DPRAM*/
  643. ushort serv_id; /* service */
  644. } PACKED comm_queue[MAXOFFSETS]; /* command queue */
  645. ulong32 bios_reserved[2];
  646. unchar gdt_dpr_cmd[1]; /* commands */
  647. } PACKED gdt_dpr_if;
  648. /* SRAM structure PCI controllers */
  649. typedef struct {
  650. ulong32 magic; /* controller ID from BIOS */
  651. ushort need_deinit; /* switch betw. BIOS/driver */
  652. unchar switch_support; /* see need_deinit */
  653. unchar padding[9];
  654. unchar os_used[16]; /* OS code per service */
  655. unchar unused[28];
  656. unchar fw_magic; /* contr. ID from firmware */
  657. } PACKED gdt_pci_sram;
  658. /* SRAM structure EISA controllers (but NOT GDT3000/3020) */
  659. typedef struct {
  660. unchar os_used[16]; /* OS code per service */
  661. ushort need_deinit; /* switch betw. BIOS/driver */
  662. unchar switch_support; /* see need_deinit */
  663. unchar padding;
  664. } PACKED gdt_eisa_sram;
  665. /* DPRAM ISA controllers */
  666. typedef struct {
  667. union {
  668. struct {
  669. unchar bios_used[0x3c00-32]; /* 15KB - 32Bytes BIOS */
  670. ulong32 magic; /* controller (EISA) ID */
  671. ushort need_deinit; /* switch betw. BIOS/driver */
  672. unchar switch_support; /* see need_deinit */
  673. unchar padding[9];
  674. unchar os_used[16]; /* OS code per service */
  675. } PACKED dp_sram;
  676. unchar bios_area[0x4000]; /* 16KB reserved for BIOS */
  677. } bu;
  678. union {
  679. gdt_dpr_if ic; /* interface area */
  680. unchar if_area[0x3000]; /* 12KB for interface */
  681. } u;
  682. struct {
  683. unchar memlock; /* write protection DPRAM */
  684. unchar event; /* release event */
  685. unchar irqen; /* board interrupts enable */
  686. unchar irqdel; /* acknowledge board int. */
  687. unchar volatile Sema1; /* status semaphore */
  688. unchar rq; /* IRQ/DRQ configuration */
  689. } PACKED io;
  690. } PACKED gdt2_dpram_str;
  691. /* DPRAM PCI controllers */
  692. typedef struct {
  693. union {
  694. gdt_dpr_if ic; /* interface area */
  695. unchar if_area[0xff0-sizeof(gdt_pci_sram)];
  696. } u;
  697. gdt_pci_sram gdt6sr; /* SRAM structure */
  698. struct {
  699. unchar unused0[1];
  700. unchar volatile Sema1; /* command semaphore */
  701. unchar unused1[3];
  702. unchar irqen; /* board interrupts enable */
  703. unchar unused2[2];
  704. unchar event; /* release event */
  705. unchar unused3[3];
  706. unchar irqdel; /* acknowledge board int. */
  707. unchar unused4[3];
  708. } PACKED io;
  709. } PACKED gdt6_dpram_str;
  710. /* PLX register structure (new PCI controllers) */
  711. typedef struct {
  712. unchar cfg_reg; /* DPRAM cfg.(2:below 1MB,0:anywhere)*/
  713. unchar unused1[0x3f];
  714. unchar volatile sema0_reg; /* command semaphore */
  715. unchar volatile sema1_reg; /* status semaphore */
  716. unchar unused2[2];
  717. ushort volatile status; /* command status */
  718. ushort service; /* service */
  719. ulong32 info[2]; /* additional info */
  720. unchar unused3[0x10];
  721. unchar ldoor_reg; /* PCI to local doorbell */
  722. unchar unused4[3];
  723. unchar volatile edoor_reg; /* local to PCI doorbell */
  724. unchar unused5[3];
  725. unchar control0; /* control0 register(unused) */
  726. unchar control1; /* board interrupts enable */
  727. unchar unused6[0x16];
  728. } PACKED gdt6c_plx_regs;
  729. /* DPRAM new PCI controllers */
  730. typedef struct {
  731. union {
  732. gdt_dpr_if ic; /* interface area */
  733. unchar if_area[0x4000-sizeof(gdt_pci_sram)];
  734. } u;
  735. gdt_pci_sram gdt6sr; /* SRAM structure */
  736. } PACKED gdt6c_dpram_str;
  737. /* i960 register structure (PCI MPR controllers) */
  738. typedef struct {
  739. unchar unused1[16];
  740. unchar volatile sema0_reg; /* command semaphore */
  741. unchar unused2;
  742. unchar volatile sema1_reg; /* status semaphore */
  743. unchar unused3;
  744. ushort volatile status; /* command status */
  745. ushort service; /* service */
  746. ulong32 info[2]; /* additional info */
  747. unchar ldoor_reg; /* PCI to local doorbell */
  748. unchar unused4[11];
  749. unchar volatile edoor_reg; /* local to PCI doorbell */
  750. unchar unused5[7];
  751. unchar edoor_en_reg; /* board interrupts enable */
  752. unchar unused6[27];
  753. ulong32 unused7[939];
  754. ulong32 severity;
  755. char evt_str[256]; /* event string */
  756. } PACKED gdt6m_i960_regs;
  757. /* DPRAM PCI MPR controllers */
  758. typedef struct {
  759. gdt6m_i960_regs i960r; /* 4KB i960 registers */
  760. union {
  761. gdt_dpr_if ic; /* interface area */
  762. unchar if_area[0x3000-sizeof(gdt_pci_sram)];
  763. } u;
  764. gdt_pci_sram gdt6sr; /* SRAM structure */
  765. } PACKED gdt6m_dpram_str;
  766. /* PCI resources */
  767. typedef struct {
  768. struct pci_dev *pdev;
  769. ushort vendor_id; /* vendor (ICP, Intel, ..) */
  770. ushort device_id; /* device ID (0,..,9) */
  771. ushort subdevice_id; /* sub device ID */
  772. unchar bus; /* PCI bus */
  773. unchar device_fn; /* PCI device/function no. */
  774. ulong dpmem; /* DPRAM address */
  775. ulong io; /* IO address */
  776. ulong io_mm; /* IO address mem. mapped */
  777. unchar irq; /* IRQ */
  778. } gdth_pci_str;
  779. /* controller information structure */
  780. typedef struct {
  781. ushort oem_id; /* OEM */
  782. ushort type; /* controller class */
  783. ulong32 stype; /* subtype (PCI: device ID) */
  784. ushort subdevice_id; /* sub device ID (PCI) */
  785. ushort fw_vers; /* firmware version */
  786. ushort cache_feat; /* feat. cache serv. (s/g,..)*/
  787. ushort raw_feat; /* feat. raw service (s/g,..)*/
  788. ushort screen_feat; /* feat. raw service (s/g,..)*/
  789. ushort bmic; /* BMIC address (EISA) */
  790. void __iomem *brd; /* DPRAM address */
  791. ulong32 brd_phys; /* slot number/BIOS address */
  792. gdt6c_plx_regs *plx; /* PLX regs (new PCI contr.) */
  793. gdth_cmd_str *pccb; /* address command structure */
  794. ulong32 ccb_phys; /* phys. address */
  795. #ifdef INT_COAL
  796. gdth_coal_status *coal_stat; /* buffer for coalescing int.*/
  797. ulong64 coal_stat_phys; /* phys. address */
  798. #endif
  799. char *pscratch; /* scratch (DMA) buffer */
  800. ulong64 scratch_phys; /* phys. address */
  801. unchar scratch_busy; /* in use? */
  802. unchar dma64_support; /* 64-bit DMA supported? */
  803. gdth_msg_str *pmsg; /* message buffer */
  804. ulong64 msg_phys; /* phys. address */
  805. unchar scan_mode; /* current scan mode */
  806. unchar irq; /* IRQ */
  807. unchar drq; /* DRQ (ISA controllers) */
  808. ushort status; /* command status */
  809. ushort service; /* service/firmware ver./.. */
  810. ulong32 info;
  811. ulong32 info2; /* additional info */
  812. Scsi_Cmnd *req_first; /* top of request queue */
  813. struct {
  814. unchar present; /* Flag: host drive present? */
  815. unchar is_logdrv; /* Flag: log. drive (master)? */
  816. unchar is_arraydrv; /* Flag: array drive? */
  817. unchar is_master; /* Flag: array drive master? */
  818. unchar is_parity; /* Flag: parity drive? */
  819. unchar is_hotfix; /* Flag: hotfix drive? */
  820. unchar master_no; /* number of master drive */
  821. unchar lock; /* drive locked? (hot plug) */
  822. unchar heads; /* mapping */
  823. unchar secs;
  824. ushort devtype; /* further information */
  825. ulong64 size; /* capacity */
  826. unchar ldr_no; /* log. drive no. */
  827. unchar rw_attribs; /* r/w attributes */
  828. unchar cluster_type; /* cluster properties */
  829. unchar media_changed; /* Flag:MOUNT/UNMOUNT occured */
  830. ulong32 start_sec; /* start sector */
  831. } hdr[MAX_LDRIVES]; /* host drives */
  832. struct {
  833. unchar lock; /* channel locked? (hot plug) */
  834. unchar pdev_cnt; /* physical device count */
  835. unchar local_no; /* local channel number */
  836. unchar io_cnt[MAXID]; /* current IO count */
  837. ulong32 address; /* channel address */
  838. ulong32 id_list[MAXID]; /* IDs of the phys. devices */
  839. } raw[MAXBUS]; /* SCSI channels */
  840. struct {
  841. Scsi_Cmnd *cmnd; /* pending request */
  842. ushort service; /* service */
  843. } cmd_tab[GDTH_MAXCMDS]; /* table of pend. requests */
  844. unchar bus_cnt; /* SCSI bus count */
  845. unchar tid_cnt; /* Target ID count */
  846. unchar bus_id[MAXBUS]; /* IOP IDs */
  847. unchar virt_bus; /* number of virtual bus */
  848. unchar more_proc; /* more /proc info supported */
  849. ushort cmd_cnt; /* command count in DPRAM */
  850. ushort cmd_len; /* length of actual command */
  851. ushort cmd_offs_dpmem; /* actual offset in DPRAM */
  852. ushort ic_all_size; /* sizeof DPRAM interf. area */
  853. gdth_cpar_str cpar; /* controller cache par. */
  854. gdth_bfeat_str bfeat; /* controller features */
  855. gdth_binfo_str binfo; /* controller info */
  856. gdth_evt_data dvr; /* event structure */
  857. spinlock_t smp_lock;
  858. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
  859. struct pci_dev *pdev;
  860. #endif
  861. char oem_name[8];
  862. #ifdef GDTH_DMA_STATISTICS
  863. ulong dma32_cnt, dma64_cnt; /* statistics: DMA buffer */
  864. #endif
  865. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
  866. struct scsi_device *sdev;
  867. #else
  868. struct scsi_device sdev;
  869. #endif
  870. } gdth_ha_str;
  871. /* structure for scsi_register(), SCSI bus != 0 */
  872. typedef struct {
  873. ushort hanum;
  874. ushort busnum;
  875. } gdth_num_str;
  876. /* structure for scsi_register() */
  877. typedef struct {
  878. gdth_num_str numext; /* must be the first element */
  879. gdth_ha_str haext;
  880. gdth_cmd_str cmdext;
  881. } gdth_ext_str;
  882. /* INQUIRY data format */
  883. typedef struct {
  884. unchar type_qual;
  885. unchar modif_rmb;
  886. unchar version;
  887. unchar resp_aenc;
  888. unchar add_length;
  889. unchar reserved1;
  890. unchar reserved2;
  891. unchar misc;
  892. unchar vendor[8];
  893. unchar product[16];
  894. unchar revision[4];
  895. } PACKED gdth_inq_data;
  896. /* READ_CAPACITY data format */
  897. typedef struct {
  898. ulong32 last_block_no;
  899. ulong32 block_length;
  900. } PACKED gdth_rdcap_data;
  901. /* READ_CAPACITY (16) data format */
  902. typedef struct {
  903. ulong64 last_block_no;
  904. ulong32 block_length;
  905. } PACKED gdth_rdcap16_data;
  906. /* REQUEST_SENSE data format */
  907. typedef struct {
  908. unchar errorcode;
  909. unchar segno;
  910. unchar key;
  911. ulong32 info;
  912. unchar add_length;
  913. ulong32 cmd_info;
  914. unchar adsc;
  915. unchar adsq;
  916. unchar fruc;
  917. unchar key_spec[3];
  918. } PACKED gdth_sense_data;
  919. /* MODE_SENSE data format */
  920. typedef struct {
  921. struct {
  922. unchar data_length;
  923. unchar med_type;
  924. unchar dev_par;
  925. unchar bd_length;
  926. } PACKED hd;
  927. struct {
  928. unchar dens_code;
  929. unchar block_count[3];
  930. unchar reserved;
  931. unchar block_length[3];
  932. } PACKED bd;
  933. } PACKED gdth_modep_data;
  934. /* stack frame */
  935. typedef struct {
  936. ulong b[10]; /* 32/64 bit compiler ! */
  937. } PACKED gdth_stackframe;
  938. /* function prototyping */
  939. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  940. int gdth_proc_info(struct Scsi_Host *, char *,char **,off_t,int,int);
  941. #else
  942. int gdth_proc_info(char *,char **,off_t,int,int,int);
  943. #endif
  944. #endif