ida_cmd.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /*
  2. * Disk Array driver for Compaq SMART2 Controllers
  3. * Copyright 1998 Compaq Computer Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  13. * NON INFRINGEMENT. See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. *
  19. * Questions/Comments/Bugfixes to iss_storagedev@hp.com
  20. *
  21. */
  22. #ifndef ARRAYCMD_H
  23. #define ARRAYCMD_H
  24. #include <asm/types.h>
  25. #if 0
  26. #include <linux/blkdev.h>
  27. #endif
  28. /* for the Smart Array 42XX cards */
  29. #define S42XX_REQUEST_PORT_OFFSET 0x40
  30. #define S42XX_REPLY_INTR_MASK_OFFSET 0x34
  31. #define S42XX_REPLY_PORT_OFFSET 0x44
  32. #define S42XX_INTR_STATUS 0x30
  33. #define S42XX_INTR_OFF 0x08
  34. #define S42XX_INTR_PENDING 0x08
  35. #define COMMAND_FIFO 0x04
  36. #define COMMAND_COMPLETE_FIFO 0x08
  37. #define INTR_MASK 0x0C
  38. #define INTR_STATUS 0x10
  39. #define INTR_PENDING 0x14
  40. #define FIFO_NOT_EMPTY 0x01
  41. #define FIFO_NOT_FULL 0x02
  42. #define BIG_PROBLEM 0x40
  43. #define LOG_NOT_CONF 2
  44. #pragma pack(1)
  45. typedef struct {
  46. __u32 size;
  47. __u32 addr;
  48. } sg_t;
  49. #define RCODE_NONFATAL 0x02
  50. #define RCODE_FATAL 0x04
  51. #define RCODE_INVREQ 0x10
  52. typedef struct {
  53. __u16 next;
  54. __u8 cmd;
  55. __u8 rcode;
  56. __u32 blk;
  57. __u16 blk_cnt;
  58. __u8 sg_cnt;
  59. __u8 reserved;
  60. } rhdr_t;
  61. #define SG_MAX 32
  62. typedef struct {
  63. rhdr_t hdr;
  64. sg_t sg[SG_MAX];
  65. __u32 bp;
  66. } rblk_t;
  67. typedef struct {
  68. __u8 unit;
  69. __u8 prio;
  70. __u16 size;
  71. } chdr_t;
  72. #define CMD_RWREQ 0x00
  73. #define CMD_IOCTL_PEND 0x01
  74. #define CMD_IOCTL_DONE 0x02
  75. typedef struct cmdlist {
  76. chdr_t hdr;
  77. rblk_t req;
  78. __u32 size;
  79. int retry_cnt;
  80. __u32 busaddr;
  81. int ctlr;
  82. struct cmdlist *prev;
  83. struct cmdlist *next;
  84. struct request *rq;
  85. int type;
  86. } cmdlist_t;
  87. #define ID_CTLR 0x11
  88. typedef struct {
  89. __u8 nr_drvs;
  90. __u32 cfg_sig;
  91. __u8 firm_rev[4];
  92. __u8 rom_rev[4];
  93. __u8 hw_rev;
  94. __u32 bb_rev;
  95. __u32 drv_present_map;
  96. __u32 ext_drv_map;
  97. __u32 board_id;
  98. __u8 cfg_error;
  99. __u32 non_disk_bits;
  100. __u8 bad_ram_addr;
  101. __u8 cpu_rev;
  102. __u8 pdpi_rev;
  103. __u8 epic_rev;
  104. __u8 wcxc_rev;
  105. __u8 marketing_rev;
  106. __u8 ctlr_flags;
  107. __u8 host_flags;
  108. __u8 expand_dis;
  109. __u8 scsi_chips;
  110. __u32 max_req_blocks;
  111. __u32 ctlr_clock;
  112. __u8 drvs_per_bus;
  113. __u16 big_drv_present_map[8];
  114. __u16 big_ext_drv_map[8];
  115. __u16 big_non_disk_map[8];
  116. __u16 task_flags;
  117. __u8 icl_bus;
  118. __u8 red_modes;
  119. __u8 cur_red_mode;
  120. __u8 red_ctlr_stat;
  121. __u8 red_fail_reason;
  122. __u8 reserved[403];
  123. } id_ctlr_t;
  124. typedef struct {
  125. __u16 cyl;
  126. __u8 heads;
  127. __u8 xsig;
  128. __u8 psectors;
  129. __u16 wpre;
  130. __u8 maxecc;
  131. __u8 drv_ctrl;
  132. __u16 pcyls;
  133. __u8 pheads;
  134. __u16 landz;
  135. __u8 sect_per_track;
  136. __u8 cksum;
  137. } drv_param_t;
  138. #define ID_LOG_DRV 0x10
  139. typedef struct {
  140. __u16 blk_size;
  141. __u32 nr_blks;
  142. drv_param_t drv;
  143. __u8 fault_tol;
  144. __u8 reserved;
  145. __u8 bios_disable;
  146. } id_log_drv_t;
  147. #define ID_LOG_DRV_EXT 0x18
  148. typedef struct {
  149. __u32 log_drv_id;
  150. __u8 log_drv_label[64];
  151. __u8 reserved[418];
  152. } id_log_drv_ext_t;
  153. #define SENSE_LOG_DRV_STAT 0x12
  154. typedef struct {
  155. __u8 status;
  156. __u32 fail_map;
  157. __u16 read_err[32];
  158. __u16 write_err[32];
  159. __u8 drv_err_data[256];
  160. __u8 drq_timeout[32];
  161. __u32 blks_to_recover;
  162. __u8 drv_recovering;
  163. __u16 remap_cnt[32];
  164. __u32 replace_drv_map;
  165. __u32 act_spare_map;
  166. __u8 spare_stat;
  167. __u8 spare_repl_map[32];
  168. __u32 repl_ok_map;
  169. __u8 media_exch;
  170. __u8 cache_fail;
  171. __u8 expn_fail;
  172. __u8 unit_flags;
  173. __u16 big_fail_map[8];
  174. __u16 big_remap_map[128];
  175. __u16 big_repl_map[8];
  176. __u16 big_act_spare_map[8];
  177. __u8 big_spar_repl_map[128];
  178. __u16 big_repl_ok_map[8];
  179. __u8 big_drv_rebuild;
  180. __u8 reserved[36];
  181. } sense_log_drv_stat_t;
  182. #define START_RECOVER 0x13
  183. #define ID_PHYS_DRV 0x15
  184. typedef struct {
  185. __u8 scsi_bus;
  186. __u8 scsi_id;
  187. __u16 blk_size;
  188. __u32 nr_blks;
  189. __u32 rsvd_blks;
  190. __u8 drv_model[40];
  191. __u8 drv_sn[40];
  192. __u8 drv_fw[8];
  193. __u8 scsi_iq_bits;
  194. __u8 compaq_drv_stmp;
  195. __u8 last_fail;
  196. __u8 phys_drv_flags;
  197. __u8 phys_drv_flags1;
  198. __u8 scsi_lun;
  199. __u8 phys_drv_flags2;
  200. __u8 reserved;
  201. __u32 spi_speed_rules;
  202. __u8 phys_connector[2];
  203. __u8 phys_box_on_bus;
  204. __u8 phys_bay_in_box;
  205. } id_phys_drv_t;
  206. #define BLINK_DRV_LEDS 0x16
  207. typedef struct {
  208. __u32 blink_duration;
  209. __u32 reserved;
  210. __u8 blink[256];
  211. __u8 reserved1[248];
  212. } blink_drv_leds_t;
  213. #define SENSE_BLINK_LEDS 0x17
  214. typedef struct {
  215. __u32 blink_duration;
  216. __u32 btime_elap;
  217. __u8 blink[256];
  218. __u8 reserved1[248];
  219. } sense_blink_leds_t;
  220. #define IDA_READ 0x20
  221. #define IDA_WRITE 0x30
  222. #define IDA_WRITE_MEDIA 0x31
  223. #define RESET_TO_DIAG 0x40
  224. #define DIAG_PASS_THRU 0x41
  225. #define SENSE_CONFIG 0x50
  226. #define SET_CONFIG 0x51
  227. typedef struct {
  228. __u32 cfg_sig;
  229. __u16 compat_port;
  230. __u8 data_dist_mode;
  231. __u8 surf_an_ctrl;
  232. __u16 ctlr_phys_drv;
  233. __u16 log_unit_phys_drv;
  234. __u16 fault_tol_mode;
  235. __u8 phys_drv_param[16];
  236. drv_param_t drv;
  237. __u32 drv_asgn_map;
  238. __u16 dist_factor;
  239. __u32 spare_asgn_map;
  240. __u8 reserved[6];
  241. __u16 os;
  242. __u8 ctlr_order;
  243. __u8 extra_info;
  244. __u32 data_offs;
  245. __u8 parity_backedout_write_drvs;
  246. __u8 parity_dist_mode;
  247. __u8 parity_shift_fact;
  248. __u8 bios_disable_flag;
  249. __u32 blks_on_vol;
  250. __u32 blks_per_drv;
  251. __u8 scratch[16];
  252. __u16 big_drv_map[8];
  253. __u16 big_spare_map[8];
  254. __u8 ss_source_vol;
  255. __u8 mix_drv_cap_range;
  256. struct {
  257. __u16 big_drv_map[8];
  258. __u32 blks_per_drv;
  259. __u16 fault_tol_mode;
  260. __u16 dist_factor;
  261. } MDC_range[4];
  262. __u8 reserved1[248];
  263. } config_t;
  264. #define BYPASS_VOL_STATE 0x52
  265. #define SS_CREATE_VOL 0x53
  266. #define CHANGE_CONFIG 0x54
  267. #define SENSE_ORIG_CONF 0x55
  268. #define REORDER_LOG_DRV 0x56
  269. typedef struct {
  270. __u8 old_units[32];
  271. } reorder_log_drv_t;
  272. #define LABEL_LOG_DRV 0x57
  273. typedef struct {
  274. __u8 log_drv_label[64];
  275. } label_log_drv_t;
  276. #define SS_TO_VOL 0x58
  277. #define SET_SURF_DELAY 0x60
  278. typedef struct {
  279. __u16 delay;
  280. __u8 reserved[510];
  281. } surf_delay_t;
  282. #define SET_OVERHEAT_DELAY 0x61
  283. typedef struct {
  284. __u16 delay;
  285. } overhead_delay_t;
  286. #define SET_MP_DELAY
  287. typedef struct {
  288. __u16 delay;
  289. __u8 reserved[510];
  290. } mp_delay_t;
  291. #define PASSTHRU_A 0x91
  292. typedef struct {
  293. __u8 target;
  294. __u8 bus;
  295. __u8 lun;
  296. __u32 timeout;
  297. __u32 flags;
  298. __u8 status;
  299. __u8 error;
  300. __u8 cdb_len;
  301. __u8 sense_error;
  302. __u8 sense_key;
  303. __u32 sense_info;
  304. __u8 sense_code;
  305. __u8 sense_qual;
  306. __u32 residual;
  307. __u8 reserved[4];
  308. __u8 cdb[12];
  309. } scsi_param_t;
  310. #define RESUME_BACKGROUND_ACTIVITY 0x99
  311. #define SENSE_CONTROLLER_PERFORMANCE 0xa8
  312. #define FLUSH_CACHE 0xc2
  313. #define COLLECT_BUFFER 0xd2
  314. #define READ_FLASH_ROM 0xf6
  315. #define WRITE_FLASH_ROM 0xf7
  316. #pragma pack()
  317. #endif /* ARRAYCMD_H */