Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ida_cmd.h
Go to the documentation of this file.
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 [email protected]
20  *
21  */
22 #ifndef ARRAYCMD_H
23 #define ARRAYCMD_H
24 
25 #include <asm/types.h>
26 #if 0
27 #include <linux/blkdev.h>
28 #endif
29 
30 /* for the Smart Array 42XX cards */
31 #define S42XX_REQUEST_PORT_OFFSET 0x40
32 #define S42XX_REPLY_INTR_MASK_OFFSET 0x34
33 #define S42XX_REPLY_PORT_OFFSET 0x44
34 #define S42XX_INTR_STATUS 0x30
35 
36 #define S42XX_INTR_OFF 0x08
37 #define S42XX_INTR_PENDING 0x08
38 
39 #define COMMAND_FIFO 0x04
40 #define COMMAND_COMPLETE_FIFO 0x08
41 #define INTR_MASK 0x0C
42 #define INTR_STATUS 0x10
43 #define INTR_PENDING 0x14
44 
45 #define FIFO_NOT_EMPTY 0x01
46 #define FIFO_NOT_FULL 0x02
47 
48 #define BIG_PROBLEM 0x40
49 #define LOG_NOT_CONF 2
50 
51 #pragma pack(1)
52 typedef struct {
55 } sg_t;
56 
57 #define RCODE_NONFATAL 0x02
58 #define RCODE_FATAL 0x04
59 #define RCODE_INVREQ 0x10
60 typedef struct {
68 } rhdr_t;
69 
70 #define SG_MAX 32
71 typedef struct {
75 } rblk_t;
76 
77 typedef struct {
81 } chdr_t;
82 
83 #define CMD_RWREQ 0x00
84 #define CMD_IOCTL_PEND 0x01
85 #define CMD_IOCTL_DONE 0x02
86 
87 typedef struct cmdlist {
91  int retry_cnt;
93  int ctlr;
94  struct cmdlist *prev;
95  struct cmdlist *next;
96  struct request *rq;
97  int type;
98 } cmdlist_t;
99 
100 #define ID_CTLR 0x11
101 typedef struct {
104  __u8 firm_rev[4];
105  __u8 rom_rev[4];
126  __u16 big_drv_present_map[8];
127  __u16 big_ext_drv_map[8];
128  __u16 big_non_disk_map[8];
136 } id_ctlr_t;
137 
138 typedef struct {
151 } drv_param_t;
152 
153 #define ID_LOG_DRV 0x10
154 typedef struct {
161 } id_log_drv_t;
162 
163 #define ID_LOG_DRV_EXT 0x18
164 typedef struct {
166  __u8 log_drv_label[64];
169 
170 #define SENSE_LOG_DRV_STAT 0x12
171 typedef struct {
174  __u16 read_err[32];
175  __u16 write_err[32];
176  __u8 drv_err_data[256];
177  __u8 drq_timeout[32];
180  __u16 remap_cnt[32];
184  __u8 spare_repl_map[32];
190  __u16 big_fail_map[8];
191  __u16 big_remap_map[128];
192  __u16 big_repl_map[8];
193  __u16 big_act_spare_map[8];
194  __u8 big_spar_repl_map[128];
195  __u16 big_repl_ok_map[8];
199 
200 #define START_RECOVER 0x13
201 
202 #define ID_PHYS_DRV 0x15
203 typedef struct {
209  __u8 drv_model[40];
210  __u8 drv_sn[40];
211  __u8 drv_fw[8];
221  __u8 phys_connector[2];
224 } id_phys_drv_t;
225 
226 #define BLINK_DRV_LEDS 0x16
227 typedef struct {
230  __u8 blink[256];
233 
234 #define SENSE_BLINK_LEDS 0x17
235 typedef struct {
238  __u8 blink[256];
241 
242 #define IDA_READ 0x20
243 #define IDA_WRITE 0x30
244 #define IDA_WRITE_MEDIA 0x31
245 #define RESET_TO_DIAG 0x40
246 #define DIAG_PASS_THRU 0x41
247 
248 #define SENSE_CONFIG 0x50
249 #define SET_CONFIG 0x51
250 typedef struct {
258  __u8 phys_drv_param[16];
275  __u16 big_drv_map[8];
276  __u16 big_spare_map[8];
279  struct {
280  __u16 big_drv_map[8];
281  __u32 blks_per_drv;
282  __u16 fault_tol_mode;
283  __u16 dist_factor;
284  } MDC_range[4];
286 } config_t;
287 
288 #define BYPASS_VOL_STATE 0x52
289 #define SS_CREATE_VOL 0x53
290 #define CHANGE_CONFIG 0x54
291 #define SENSE_ORIG_CONF 0x55
292 #define REORDER_LOG_DRV 0x56
293 typedef struct {
294  __u8 old_units[32];
296 
297 #define LABEL_LOG_DRV 0x57
298 typedef struct {
299  __u8 log_drv_label[64];
301 
302 #define SS_TO_VOL 0x58
303 
304 #define SET_SURF_DELAY 0x60
305 typedef struct {
308 } surf_delay_t;
309 
310 #define SET_OVERHEAT_DELAY 0x61
311 typedef struct {
314 
315 #define SET_MP_DELAY
316 typedef struct {
319 } mp_delay_t;
320 
321 #define PASSTHRU_A 0x91
322 typedef struct {
338  __u8 cdb[12];
339 } scsi_param_t;
340 
341 #define RESUME_BACKGROUND_ACTIVITY 0x99
342 #define SENSE_CONTROLLER_PERFORMANCE 0xa8
343 #define FLUSH_CACHE 0xc2
344 #define COLLECT_BUFFER 0xd2
345 #define READ_FLASH_ROM 0xf6
346 #define WRITE_FLASH_ROM 0xf7
347 #pragma pack()
348 
349 #endif /* ARRAYCMD_H */