Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 300819
Collapse All | Expand All

(-)arrayprobe-2.0.old/cciss_events.h (+4 lines)
Lines 27-34 Link Here
27
#define QWORD __u64
27
#define QWORD __u64
28
28
29
/* from cciss_cmd.h */
29
/* from cciss_cmd.h */
30
#ifndef CISS_MAX_LUN
30
#define CISS_MAX_LUN    16
31
#define CISS_MAX_LUN    16
32
#endif
33
#ifndef CISS_MAX_PHYS_LUN
31
#define CISS_MAX_PHYS_LUN       1024
34
#define CISS_MAX_PHYS_LUN       1024
35
#endif
32
36
33
#define CompareEvent(event,par_class,par_subclass,par_detail) \
37
#define CompareEvent(event,par_class,par_subclass,par_detail) \
34
                     ((event.class.class==par_class) && \
38
                     ((event.class.class==par_class) && \
(-)arrayprobe-2.0.old/configure.ac (-32 lines)
Lines 19-56 Link Here
19
dnl Check for compile.h (2.6.x kernels only?
19
dnl Check for compile.h (2.6.x kernels only?
20
AC_CHECK_HEADERS(linux/compiler.h)
20
AC_CHECK_HEADERS(linux/compiler.h)
21
21
22
dnl Check for kernel sources
23
AC_MSG_CHECKING(for kernel sources)
24
found_kernel_dir=""
25
for kernel_dir in /usr/src/linux /usr/src/linux-2.4
26
do
27
  if test -d $kernel_dir/drivers/block ; then
28
    CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
29
    CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
30
    found_kernel_dir="$kernel_dir"
31
  fi
32
done
33
34
if test "$found_kernel_dir" != "" ; then
35
  AC_MSG_RESULT(found $found_kernel_dir )
36
else
37
  AC_MSG_ERROR(Kernel sources not found)
38
fi
39
40
dnl Check Headers
41
AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
42
  AC_MSG_ERROR(You need to have the complete kernel sources.),[[#include <linux/compiler.h>
43
  #include <unistd.h>]])
44
45
dnl Check version of SmartArray driver
46
AC_MSG_CHECKING(SmartArray driver version)
47
AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
48
  AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
49
                                                                       
50
dnl Check for CCISS header file
51
AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
52
  AC_MSG_ERROR(You need to have the CCISS driver in the kernel.),[[#include <linux/compiler.h>]])
53
54
# Checks for typedefs, structures, and compiler characteristics.
22
# Checks for typedefs, structures, and compiler characteristics.
55
AC_C_CONST
23
AC_C_CONST
56
24
(-)arrayprobe-2.0.old/cpqarray.h (+126 lines)
Line 0 Link Here
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
 *    If you want to make changes, improve or add functionality to this
22
 *    driver, you'll probably need the Compaq Array Controller Interface
23
 *    Specificiation (Document number ECG086/1198)
24
 */
25
#ifndef CPQARRAY_H
26
#define CPQARRAY_H
27
28
#ifdef __KERNEL__
29
#include <linux/blkdev.h>
30
#include <linux/slab.h>
31
#include <linux/proc_fs.h>
32
#include <linux/timer.h>
33
#endif
34
35
#include "ida_cmd.h"
36
37
#define IO_OK		0
38
#define IO_ERROR	1
39
#define NWD		16
40
#define NWD_SHIFT	4
41
42
#define IDA_TIMER	(5*HZ)
43
#define IDA_TIMEOUT	(10*HZ)
44
45
#define MISC_NONFATAL_WARN	0x01
46
47
typedef struct {
48
	unsigned blk_size;
49
	unsigned nr_blks;
50
	unsigned cylinders;
51
	unsigned heads;
52
	unsigned sectors;
53
	int usage_count;
54
} drv_info_t;
55
56
#ifdef __KERNEL__
57
58
struct ctlr_info;
59
typedef struct ctlr_info ctlr_info_t;
60
61
struct access_method {
62
	void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
63
	void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
64
	unsigned long (*fifo_full)(ctlr_info_t *h);
65
	unsigned long (*intr_pending)(ctlr_info_t *h);
66
	unsigned long (*command_completed)(ctlr_info_t *h);
67
};
68
69
struct board_type {
70
	__u32	board_id;
71
	char	*product_name;
72
	struct access_method *access;
73
};
74
75
struct ctlr_info {
76
	int	ctlr;
77
	char	devname[8];
78
	__u32	log_drv_map;
79
	__u32	drv_assign_map;
80
	__u32	drv_spare_map;
81
	__u32	mp_failed_drv_map;
82
83
	char	firm_rev[4];
84
	int	ctlr_sig;
85
86
	int	log_drives;
87
	int	phys_drives;
88
89
	struct pci_dev *pci_dev;    /* NULL if EISA */
90
	__u32	board_id;
91
	char	*product_name;	
92
93
	void __iomem *vaddr;
94
	unsigned long paddr;
95
	unsigned long io_mem_addr;
96
	unsigned long io_mem_length;
97
	int	intr;
98
	int	usage_count;
99
	drv_info_t	drv[NWD];
100
	struct proc_dir_entry *proc;
101
102
	struct access_method access;
103
104
	cmdlist_t *reqQ;
105
	cmdlist_t *cmpQ;
106
	cmdlist_t *cmd_pool;
107
	dma_addr_t cmd_pool_dhandle;
108
	unsigned long *cmd_pool_bits;
109
	struct request_queue *queue;
110
	spinlock_t lock;
111
112
	unsigned int Qdepth;
113
	unsigned int maxQsinceinit;
114
115
	unsigned int nr_requests;
116
	unsigned int nr_allocs;
117
	unsigned int nr_frees;
118
	struct timer_list timer;
119
	unsigned int misc_tflags;
120
};
121
122
#define IDA_LOCK(i)	(&hba[i]->lock)
123
124
#endif
125
126
#endif /* CPQARRAY_H */
(-)arrayprobe-2.0.old/ida_cmd.h (+349 lines)
Line 0 Link Here
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
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 {
53
	__u32	size;
54
	__u32	addr;
55
} sg_t;
56
57
#define RCODE_NONFATAL	0x02
58
#define RCODE_FATAL	0x04
59
#define RCODE_INVREQ	0x10
60
typedef struct {
61
	__u16	next;
62
	__u8	cmd;
63
	__u8	rcode;
64
	__u32	blk;
65
	__u16	blk_cnt;
66
	__u8	sg_cnt;
67
	__u8	reserved;
68
} rhdr_t;
69
70
#define SG_MAX			32
71
typedef struct {
72
	rhdr_t	hdr;
73
	sg_t	sg[SG_MAX];
74
	__u32	bp;
75
} rblk_t;
76
77
typedef struct {
78
	__u8	unit;
79
	__u8	prio;
80
	__u16	size;
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 {
88
	chdr_t	hdr;
89
	rblk_t	req;
90
	__u32	size;
91
	int	retry_cnt;
92
	__u32	busaddr;
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 {
102
	__u8	nr_drvs;
103
	__u32	cfg_sig;
104
	__u8	firm_rev[4];
105
	__u8	rom_rev[4];
106
	__u8	hw_rev;
107
	__u32	bb_rev;
108
	__u32	drv_present_map;
109
	__u32	ext_drv_map;
110
	__u32	board_id;
111
	__u8	cfg_error;
112
	__u32	non_disk_bits;
113
	__u8	bad_ram_addr;
114
	__u8	cpu_rev;
115
	__u8	pdpi_rev;
116
	__u8	epic_rev;
117
	__u8	wcxc_rev;
118
	__u8	marketing_rev;
119
	__u8	ctlr_flags;
120
	__u8	host_flags;
121
	__u8	expand_dis;
122
	__u8	scsi_chips;
123
	__u32	max_req_blocks;
124
	__u32	ctlr_clock;
125
	__u8	drvs_per_bus;
126
	__u16	big_drv_present_map[8];
127
	__u16	big_ext_drv_map[8];
128
	__u16	big_non_disk_map[8];
129
	__u16	task_flags;
130
	__u8	icl_bus;
131
	__u8	red_modes;
132
	__u8	cur_red_mode;
133
	__u8	red_ctlr_stat;
134
	__u8	red_fail_reason;
135
	__u8	reserved[403];
136
} id_ctlr_t;
137
138
typedef struct {
139
	__u16	cyl;
140
	__u8	heads;
141
	__u8	xsig;
142
	__u8	psectors;
143
	__u16	wpre;
144
	__u8	maxecc;
145
	__u8	drv_ctrl;
146
	__u16	pcyls;
147
	__u8	pheads;
148
	__u16	landz;
149
	__u8	sect_per_track;
150
	__u8	cksum;
151
} drv_param_t;
152
153
#define ID_LOG_DRV	0x10
154
typedef struct {
155
	__u16	blk_size;
156
	__u32	nr_blks;
157
	drv_param_t drv;
158
	__u8	fault_tol;
159
	__u8	reserved;
160
	__u8	bios_disable;
161
} id_log_drv_t;
162
163
#define ID_LOG_DRV_EXT	0x18
164
typedef struct {
165
	__u32	log_drv_id;
166
	__u8	log_drv_label[64];
167
	__u8	reserved[418];
168
} id_log_drv_ext_t;
169
170
#define SENSE_LOG_DRV_STAT	0x12
171
typedef struct {
172
	__u8	status;
173
	__u32	fail_map;
174
	__u16	read_err[32];
175
	__u16	write_err[32];
176
	__u8	drv_err_data[256];
177
	__u8	drq_timeout[32];
178
	__u32	blks_to_recover;
179
	__u8	drv_recovering;
180
	__u16	remap_cnt[32];
181
	__u32	replace_drv_map;
182
	__u32	act_spare_map;
183
	__u8	spare_stat;
184
	__u8	spare_repl_map[32];
185
	__u32	repl_ok_map;
186
	__u8	media_exch;
187
	__u8	cache_fail;
188
	__u8	expn_fail;
189
	__u8	unit_flags;
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];
196
	__u8	big_drv_rebuild;
197
	__u8	reserved[36];
198
} sense_log_drv_stat_t;
199
200
#define START_RECOVER		0x13
201
202
#define ID_PHYS_DRV		0x15
203
typedef struct {
204
	__u8	scsi_bus;
205
	__u8	scsi_id;
206
	__u16	blk_size;
207
	__u32	nr_blks;
208
	__u32	rsvd_blks;
209
	__u8	drv_model[40];
210
	__u8	drv_sn[40];
211
	__u8	drv_fw[8];
212
	__u8	scsi_iq_bits;
213
	__u8	compaq_drv_stmp;
214
	__u8	last_fail;
215
	__u8	phys_drv_flags;
216
	__u8	phys_drv_flags1;
217
	__u8	scsi_lun;
218
	__u8	phys_drv_flags2;
219
	__u8	reserved;
220
	__u32	spi_speed_rules;
221
	__u8	phys_connector[2];
222
	__u8	phys_box_on_bus;
223
	__u8	phys_bay_in_box;
224
} id_phys_drv_t;
225
226
#define BLINK_DRV_LEDS		0x16
227
typedef struct {
228
	__u32	blink_duration;
229
	__u32	reserved;
230
	__u8	blink[256];
231
	__u8	reserved1[248];
232
} blink_drv_leds_t;
233
234
#define SENSE_BLINK_LEDS	0x17
235
typedef struct {
236
	__u32	blink_duration;
237
	__u32	btime_elap;
238
	__u8	blink[256];
239
	__u8	reserved1[248];
240
} sense_blink_leds_t;
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 {
251
	__u32	cfg_sig;
252
	__u16	compat_port;
253
	__u8	data_dist_mode;
254
	__u8	surf_an_ctrl;
255
	__u16	ctlr_phys_drv;
256
	__u16	log_unit_phys_drv;
257
	__u16	fault_tol_mode;
258
	__u8	phys_drv_param[16];
259
	drv_param_t drv;
260
	__u32	drv_asgn_map;
261
	__u16	dist_factor;
262
	__u32	spare_asgn_map;
263
	__u8	reserved[6];
264
	__u16	os;
265
	__u8	ctlr_order;
266
	__u8	extra_info;
267
	__u32	data_offs;
268
	__u8	parity_backedout_write_drvs;
269
	__u8	parity_dist_mode;
270
	__u8	parity_shift_fact;
271
	__u8	bios_disable_flag;
272
	__u32	blks_on_vol;
273
	__u32	blks_per_drv;
274
	__u8	scratch[16];
275
	__u16	big_drv_map[8];
276
	__u16	big_spare_map[8];
277
	__u8	ss_source_vol;
278
	__u8	mix_drv_cap_range;
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];
285
	__u8	reserved1[248];
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];
295
} reorder_log_drv_t;
296
297
#define LABEL_LOG_DRV		0x57
298
typedef struct {
299
	__u8	log_drv_label[64];
300
} label_log_drv_t;
301
302
#define SS_TO_VOL		0x58
303
	
304
#define SET_SURF_DELAY		0x60
305
typedef struct {
306
	__u16	delay;
307
	__u8	reserved[510];
308
} surf_delay_t;
309
310
#define SET_OVERHEAT_DELAY	0x61
311
typedef struct {
312
	__u16	delay;
313
} overhead_delay_t;
314
 
315
#define SET_MP_DELAY
316
typedef struct {
317
	__u16	delay;
318
	__u8	reserved[510];
319
} mp_delay_t;
320
321
#define PASSTHRU_A	0x91
322
typedef struct {
323
	__u8	target;
324
	__u8	bus;
325
	__u8	lun;
326
	__u32	timeout;
327
	__u32	flags;
328
	__u8	status;
329
	__u8	error;
330
	__u8	cdb_len;
331
	__u8	sense_error;
332
	__u8	sense_key;
333
	__u32	sense_info;
334
	__u8	sense_code;
335
	__u8	sense_qual;
336
	__u32	residual;
337
	__u8	reserved[4];
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 */
(-)arrayprobe-2.0.old/ida_ioctl.h (+87 lines)
Line 0 Link Here
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 IDA_IOCTL_H
23
#define IDA_IOCTL_H
24
25
#include "ida_cmd.h"
26
#include "cpqarray.h"
27
28
#define IDAGETDRVINFO		0x27272828
29
#define IDAPASSTHRU		0x28282929
30
#define IDAGETCTLRSIG		0x29293030
31
#define IDAREVALIDATEVOLS	0x30303131
32
#define IDADRIVERVERSION	0x31313232
33
#define IDAGETPCIINFO		0x32323333
34
35
typedef struct _ida_pci_info_struct
36
{
37
	unsigned char 	bus;
38
	unsigned char 	dev_fn;
39
	__u32 		board_id;
40
} ida_pci_info_struct;
41
/*
42
 * Normally, the ioctl determines the logical unit for this command by
43
 * the major,minor number of the fd passed to ioctl.  If you need to send
44
 * a command to a different/nonexistant unit (such as during config), you
45
 * can override the normal behavior by setting the unit valid bit. (Normally,
46
 * it should be zero) The controller the command is sent to is still
47
 * determined by the major number of the open device.
48
 */
49
50
#define UNITVALID	0x80
51
typedef struct {
52
	__u8	cmd;
53
	__u8	rcode;
54
	__u8	unit;
55
	__u32	blk;
56
	__u16	blk_cnt;
57
58
/* currently, sg_cnt is assumed to be 1: only the 0th element of sg is used */
59
	struct {
60
		void	*addr;
61
		size_t	size;
62
	} sg[SG_MAX];
63
	int	sg_cnt;
64
65
	union ctlr_cmds {
66
		drv_info_t		drv;
67
		unsigned char		buf[1024];
68
69
		id_ctlr_t		id_ctlr;
70
		drv_param_t		drv_param;
71
		id_log_drv_t		id_log_drv;
72
		id_log_drv_ext_t	id_log_drv_ext;
73
		sense_log_drv_stat_t	sense_log_drv_stat;
74
		id_phys_drv_t		id_phys_drv;
75
		blink_drv_leds_t	blink_drv_leds;
76
		sense_blink_leds_t	sense_blink_leds;
77
		config_t		config;
78
		reorder_log_drv_t	reorder_log_drv;
79
		label_log_drv_t		label_log_drv;
80
		surf_delay_t		surf_delay;
81
		overhead_delay_t	overhead_delay;
82
		mp_delay_t		mp_delay;
83
		scsi_param_t		scsi_param;
84
	} c;
85
} ida_ioctl_t;
86
87
#endif /* IDA_IOCTL_H */
(-)arrayprobe-2.0.old/probe.c (-2 / +1 lines)
Lines 33-42 Link Here
33
#include <getopt.h>
33
#include <getopt.h>
34
#include <errno.h>
34
#include <errno.h>
35
35
36
#include <linux/compiler.h>
37
#include <linux/cciss_ioctl.h>
36
#include <linux/cciss_ioctl.h>
38
37
39
#include <ida_ioctl.h>
38
#include "ida_ioctl.h"
40
39
41
#include "cciss_events.h"
40
#include "cciss_events.h"
42
41

Return to bug 300819