From 39efc692f2946e28c410366cdbf473159f9a14f3 Mon Sep 17 00:00:00 2001
From: guidog <guidog@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Sun, 13 May 2007 14:33:33 +0000
Subject: [PATCH] cciss: allow for >8 disks

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2404 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/CHANGELOG    | 6 +++++-
 sm5/smartctl.cpp | 6 +++---
 sm5/smartd.cpp   | 8 ++++----
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG
index c8ba337c8..996255f4e 100644
--- a/sm5/CHANGELOG
+++ b/sm5/CHANGELOG
@@ -1,6 +1,6 @@
 CHANGELOG for smartmontools
 
-$Id: CHANGELOG,v 1.613 2007/05/09 19:02:37 dpgilbert Exp $
+$Id: CHANGELOG,v 1.614 2007/05/13 14:33:33 guidog Exp $
 
 The most recent version of this file is:
 http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
@@ -33,6 +33,10 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [GG] cciss: support more than 16 disks (patch taken from
+       http://cciss.sourceforge.net/smartmontools_cciss_more_than_16_drives.patch
+       and adjusted for smartd)
+
   [DG] Solaris: [SCSI] add USCSI_RQENABLE flag to uscsi pass-through so
        sense buffer is made available. Expand reporting at this level.
 
diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp
index ee160feb4..6648f5b3b 100644
--- a/sm5/smartctl.cpp
+++ b/sm5/smartctl.cpp
@@ -50,7 +50,7 @@
 extern const char *os_solaris_ata_s_cvsid;
 #endif
 extern const char *atacmdnames_c_cvsid, *atacmds_c_cvsid, *ataprint_c_cvsid, *knowndrives_c_cvsid, *os_XXXX_c_cvsid, *scsicmds_c_cvsid, *scsiprint_c_cvsid, *utility_c_cvsid;
-const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.162 2007/02/12 21:58:31 chrfranke Exp $"
+const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.163 2007/05/13 14:33:33 guidog Exp $"
 ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SCSICMDS_H_CVSID SCSIPRINT_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
 
 // This is a block containing all the "control variables".  We declare
@@ -478,8 +478,8 @@ void ParseOpts (int argc, char** argv){
              if (split_report_arg2(s, &i)) {
                  sprintf(extraerror, "Option -d cciss,N requires N to be a non-negative integer\n");
                  badarg = TRUE;
-             } else if (i<0 || i>15) {
-                 sprintf(extraerror, "Option -d cciss,N (N=%d) must have 0 <= N <= 15\n", i);
+             } else if (i<0 || i>127) {
+                 sprintf(extraerror, "Option -d cciss,N (N=%d) must have 0 <= N <= 127\n", i);
                  badarg = TRUE;
              } else {
                // NOTE: controller_port == drive number
diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp
index fd5097d6e..8089fdce6 100644
--- a/sm5/smartd.cpp
+++ b/sm5/smartd.cpp
@@ -119,14 +119,14 @@ extern "C" int getdomainname(char *, int); // no declaration in header files!
 extern const char *atacmdnames_c_cvsid, *atacmds_c_cvsid, *ataprint_c_cvsid, *escalade_c_cvsid, 
                   *knowndrives_c_cvsid, *os_XXXX_c_cvsid, *scsicmds_c_cvsid, *utility_c_cvsid;
 
-static const char *filenameandversion="$Id: smartd.cpp,v 1.388 2007/04/17 21:10:59 chrfranke Exp $";
+static const char *filenameandversion="$Id: smartd.cpp,v 1.389 2007/05/13 14:33:33 guidog Exp $";
 #ifdef NEED_SOLARIS_ATA_CODE
 extern const char *os_solaris_ata_s_cvsid;
 #endif
 #ifdef _WIN32
 extern const char *daemon_win32_c_cvsid, *hostname_win32_c_cvsid, *syslog_win32_c_cvsid;
 #endif
-const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.388 2007/04/17 21:10:59 chrfranke Exp $" 
+const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.389 2007/05/13 14:33:33 guidog Exp $" 
 ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID
 #ifdef DAEMON_WIN32_H_CVSID
 DAEMON_WIN32_H_CVSID
@@ -3061,8 +3061,8 @@ int ParseToken(char *token,cfgfile *cfg){
               PrintOut(LOG_CRIT, "File %s line %d (drive %s): Directive -d cciss,N requires N integer\n",
                	       configfile, lineno, name);
               badarg=1;
-          } else if ( i<0 || i>15) {
-              PrintOut(LOG_CRIT, "File %s line %d (drive %s): Directive -d cciss,N (N=%d) must have 0 <= N <= 15\n",
+          } else if ( i<0 || i>127) {
+              PrintOut(LOG_CRIT, "File %s line %d (drive %s): Directive -d cciss,N (N=%d) must have 0 <= N <= 127\n",
                        configfile, lineno, name, i);
               badarg=1;
           } else {
-- 
GitLab