gdth.h 46 KB

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