1 --- cpqarrayd-2.2/configure.ac.orig 2005-07-28 16:33:41.000000000 +0200
2 +++ cpqarrayd-2.2/configure.ac 2006-03-09 11:31:02.000000000 +0100
4 dnl Check for pathed kernel sources with ida_ioctl.h
5 AC_MSG_CHECKING(for SmartArray header directories)
7 -for kernel_dir in /usr/src/linux /usr/src/linux-2.4
10 if test -d $kernel_dir ; then
11 CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
12 diff -Nur cpqarrayd-2.2/drivers.orig/block/cpqarray.h cpqarrayd-2.2/drivers/block/cpqarray.h
13 --- cpqarrayd-2.2/drivers.orig/block/cpqarray.h 1970-01-01 01:00:00.000000000 +0100
14 +++ cpqarrayd-2.2/drivers/block/cpqarray.h 2005-11-17 16:51:31.000000000 +0100
17 + * Disk Array driver for Compaq SMART2 Controllers
18 + * Copyright 1998 Compaq Computer Corporation
20 + * This program is free software; you can redistribute it and/or modify
21 + * it under the terms of the GNU General Public License as published by
22 + * the Free Software Foundation; either version 2 of the License, or
23 + * (at your option) any later version.
25 + * This program is distributed in the hope that it will be useful,
26 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
28 + * NON INFRINGEMENT. See the GNU General Public License for more details.
30 + * You should have received a copy of the GNU General Public License
31 + * along with this program; if not, write to the Free Software
32 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34 + * Questions/Comments/Bugfixes to arrays@compaq.com
36 + * If you want to make changes, improve or add functionality to this
37 + * driver, you'll probably need the Compaq Array Controller Interface
38 + * Specificiation (Document number ECG086/1198)
44 +#include <linux/blkdev.h>
45 +#include <linux/locks.h>
46 +#include <linux/slab.h>
47 +#include <linux/proc_fs.h>
48 +#include <linux/timer.h>
57 +#define IDA_MAX_PART 16
59 +#define IDA_TIMER (5*HZ)
60 +#define IDA_TIMEOUT (10*HZ)
62 +#define MISC_NONFATAL_WARN 0x01
76 +typedef struct ctlr_info ctlr_info_t;
78 +struct access_method {
79 + void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
80 + void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
81 + unsigned long (*fifo_full)(ctlr_info_t *h);
82 + unsigned long (*intr_pending)(ctlr_info_t *h);
83 + unsigned long (*command_completed)(ctlr_info_t *h);
89 + struct access_method *access;
96 + __u32 drv_assign_map;
97 + __u32 drv_spare_map;
98 + __u32 mp_failed_drv_map;
101 + struct pci_dev *pdev;
108 + struct pci_dev *pci_dev; /* NULL if EISA */
110 + char *product_name;
113 + unsigned long paddr;
114 + unsigned long io_mem_addr;
115 + unsigned long io_mem_length;
118 + drv_info_t drv[NWD];
119 + struct proc_dir_entry *proc;
121 + struct access_method access;
125 + cmdlist_t *cmd_pool;
126 + dma_addr_t cmd_pool_dhandle;
127 + __u32 *cmd_pool_bits;
129 + unsigned int Qdepth;
130 + unsigned int maxQsinceinit;
132 + unsigned int nr_requests;
133 + unsigned int nr_allocs;
134 + unsigned int nr_frees;
135 + struct timer_list timer;
136 + unsigned int misc_tflags;
137 + // Disk structures we need to pass back
138 + struct gendisk gendisk;
139 + // Index by Minor Numbers
140 + struct hd_struct hd[256];
142 + int blocksizes[256];
143 + int hardsizes[256];
147 +#endif /* CPQARRAY_H */
148 diff -Nur cpqarrayd-2.2/drivers.orig/block/ida_cmd.h cpqarrayd-2.2/drivers/block/ida_cmd.h
149 --- cpqarrayd-2.2/drivers.orig/block/ida_cmd.h 1970-01-01 01:00:00.000000000 +0100
150 +++ cpqarrayd-2.2/drivers/block/ida_cmd.h 2005-11-17 16:51:31.000000000 +0100
153 + * Disk Array driver for Compaq SMART2 Controllers
154 + * Copyright 1998 Compaq Computer Corporation
156 + * This program is free software; you can redistribute it and/or modify
157 + * it under the terms of the GNU General Public License as published by
158 + * the Free Software Foundation; either version 2 of the License, or
159 + * (at your option) any later version.
161 + * This program is distributed in the hope that it will be useful,
162 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
163 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
164 + * NON INFRINGEMENT. See the GNU General Public License for more details.
166 + * You should have received a copy of the GNU General Public License
167 + * along with this program; if not, write to the Free Software
168 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
170 + * Questions/Comments/Bugfixes to arrays@compaq.com
176 +#include <asm/types.h>
178 +#include <linux/blkdev.h>
181 +/* for the Smart Array 42XX cards */
182 +#define S42XX_REQUEST_PORT_OFFSET 0x40
183 +#define S42XX_REPLY_INTR_MASK_OFFSET 0x34
184 +#define S42XX_REPLY_PORT_OFFSET 0x44
185 +#define S42XX_INTR_STATUS 0x30
187 +#define S42XX_INTR_OFF 0x08
188 +#define S42XX_INTR_PENDING 0x08
190 +#define COMMAND_FIFO 0x04
191 +#define COMMAND_COMPLETE_FIFO 0x08
192 +#define INTR_MASK 0x0C
193 +#define INTR_STATUS 0x10
194 +#define INTR_PENDING 0x14
196 +#define FIFO_NOT_EMPTY 0x01
197 +#define FIFO_NOT_FULL 0x02
199 +#define BIG_PROBLEM 0x40
200 +#define LOG_NOT_CONF 2
208 +#define RCODE_NONFATAL 0x02
209 +#define RCODE_FATAL 0x04
210 +#define RCODE_INVREQ 0x10
234 +#define CMD_RWREQ 0x00
235 +#define CMD_IOCTL_PEND 0x01
237 +typedef struct cmdlist {
244 + struct cmdlist *prev;
245 + struct cmdlist *next;
246 + struct request *rq;
247 + struct completion *waiting;
251 +#define ID_CTLR 0x11
259 + __u32 drv_present_map;
263 + __u32 non_disk_bits;
269 + __u8 marketing_rev;
274 + __u32 max_req_blocks;
277 + __u16 big_drv_present_map[8];
278 + __u16 big_ext_drv_map[8];
279 + __u16 big_non_disk_map[8];
284 + __u8 red_ctlr_stat;
285 + __u8 red_fail_reason;
286 + __u8 reserved[403];
300 + __u8 sect_per_track;
304 +#define ID_LOG_DRV 0x10
314 +#define ID_LOG_DRV_EXT 0x18
317 + __u8 log_drv_label[64];
318 + __u8 reserved[418];
321 +#define SENSE_LOG_DRV_STAT 0x12
325 + __u16 read_err[32];
326 + __u16 write_err[32];
327 + __u8 drv_err_data[256];
328 + __u8 drq_timeout[32];
329 + __u32 blks_to_recover;
330 + __u8 drv_recovering;
331 + __u16 remap_cnt[32];
332 + __u32 replace_drv_map;
333 + __u32 act_spare_map;
335 + __u8 spare_repl_map[32];
341 + __u16 big_fail_map[8];
342 + __u16 big_remap_map[128];
343 + __u16 big_repl_map[8];
344 + __u16 big_act_spare_map[8];
345 + __u8 big_spar_repl_map[128];
346 + __u16 big_repl_ok_map[8];
347 + __u8 big_drv_rebuild;
349 +} sense_log_drv_stat_t;
351 +#define START_RECOVER 0x13
353 +#define ID_PHYS_DRV 0x15
360 + __u8 drv_model[40];
364 + __u8 compaq_drv_stmp;
366 + __u8 phys_drv_flags;
367 + __u8 phys_drv_flags1;
369 + __u8 phys_drv_flags2;
371 + __u32 spi_speed_rules;
372 + __u8 phys_connector[2];
373 + __u8 phys_box_on_bus;
374 + __u8 phys_bay_in_box;
377 +#define BLINK_DRV_LEDS 0x16
379 + __u32 blink_duration;
382 + __u8 reserved1[248];
385 +#define SENSE_BLINK_LEDS 0x17
387 + __u32 blink_duration;
390 + __u8 reserved1[248];
391 +} sense_blink_leds_t;
393 +#define IDA_READ 0x20
394 +#define IDA_WRITE 0x30
395 +#define IDA_WRITE_MEDIA 0x31
396 +#define RESET_TO_DIAG 0x40
397 +#define DIAG_PASS_THRU 0x41
399 +#define SENSE_CONFIG 0x50
400 +#define SET_CONFIG 0x51
404 + __u8 data_dist_mode;
406 + __u16 ctlr_phys_drv;
407 + __u16 log_unit_phys_drv;
408 + __u16 fault_tol_mode;
409 + __u8 phys_drv_param[16];
411 + __u32 drv_asgn_map;
413 + __u32 spare_asgn_map;
419 + __u8 parity_backedout_write_drvs;
420 + __u8 parity_dist_mode;
421 + __u8 parity_shift_fact;
422 + __u8 bios_disable_flag;
424 + __u32 blks_per_drv;
426 + __u16 big_drv_map[8];
427 + __u16 big_spare_map[8];
428 + __u8 ss_source_vol;
429 + __u8 mix_drv_cap_range;
431 + __u16 big_drv_map[8];
432 + __u32 blks_per_drv;
433 + __u16 fault_tol_mode;
436 + __u8 reserved1[248];
439 +#define BYPASS_VOL_STATE 0x52
440 +#define SS_CREATE_VOL 0x53
441 +#define CHANGE_CONFIG 0x54
442 +#define SENSE_ORIG_CONF 0x55
443 +#define REORDER_LOG_DRV 0x56
445 + __u8 old_units[32];
446 +} reorder_log_drv_t;
448 +#define LABEL_LOG_DRV 0x57
450 + __u8 log_drv_label[64];
453 +#define SS_TO_VOL 0x58
455 +#define SET_SURF_DELAY 0x60
458 + __u8 reserved[510];
461 +#define SET_OVERHEAT_DELAY 0x61
466 +#define SET_MP_DELAY
469 + __u8 reserved[510];
472 +#define SENSE_SURF_STATUS 0x70
474 +#define PASSTHRU_A 0x91
494 +#define RESUME_BACKGROUND_ACTIVITY 0x99
495 +#define SENSE_CONTROLLER_PERFORMANCE 0xa8
496 +#define FLUSH_CACHE 0xc2
497 +#define COLLECT_BUFFER 0xd2
498 +#define READ_FLASH_ROM 0xf6
499 +#define WRITE_FLASH_ROM 0xf7
502 +#endif /* ARRAYCMD_H */
503 diff -Nur cpqarrayd-2.2/drivers.orig/block/ida_ioctl.h cpqarrayd-2.2/drivers/block/ida_ioctl.h
504 --- cpqarrayd-2.2/drivers.orig/block/ida_ioctl.h 1970-01-01 01:00:00.000000000 +0100
505 +++ cpqarrayd-2.2/drivers/block/ida_ioctl.h 2005-11-17 16:51:31.000000000 +0100
508 + * Disk Array driver for Compaq SMART2 Controllers
509 + * Copyright 1998 Compaq Computer Corporation
511 + * This program is free software; you can redistribute it and/or modify
512 + * it under the terms of the GNU General Public License as published by
513 + * the Free Software Foundation; either version 2 of the License, or
514 + * (at your option) any later version.
516 + * This program is distributed in the hope that it will be useful,
517 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
518 + * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
519 + * NON INFRINGEMENT. See the GNU General Public License for more details.
521 + * You should have received a copy of the GNU General Public License
522 + * along with this program; if not, write to the Free Software
523 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
525 + * Questions/Comments/Bugfixes to arrays@compaq.com
531 +#include "ida_cmd.h"
532 +#include "cpqarray.h"
534 +#define IDAGETDRVINFO 0x27272828
535 +#define IDAPASSTHRU 0x28282929
536 +#define IDAGETCTLRSIG 0x29293030
537 +#define IDAREVALIDATEVOLS 0x30303131
538 +#define IDADRIVERVERSION 0x31313232
539 +#define IDAGETPCIINFO 0x32323333
540 +#define IDADEREGDISK 0x33333434
541 +#define IDAREGNEWDISK 0x34343535
542 +#define IDAGETLOGINFO 0x35353636
543 +#define IDABIGPASSTHRU 0x36363535
545 +typedef struct _ida_pci_info_struct
548 + unsigned char dev_fn;
550 +} ida_pci_info_struct;
552 +typedef struct _idaLogvolInfo_struct{
554 +int num_opens; /* number of opens on the logical volume */
555 +int num_parts; /* number of partitions configured on logvol */
556 +} idaLogvolInfo_struct;
559 + * Normally, the ioctl determines the logical unit for this command by
560 + * the major,minor number of the fd passed to ioctl. If you need to send
561 + * a command to a different/nonexistant unit (such as during config), you
562 + * can override the normal behavior by setting the unit valid bit. (Normally,
563 + * it should be zero) The controller the command is sent to is still
564 + * determined by the major number of the open device.
567 +#define UNITVALID 0x80
575 +/* currently, sg_cnt is assumed to be 1: only the 0th element of sg is used */
584 + unsigned char buf[1024];
587 + drv_param_t drv_param;
588 + id_log_drv_t id_log_drv;
589 + id_log_drv_ext_t id_log_drv_ext;
590 + sense_log_drv_stat_t sense_log_drv_stat;
591 + id_phys_drv_t id_phys_drv;
592 + blink_drv_leds_t blink_drv_leds;
593 + sense_blink_leds_t sense_blink_leds;
595 + reorder_log_drv_t reorder_log_drv;
596 + label_log_drv_t label_log_drv;
597 + surf_delay_t surf_delay;
598 + overhead_delay_t overhead_delay;
599 + mp_delay_t mp_delay;
600 + scsi_param_t scsi_param;
604 +#define IDA_MAX_KMALLOC_SIZE 128000
606 +/* transfer type of the commands */
607 +#define IDA_XFER_NONE 0x00
608 +#define IDA_XFER_READ 0x01
609 +#define IDA_XFER_WRITE 0x02
610 +#define IDA_XFER_BOTH 0x03
622 + __u32 buff_malloc_size;
623 + scsi_param_t *scsi_param; /* used only for PASSTHRU_A */
627 +#endif /* IDA_IOCTL_H */
628 --- arrayprobe-2.0/include/linux/compiler.h_ 1970-01-01 00:00:00.000000000 +0000
629 +++ arrayprobe-2.0/include/linux/compiler.h 2007-04-26 03:08:32.000000000 +0000
631 +#ifndef __LINUX_COMPILER_H
632 +#define __LINUX_COMPILER_H
634 +#ifndef __ASSEMBLY__
637 +# define __user __attribute__((noderef, address_space(1)))
638 +# define __kernel /* default address space */
639 +# define __safe __attribute__((safe))
640 +# define __force __attribute__((force))
641 +# define __nocast __attribute__((nocast))
642 +# define __iomem __attribute__((noderef, address_space(2)))
643 +# define __acquires(x) __attribute__((context(x,0,1)))
644 +# define __releases(x) __attribute__((context(x,1,0)))
645 +# define __acquire(x) __context__(x,1)
646 +# define __release(x) __context__(x,-1)
647 +# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
648 +extern void __chk_user_ptr(const void __user *);
649 +extern void __chk_io_ptr(const void __iomem *);
657 +# define __chk_user_ptr(x) (void)0
658 +# define __chk_io_ptr(x) (void)0
659 +# define __builtin_warning(x, y...) (1)
660 +# define __acquires(x)
661 +# define __releases(x)
662 +# define __acquire(x) (void)0
663 +# define __release(x) (void)0
664 +# define __cond_lock(x,c) (c)
670 +#error no compiler-gcc.h file for this gcc version
672 +# include <linux/compiler-gcc4.h>
673 +#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
674 +# include <linux/compiler-gcc3.h>
676 +# error Sorry, your compiler is too old/not recognized.
679 +/* Intel compiler defines __GNUC__. So we will overwrite implementations
680 + * coming from above header files here
682 +#ifdef __INTEL_COMPILER
683 +# include <linux/compiler-intel.h>
687 + * Generic compiler-dependent macros required for kernel
688 + * build go below this comment. Actual compiler/compiler version
689 + * specific implementations come from the above header files
692 +#define likely(x) __builtin_expect(!!(x), 1)
693 +#define unlikely(x) __builtin_expect(!!(x), 0)
695 +/* Optimization barrier */
697 +# define barrier() __memory_barrier()
701 +# define RELOC_HIDE(ptr, off) \
702 + ({ unsigned long __ptr; \
703 + __ptr = (unsigned long) (ptr); \
704 + (typeof(ptr)) (__ptr + (off)); })
707 +#endif /* __KERNEL__ */
709 +#endif /* __ASSEMBLY__ */
713 + * Allow us to mark functions as 'deprecated' and have gcc emit a nice
714 + * warning for each use, in hopes of speeding the functions removal.
716 + * int __deprecated foo(void)
718 +#ifndef __deprecated
719 +# define __deprecated /* unimplemented */
723 +#define __deprecated_for_modules __deprecated
725 +#define __deprecated_for_modules
728 +#ifndef __must_check
729 +#define __must_check
732 +#ifndef CONFIG_ENABLE_MUST_CHECK
734 +#define __must_check
738 + * Allow us to avoid 'defined but not used' warnings on functions and data,
739 + * as well as force them to be emitted to the assembly file.
741 + * As of gcc 3.3, static functions that are not marked with attribute((used))
742 + * may be elided from the assembly file. As of gcc 3.3, static data not so
743 + * marked will not be elided, but this may change in a future gcc version.
745 + * In prior versions of gcc, such functions and data would be emitted, but
746 + * would be warned about except with attribute((unused)).
748 +#ifndef __attribute_used__
749 +# define __attribute_used__ /* unimplemented */
753 + * From the GCC manual:
755 + * Many functions have no effects except the return value and their
756 + * return value depends only on the parameters and/or global
757 + * variables. Such a function can be subject to common subexpression
758 + * elimination and loop optimization just as an arithmetic operator
762 +#ifndef __attribute_pure__
763 +# define __attribute_pure__ /* unimplemented */
770 +#ifndef __always_inline
771 +#define __always_inline inline
774 +#endif /* __KERNEL__ */
777 + * From the GCC manual:
779 + * Many functions do not examine any values except their arguments,
780 + * and have no effects except the return value. Basically this is
781 + * just slightly more strict class than the `pure' attribute above,
782 + * since function is not allowed to read global memory.
784 + * Note that a function that has pointer arguments and examines the
785 + * data pointed to must _not_ be declared `const'. Likewise, a
786 + * function that calls a non-`const' function usually must not be
787 + * `const'. It does not make sense for a `const' function to return
790 +#ifndef __attribute_const__
791 +# define __attribute_const__ /* unimplemented */
794 +#endif /* __LINUX_COMPILER_H */