diff -x config.h -x *.Po -ru cpqarrayd-2.2/cciss_structs.h cpqarrayd-2.2+freebsd/cciss_structs.h --- cpqarrayd-2.2/cciss_structs.h Fri Sep 26 15:41:11 2003 +++ cpqarrayd-2.2+freebsd/cciss_structs.h Fri Oct 6 20:44:58 2006 @@ -27,10 +27,17 @@ #define _CCISS_STRUCTS_H 1 +#ifdef __FreeBSD__ +#define BYTE uint8_t +#define WORD uint16_t +#define DWORD uint32_t +#define QWORD uint64_t +#else #define BYTE __u8 #define WORD __u16 #define DWORD __u32 #define QWORD __u64 +#endif /* from cciss_cmd.h */ #define CISS_MAX_LUN 16 diff -x config.h -x *.Po -ru cpqarrayd-2.2/configure cpqarrayd-2.2+freebsd/configure --- cpqarrayd-2.2/configure Fri Jul 29 23:15:20 2005 +++ cpqarrayd-2.2+freebsd/configure Fri Oct 6 20:45:28 2006 @@ -3579,7 +3579,7 @@ echo "$as_me:$LINENO: checking for SmartArray header directories" >&5 echo $ECHO_N "checking for SmartArray header directories... $ECHO_C" >&6 found_kernel_dir="" -for kernel_dir in /usr/src/linux /usr/src/linux-2.4 +for kernel_dir in /usr/src/linux /usr/src/linux-2.4 /usr/src/sys do if test -d $kernel_dir ; then CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block" @@ -3896,10 +3896,6 @@ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else - { { echo "$as_me:$LINENO: error: You need to have the SmartArray driver in the kernel." >&5 -echo "$as_me: error: You need to have the SmartArray driver in the kernel." >&2;} - { (exit 1); exit 1; }; } fi done @@ -3920,10 +3916,6 @@ $EGREP "blk_cnt" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 -else - { { echo "$as_me:$LINENO: error: You need to have the SmartArray driver version 1.0.1 or higher installed." >&5 -echo "$as_me: error: You need to have the SmartArray driver version 1.0.1 or higher installed." >&2;} - { (exit 1); exit 1; }; } fi rm -f conftest* @@ -4074,10 +4066,6 @@ #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -else - { { echo "$as_me:$LINENO: error: You need to have the CCISS driver in the kernel." >&5 -echo "$as_me: error: You need to have the CCISS driver in the kernel." >&2;} - { (exit 1); exit 1; }; } fi done diff -x config.h -x *.Po -ru cpqarrayd-2.2/cpqarrayd.c cpqarrayd-2.2+freebsd/cpqarrayd.c --- cpqarrayd-2.2/cpqarrayd.c Thu Jul 28 18:23:20 2005 +++ cpqarrayd-2.2+freebsd/cpqarrayd.c Fri Oct 6 20:42:47 2006 @@ -39,8 +39,8 @@ #include #endif -#if defined(__freebsd__) - #include +#if defined(__FreeBSD__) + #include #endif #include @@ -249,7 +249,9 @@ free(buffer); while (keeprunning) { +#if defined(__linux__) status_check(opts); +#endif cciss_status_check(opts); if (keeprunning) { sleep(30); } } diff -x config.h -x *.Po -ru cpqarrayd-2.2/discover.c cpqarrayd-2.2+freebsd/discover.c --- cpqarrayd-2.2/discover.c Fri Jul 29 23:22:47 2005 +++ cpqarrayd-2.2+freebsd/discover.c Fri Oct 6 20:42:47 2006 @@ -38,23 +38,25 @@ #include #include #include + #include #endif -#if defined(__freebsd__) - #include +#if defined(__FreeBSD__) + #include #endif #include "cpqarrayd.h" -#include #include "cciss_structs.h" #include "cciss_functions.h" int discover_controllers (struct opts); +#if defined(__linux__) int interrogate_controller (struct opts, const char *); int interrogate_logical(struct opts, int, int); void boardid2str (unsigned long , char *); +#endif /* Added devfs devices * - thanks Thermoman :) @@ -75,7 +77,15 @@ "/dev/cciss/host4/target0/disc", "/dev/cciss/host5/target0/disc", "/dev/cciss/host6/target0/disc", - "/dev/cciss/host7/target0/disc" + "/dev/cciss/host7/target0/disc", + "/dev/ciss0", + "/dev/ciss1", + "/dev/ciss2", + "/dev/ciss3", + "/dev/ciss4", + "/dev/ciss5", + "/dev/ciss6", + "/dev/ciss7" }; int @@ -84,6 +94,7 @@ int cntr; int foundone = 0; +#if defined(__linux__) for (cntr = 0; cntr < 8; cntr++) { /* does this device exist ? */ @@ -104,7 +115,8 @@ perror ("DEBUG: reason"); } } - for (cntr = 0; cntr < 16; cntr++) +#endif + for (cntr = 0; cntr < 24; cntr++) { /* does this device exist ? */ if ((access (cciss_controllers[cntr], R_OK | F_OK)) == 0) @@ -127,6 +139,7 @@ return foundone; } +#if defined(__linux__) int interrogate_controller (struct opts opts, const char *devicefile) { @@ -284,7 +297,7 @@ strcpy (name, "Unknown Controller Type"); } } - +#endif int cciss_interrogate_controller (struct opts opts, const char *devicefile) { int devicefd; diff -x config.h -x *.Po -ru cpqarrayd-2.2/status.c cpqarrayd-2.2+freebsd/status.c --- cpqarrayd-2.2/status.c Thu Jul 28 18:25:38 2005 +++ cpqarrayd-2.2+freebsd/status.c Fri Oct 6 20:42:47 2006 @@ -28,23 +28,30 @@ #include #include #include +#include #if defined(HAVE_LINUX_COMPILER_H) #include #endif -#include -#include -#include -#include -#include +#if defined(__linux__) + #include + #include + #include + #include + #include +#endif + +#if defined(__FreeBSD__) + #include +#endif #include "cpqarrayd.h" #include "sendtrap.h" -#include #include "cciss_structs.h" #include "cciss_functions.h" +#if defined(__linux__) int status_check (struct opts opts) { @@ -185,6 +192,7 @@ return 1; } +#endif int cciss_status_check (struct opts opts) { @@ -192,7 +200,6 @@ int devicefd; int ctrl_cntr, result; int logd_cntr; - ida_ioctl_t io, io2; int status, nr_blks, blks_tr, trap_stat; float pvalue; char *statusmsg;