|
|
50683e5 |
diff -up cpqarrayd-2.3/status.c.no_ida cpqarrayd-2.3/status.c
|
|
|
50683e5 |
--- cpqarrayd-2.3/status.c.no_ida 2007-12-03 19:06:22.000000000 +0200
|
|
|
50683e5 |
+++ cpqarrayd-2.3/status.c 2008-07-18 11:43:59.000000000 +0300
|
|
|
50683e5 |
@@ -33,9 +33,13 @@
|
|
|
50683e5 |
#endif
|
|
|
50683e5 |
|
|
|
50683e5 |
#include <sys/ioctl.h>
|
|
|
50683e5 |
+
|
|
|
50683e5 |
+#ifdef HAVE_IDA
|
|
|
50683e5 |
#include <ida_ioctl.h>
|
|
|
50683e5 |
#include <ida_cmd.h>
|
|
|
50683e5 |
#include <cpqarray.h>
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
+
|
|
|
50683e5 |
#include <syslog.h>
|
|
|
50683e5 |
|
|
|
50683e5 |
#include "cpqarrayd.h"
|
|
|
50683e5 |
@@ -45,7 +49,8 @@
|
|
|
50683e5 |
#include "cciss_structs.h"
|
|
|
50683e5 |
#include "cciss_functions.h"
|
|
|
50683e5 |
|
|
|
50683e5 |
-int status_check (struct opts opts)
|
|
|
50683e5 |
+#ifdef HAVE_IDA
|
|
|
50683e5 |
+int status_check (struct opts opts)
|
|
|
50683e5 |
{
|
|
|
50683e5 |
|
|
|
50683e5 |
int devicefd;
|
|
|
50683e5 |
@@ -183,6 +188,7 @@ int status_check (struct opts opts)
|
|
|
50683e5 |
return 1;
|
|
|
50683e5 |
|
|
|
50683e5 |
}
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
|
|
|
50683e5 |
int cciss_status_check (struct opts opts)
|
|
|
50683e5 |
{
|
|
|
50683e5 |
@@ -190,7 +196,6 @@ int cciss_status_check (struct opts opts
|
|
|
50683e5 |
int devicefd;
|
|
|
50683e5 |
int ctrl_cntr, result;
|
|
|
50683e5 |
int logd_cntr;
|
|
|
50683e5 |
- ida_ioctl_t io, io2;
|
|
|
50683e5 |
int status, nr_blks, blks_tr, trap_stat;
|
|
|
50683e5 |
float pvalue;
|
|
|
50683e5 |
char statusmsg[1024];
|
|
|
50683e5 |
diff -up cpqarrayd-2.3/discover.c.no_ida cpqarrayd-2.3/discover.c
|
|
|
50683e5 |
--- cpqarrayd-2.3/discover.c.no_ida 2007-12-03 19:06:22.000000000 +0200
|
|
|
50683e5 |
+++ cpqarrayd-2.3/discover.c 2008-07-18 11:49:23.000000000 +0300
|
|
|
50683e5 |
@@ -33,12 +33,14 @@
|
|
|
50683e5 |
#include <linux/compiler.h>
|
|
|
50683e5 |
#endif
|
|
|
50683e5 |
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
#if defined(__linux__)
|
|
|
50683e5 |
#include <ida_ioctl.h>
|
|
|
50683e5 |
#include <ida_ioctl.h>
|
|
|
50683e5 |
#include <ida_cmd.h>
|
|
|
50683e5 |
#include <cpqarray.h>
|
|
|
50683e5 |
#endif
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
|
|
|
50683e5 |
#if defined(__freebsd__)
|
|
|
50683e5 |
#include <idavar.h>
|
|
|
50683e5 |
@@ -52,8 +54,12 @@
|
|
|
50683e5 |
|
|
|
50683e5 |
|
|
|
50683e5 |
int discover_controllers (struct opts);
|
|
|
50683e5 |
+
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
int interrogate_controller (struct opts, const char *);
|
|
|
50683e5 |
int interrogate_logical(struct opts, int, int);
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
+
|
|
|
50683e5 |
void boardid2str (unsigned long , char *);
|
|
|
50683e5 |
|
|
|
50683e5 |
/* Added devfs devices
|
|
|
50683e5 |
@@ -84,6 +90,7 @@ discover_controllers (struct opts opts)
|
|
|
50683e5 |
int cntr;
|
|
|
50683e5 |
int foundone = 0;
|
|
|
50683e5 |
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
for (cntr = 0; cntr < 8; cntr++)
|
|
|
50683e5 |
{
|
|
|
50683e5 |
/* does this device exist ? */
|
|
|
50683e5 |
@@ -104,6 +111,8 @@ discover_controllers (struct opts opts)
|
|
|
50683e5 |
perror ("DEBUG: reason");
|
|
|
50683e5 |
}
|
|
|
50683e5 |
}
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
+
|
|
|
50683e5 |
for (cntr = 0; cntr < 16; cntr++)
|
|
|
50683e5 |
{
|
|
|
50683e5 |
/* does this device exist ? */
|
|
|
50683e5 |
@@ -127,6 +136,7 @@ discover_controllers (struct opts opts)
|
|
|
50683e5 |
return foundone;
|
|
|
50683e5 |
}
|
|
|
50683e5 |
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
int
|
|
|
50683e5 |
interrogate_controller (struct opts opts, const char *devicefile)
|
|
|
50683e5 |
{
|
|
|
50683e5 |
@@ -227,6 +237,7 @@ interrogate_logical (struct opts opts, i
|
|
|
50683e5 |
|
|
|
50683e5 |
return 1;
|
|
|
50683e5 |
}
|
|
|
50683e5 |
+#endif
|
|
|
50683e5 |
|
|
|
50683e5 |
void
|
|
|
50683e5 |
boardid2str (unsigned long board_id, char *name)
|
|
|
50683e5 |
diff -up cpqarrayd-2.3/configure.ac.no_ida cpqarrayd-2.3/configure.ac
|
|
|
50683e5 |
--- cpqarrayd-2.3/configure.ac.no_ida 2005-12-16 13:17:44.000000000 +0200
|
|
|
50683e5 |
+++ cpqarrayd-2.3/configure.ac 2008-07-18 11:41:27.000000000 +0300
|
|
|
fced53a |
@@ -16,35 +16,35 @@ AC_PROG_MAKE_SET
|
|
|
fced53a |
AC_HEADER_STDC
|
|
|
fced53a |
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])
|
|
|
fced53a |
|
|
|
fced53a |
-dnl Check for pathed kernel sources with ida_ioctl.h
|
|
|
fced53a |
-AC_MSG_CHECKING(for kernel sources)
|
|
|
fced53a |
-found_kernel_dir=""
|
|
|
fced53a |
-for kernel_dir in /usr/src/linux /usr/src/linux-2.4
|
|
|
fced53a |
-do
|
|
|
fced53a |
- if test -d $kernel_dir ; then
|
|
|
fced53a |
- CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
|
|
|
fced53a |
- CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
|
|
|
fced53a |
- found_kernel_dir="$kernel_dir"
|
|
|
fced53a |
- fi
|
|
|
fced53a |
-done
|
|
|
fced53a |
-
|
|
|
fced53a |
-if test "$found_kernel_dir" != "" ; then
|
|
|
fced53a |
- AC_MSG_RESULT(found $found_kernel_dir )
|
|
|
fced53a |
-else
|
|
|
fced53a |
- AC_MSG_ERROR(Kernel sources not found)
|
|
|
fced53a |
-fi
|
|
|
fced53a |
+dnl dnl Check for pathed kernel sources with ida_ioctl.h
|
|
|
fced53a |
+dnl AC_MSG_CHECKING(for kernel sources)
|
|
|
fced53a |
+dnl found_kernel_dir=""
|
|
|
fced53a |
+dnl for kernel_dir in /usr/src/linux /usr/src/linux-2.4
|
|
|
fced53a |
+dnl do
|
|
|
fced53a |
+dnl if test -d $kernel_dir ; then
|
|
|
fced53a |
+dnl CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
|
|
|
fced53a |
+dnl CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
|
|
|
fced53a |
+dnl found_kernel_dir="$kernel_dir"
|
|
|
fced53a |
+dnl fi
|
|
|
fced53a |
+dnl done
|
|
|
fced53a |
+
|
|
|
fced53a |
+dnl if test "$found_kernel_dir" != "" ; then
|
|
|
fced53a |
+dnl AC_MSG_RESULT(found $found_kernel_dir )
|
|
|
fced53a |
+dnl else
|
|
|
fced53a |
+dnl AC_MSG_ERROR(Kernel sources not found)
|
|
|
fced53a |
+dnl fi
|
|
|
fced53a |
|
|
|
fced53a |
dnl Check for compile.h (2.6.x kernels only?
|
|
|
fced53a |
AC_CHECK_HEADERS(linux/compiler.h)
|
|
|
fced53a |
|
|
|
fced53a |
-dnl Check Headers
|
|
|
fced53a |
-AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
|
|
|
fced53a |
- AC_MSG_ERROR(You need to have the SmartArray driver in the kernel.))
|
|
|
fced53a |
-
|
|
|
fced53a |
-dnl Check version of SmartArray driver
|
|
|
fced53a |
-AC_MSG_CHECKING(SmartArray driver version)
|
|
|
fced53a |
-AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
|
|
|
fced53a |
- AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
|
|
|
fced53a |
+dnl dnl Check Headers
|
|
|
fced53a |
+dnl AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
|
|
|
fced53a |
+dnl AC_MSG_ERROR(You need to have the SmartArray driver in the kernel.))
|
|
|
fced53a |
+
|
|
|
fced53a |
+dnl dnl Check version of SmartArray driver
|
|
|
fced53a |
+dnl AC_MSG_CHECKING(SmartArray driver version)
|
|
|
fced53a |
+dnl AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
|
|
|
fced53a |
+dnl AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
|
|
|
fced53a |
|
|
|
fced53a |
dnl Check for CCISS header file
|
|
|
fced53a |
AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
|
|
|
50683e5 |
--- cpqarrayd-2.3/cpqarrayd.c.no_ida 2007-12-03 19:06:22.000000000 +0200
|
|
|
50683e5 |
+++ cpqarrayd-2.3/cpqarrayd.c 2008-07-18 13:02:17.000000000 +0300
|
|
|
50683e5 |
@@ -35,9 +35,11 @@
|
|
|
fced53a |
#include <linux/compiler.h>
|
|
|
fced53a |
#endif
|
|
|
fced53a |
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
#if defined(__linux__)
|
|
|
50683e5 |
#include <ida_ioctl.h>
|
|
|
50683e5 |
#endif
|
|
|
50683e5 |
+#endif
|
|
|
fced53a |
|
|
|
fced53a |
#if defined(__freebsd__)
|
|
|
fced53a |
#include <idavar.h>
|
|
|
50683e5 |
@@ -249,7 +251,10 @@
|
|
|
fced53a |
syslog(LOG_INFO, "Logging Enabled...");
|
|
|
fced53a |
|
|
|
fced53a |
while (keeprunning) {
|
|
|
50683e5 |
+
|
|
|
50683e5 |
+#ifdef WITH_IDA
|
|
|
50683e5 |
status_check(opts);
|
|
|
50683e5 |
+#endif
|
|
|
fced53a |
cciss_status_check(opts);
|
|
|
fced53a |
if (keeprunning) { sleep(30); }
|
|
|
fced53a |
}
|