1 --- arrayprobe-2.0/configure.ac.orig 2006-01-03 13:58:31.000000000 +0100
2 +++ arrayprobe-2.0/configure.ac 2007-06-14 19:13:36.361782087 +0200
5 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
7 -dnl Check for compile.h (2.6.x kernels only?
8 -AC_CHECK_HEADERS(linux/compiler.h)
10 dnl Check for kernel sources
11 AC_MSG_CHECKING(for kernel sources)
13 -for kernel_dir in /usr/src/linux /usr/src/linux-2.4
16 if test -d $kernel_dir/drivers/block ; then
17 CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
21 AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
22 - AC_MSG_ERROR(You need to have the complete kernel sources.),[[#include <linux/compiler.h>
23 - #include <unistd.h>]])
24 + AC_MSG_ERROR(You need to have the complete kernel sources.),[[#include <unistd.h>]])
26 dnl Check version of SmartArray driver
27 AC_MSG_CHECKING(SmartArray driver version)
30 dnl Check for CCISS header file
31 AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
32 - AC_MSG_ERROR(You need to have the CCISS driver in the kernel.),[[#include <linux/compiler.h>]])
33 + AC_MSG_ERROR(You need to have the CCISS driver in the kernel.))
35 # Checks for typedefs, structures, and compiler characteristics.
37 diff -Nur cpqarrayd-2.2/drivers.orig/block/cpqarray.h cpqarrayd-2.2/drivers/block/cpqarray.h
38 --- cpqarrayd-2.2/drivers.orig/block/cpqarray.h 1970-01-01 01:00:00.000000000 +0100
39 +++ cpqarrayd-2.2/drivers/block/cpqarray.h 2005-11-17 16:51:31.000000000 +0100
42 + * Disk Array driver for Compaq SMART2 Controllers
43 + * Copyright 1998 Compaq Computer Corporation
45 + * This program is free software; you can redistribute it and/or modify
46 + * it under the terms of the GNU General Public License as published by
47 + * the Free Software Foundation; either version 2 of the License, or
48 + * (at your option) any later version.
50 + * This program is distributed in the hope that it will be useful,
51 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
52 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
53 + * NON INFRINGEMENT. See the GNU General Public License for more details.
55 + * You should have received a copy of the GNU General Public License
56 + * along with this program; if not, write to the Free Software
57 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
59 + * Questions/Comments/Bugfixes to arrays@compaq.com
61 + * If you want to make changes, improve or add functionality to this
62 + * driver, you'll probably need the Compaq Array Controller Interface
63 + * Specificiation (Document number ECG086/1198)
69 +#include <linux/blkdev.h>
70 +#include <linux/locks.h>
71 +#include <linux/slab.h>
72 +#include <linux/proc_fs.h>
73 +#include <linux/timer.h>
82 +#define IDA_MAX_PART 16
84 +#define IDA_TIMER (5*HZ)
85 +#define IDA_TIMEOUT (10*HZ)
87 +#define MISC_NONFATAL_WARN 0x01
101 +typedef struct ctlr_info ctlr_info_t;
103 +struct access_method {
104 + void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
105 + void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
106 + unsigned long (*fifo_full)(ctlr_info_t *h);
107 + unsigned long (*intr_pending)(ctlr_info_t *h);
108 + unsigned long (*command_completed)(ctlr_info_t *h);
113 + char *product_name;
114 + struct access_method *access;
121 + __u32 drv_assign_map;
122 + __u32 drv_spare_map;
123 + __u32 mp_failed_drv_map;
126 + struct pci_dev *pdev;
133 + struct pci_dev *pci_dev; /* NULL if EISA */
135 + char *product_name;
138 + unsigned long paddr;
139 + unsigned long io_mem_addr;
140 + unsigned long io_mem_length;
143 + drv_info_t drv[NWD];
144 + struct proc_dir_entry *proc;
146 + struct access_method access;
150 + cmdlist_t *cmd_pool;
151 + dma_addr_t cmd_pool_dhandle;
152 + __u32 *cmd_pool_bits;
154 + unsigned int Qdepth;
155 + unsigned int maxQsinceinit;
157 + unsigned int nr_requests;
158 + unsigned int nr_allocs;
159 + unsigned int nr_frees;
160 + struct timer_list timer;
161 + unsigned int misc_tflags;
162 + // Disk structures we need to pass back
163 + struct gendisk gendisk;
164 + // Index by Minor Numbers
165 + struct hd_struct hd[256];
167 + int blocksizes[256];
168 + int hardsizes[256];
172 +#endif /* CPQARRAY_H */
173 diff -Nur cpqarrayd-2.2/drivers.orig/block/ida_cmd.h cpqarrayd-2.2/drivers/block/ida_cmd.h
174 --- cpqarrayd-2.2/drivers.orig/block/ida_cmd.h 1970-01-01 01:00:00.000000000 +0100
175 +++ cpqarrayd-2.2/drivers/block/ida_cmd.h 2005-11-17 16:51:31.000000000 +0100
178 + * Disk Array driver for Compaq SMART2 Controllers
179 + * Copyright 1998 Compaq Computer Corporation
181 + * This program is free software; you can redistribute it and/or modify
182 + * it under the terms of the GNU General Public License as published by
183 + * the Free Software Foundation; either version 2 of the License, or
184 + * (at your option) any later version.
186 + * This program is distributed in the hope that it will be useful,
187 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
188 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
189 + * NON INFRINGEMENT. See the GNU General Public License for more details.
191 + * You should have received a copy of the GNU General Public License
192 + * along with this program; if not, write to the Free Software
193 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
195 + * Questions/Comments/Bugfixes to arrays@compaq.com
201 +#include <asm/types.h>
203 +#include <linux/blkdev.h>
206 +/* for the Smart Array 42XX cards */
207 +#define S42XX_REQUEST_PORT_OFFSET 0x40
208 +#define S42XX_REPLY_INTR_MASK_OFFSET 0x34
209 +#define S42XX_REPLY_PORT_OFFSET 0x44
210 +#define S42XX_INTR_STATUS 0x30
212 +#define S42XX_INTR_OFF 0x08
213 +#define S42XX_INTR_PENDING 0x08
215 +#define COMMAND_FIFO 0x04
216 +#define COMMAND_COMPLETE_FIFO 0x08
217 +#define INTR_MASK 0x0C
218 +#define INTR_STATUS 0x10
219 +#define INTR_PENDING 0x14
221 +#define FIFO_NOT_EMPTY 0x01
222 +#define FIFO_NOT_FULL 0x02
224 +#define BIG_PROBLEM 0x40
225 +#define LOG_NOT_CONF 2
233 +#define RCODE_NONFATAL 0x02
234 +#define RCODE_FATAL 0x04
235 +#define RCODE_INVREQ 0x10
259 +#define CMD_RWREQ 0x00
260 +#define CMD_IOCTL_PEND 0x01
262 +typedef struct cmdlist {
269 + struct cmdlist *prev;
270 + struct cmdlist *next;
271 + struct request *rq;
272 + struct completion *waiting;
276 +#define ID_CTLR 0x11
284 + __u32 drv_present_map;
288 + __u32 non_disk_bits;
294 + __u8 marketing_rev;
299 + __u32 max_req_blocks;
302 + __u16 big_drv_present_map[8];
303 + __u16 big_ext_drv_map[8];
304 + __u16 big_non_disk_map[8];
309 + __u8 red_ctlr_stat;
310 + __u8 red_fail_reason;
311 + __u8 reserved[403];
325 + __u8 sect_per_track;
329 +#define ID_LOG_DRV 0x10
339 +#define ID_LOG_DRV_EXT 0x18
342 + __u8 log_drv_label[64];
343 + __u8 reserved[418];
346 +#define SENSE_LOG_DRV_STAT 0x12
350 + __u16 read_err[32];
351 + __u16 write_err[32];
352 + __u8 drv_err_data[256];
353 + __u8 drq_timeout[32];
354 + __u32 blks_to_recover;
355 + __u8 drv_recovering;
356 + __u16 remap_cnt[32];
357 + __u32 replace_drv_map;
358 + __u32 act_spare_map;
360 + __u8 spare_repl_map[32];
366 + __u16 big_fail_map[8];
367 + __u16 big_remap_map[128];
368 + __u16 big_repl_map[8];
369 + __u16 big_act_spare_map[8];
370 + __u8 big_spar_repl_map[128];
371 + __u16 big_repl_ok_map[8];
372 + __u8 big_drv_rebuild;
374 +} sense_log_drv_stat_t;
376 +#define START_RECOVER 0x13
378 +#define ID_PHYS_DRV 0x15
385 + __u8 drv_model[40];
389 + __u8 compaq_drv_stmp;
391 + __u8 phys_drv_flags;
392 + __u8 phys_drv_flags1;
394 + __u8 phys_drv_flags2;
396 + __u32 spi_speed_rules;
397 + __u8 phys_connector[2];
398 + __u8 phys_box_on_bus;
399 + __u8 phys_bay_in_box;
402 +#define BLINK_DRV_LEDS 0x16
404 + __u32 blink_duration;
407 + __u8 reserved1[248];
410 +#define SENSE_BLINK_LEDS 0x17
412 + __u32 blink_duration;
415 + __u8 reserved1[248];
416 +} sense_blink_leds_t;
418 +#define IDA_READ 0x20
419 +#define IDA_WRITE 0x30
420 +#define IDA_WRITE_MEDIA 0x31
421 +#define RESET_TO_DIAG 0x40
422 +#define DIAG_PASS_THRU 0x41
424 +#define SENSE_CONFIG 0x50
425 +#define SET_CONFIG 0x51
429 + __u8 data_dist_mode;
431 + __u16 ctlr_phys_drv;
432 + __u16 log_unit_phys_drv;
433 + __u16 fault_tol_mode;
434 + __u8 phys_drv_param[16];
436 + __u32 drv_asgn_map;
438 + __u32 spare_asgn_map;
444 + __u8 parity_backedout_write_drvs;
445 + __u8 parity_dist_mode;
446 + __u8 parity_shift_fact;
447 + __u8 bios_disable_flag;
449 + __u32 blks_per_drv;
451 + __u16 big_drv_map[8];
452 + __u16 big_spare_map[8];
453 + __u8 ss_source_vol;
454 + __u8 mix_drv_cap_range;
456 + __u16 big_drv_map[8];
457 + __u32 blks_per_drv;
458 + __u16 fault_tol_mode;
461 + __u8 reserved1[248];
464 +#define BYPASS_VOL_STATE 0x52
465 +#define SS_CREATE_VOL 0x53
466 +#define CHANGE_CONFIG 0x54
467 +#define SENSE_ORIG_CONF 0x55
468 +#define REORDER_LOG_DRV 0x56
470 + __u8 old_units[32];
471 +} reorder_log_drv_t;
473 +#define LABEL_LOG_DRV 0x57
475 + __u8 log_drv_label[64];
478 +#define SS_TO_VOL 0x58
480 +#define SET_SURF_DELAY 0x60
483 + __u8 reserved[510];
486 +#define SET_OVERHEAT_DELAY 0x61
491 +#define SET_MP_DELAY
494 + __u8 reserved[510];
497 +#define SENSE_SURF_STATUS 0x70
499 +#define PASSTHRU_A 0x91
519 +#define RESUME_BACKGROUND_ACTIVITY 0x99
520 +#define SENSE_CONTROLLER_PERFORMANCE 0xa8
521 +#define FLUSH_CACHE 0xc2
522 +#define COLLECT_BUFFER 0xd2
523 +#define READ_FLASH_ROM 0xf6
524 +#define WRITE_FLASH_ROM 0xf7
527 +#endif /* ARRAYCMD_H */
528 diff -Nur cpqarrayd-2.2/drivers.orig/block/ida_ioctl.h cpqarrayd-2.2/drivers/block/ida_ioctl.h
529 --- cpqarrayd-2.2/drivers.orig/block/ida_ioctl.h 1970-01-01 01:00:00.000000000 +0100
530 +++ cpqarrayd-2.2/drivers/block/ida_ioctl.h 2005-11-17 16:51:31.000000000 +0100
533 + * Disk Array driver for Compaq SMART2 Controllers
534 + * Copyright 1998 Compaq Computer Corporation
536 + * This program is free software; you can redistribute it and/or modify
537 + * it under the terms of the GNU General Public License as published by
538 + * the Free Software Foundation; either version 2 of the License, or
539 + * (at your option) any later version.
541 + * This program is distributed in the hope that it will be useful,
542 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
543 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
544 + * NON INFRINGEMENT. See the GNU General Public License for more details.
546 + * You should have received a copy of the GNU General Public License
547 + * along with this program; if not, write to the Free Software
548 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
550 + * Questions/Comments/Bugfixes to arrays@compaq.com
556 +#include "ida_cmd.h"
557 +#include "cpqarray.h"
559 +#define IDAGETDRVINFO 0x27272828
560 +#define IDAPASSTHRU 0x28282929
561 +#define IDAGETCTLRSIG 0x29293030
562 +#define IDAREVALIDATEVOLS 0x30303131
563 +#define IDADRIVERVERSION 0x31313232
564 +#define IDAGETPCIINFO 0x32323333
565 +#define IDADEREGDISK 0x33333434
566 +#define IDAREGNEWDISK 0x34343535
567 +#define IDAGETLOGINFO 0x35353636
568 +#define IDABIGPASSTHRU 0x36363535
570 +typedef struct _ida_pci_info_struct
573 + unsigned char dev_fn;
575 +} ida_pci_info_struct;
577 +typedef struct _idaLogvolInfo_struct{
579 +int num_opens; /* number of opens on the logical volume */
580 +int num_parts; /* number of partitions configured on logvol */
581 +} idaLogvolInfo_struct;
584 + * Normally, the ioctl determines the logical unit for this command by
585 + * the major,minor number of the fd passed to ioctl. If you need to send
586 + * a command to a different/nonexistant unit (such as during config), you
587 + * can override the normal behavior by setting the unit valid bit. (Normally,
588 + * it should be zero) The controller the command is sent to is still
589 + * determined by the major number of the open device.
592 +#define UNITVALID 0x80
600 +/* currently, sg_cnt is assumed to be 1: only the 0th element of sg is used */
609 + unsigned char buf[1024];
612 + drv_param_t drv_param;
613 + id_log_drv_t id_log_drv;
614 + id_log_drv_ext_t id_log_drv_ext;
615 + sense_log_drv_stat_t sense_log_drv_stat;
616 + id_phys_drv_t id_phys_drv;
617 + blink_drv_leds_t blink_drv_leds;
618 + sense_blink_leds_t sense_blink_leds;
620 + reorder_log_drv_t reorder_log_drv;
621 + label_log_drv_t label_log_drv;
622 + surf_delay_t surf_delay;
623 + overhead_delay_t overhead_delay;
624 + mp_delay_t mp_delay;
625 + scsi_param_t scsi_param;
629 +#define IDA_MAX_KMALLOC_SIZE 128000
631 +/* transfer type of the commands */
632 +#define IDA_XFER_NONE 0x00
633 +#define IDA_XFER_READ 0x01
634 +#define IDA_XFER_WRITE 0x02
635 +#define IDA_XFER_BOTH 0x03
647 + __u32 buff_malloc_size;
648 + scsi_param_t *scsi_param; /* used only for PASSTHRU_A */
652 +#endif /* IDA_IOCTL_H */
653 --- arrayprobe-2.0/probe.c.orig 2006-01-03 14:11:17.000000000 +0100
654 +++ arrayprobe-2.0/probe.c 2007-06-14 19:17:32.393571925 +0200
659 -#include <linux/compiler.h>
660 #include <linux/cciss_ioctl.h>
662 #include <ida_ioctl.h>