From ad61257887358bae4f276b5b080ea84d7d067153 Mon Sep 17 00:00:00 2001
From: samm2 <samm2@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Thu, 8 Oct 2009 14:36:53 +0000
Subject: [PATCH] Linux: Autodetect DELL PERC controller.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2950 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/CHANGELOG    | 2 ++
 smartmontools/os_linux.cpp | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG
index 00f794038..b506d428c 100644
--- a/smartmontools/CHANGELOG
+++ b/smartmontools/CHANGELOG
@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [AS] Linux: Autodetect DELL PERC controller.
+
   [AS] Linux: Fixed SATA drives support on megaraid device (see ticket #15).
 
   [AS] FreeBSD: Removed all old detection code, moving everything to
diff --git a/smartmontools/os_linux.cpp b/smartmontools/os_linux.cpp
index 3bb16ddef..f5b0a387d 100644
--- a/smartmontools/os_linux.cpp
+++ b/smartmontools/os_linux.cpp
@@ -2676,7 +2676,13 @@ smart_device * linux_scsi_device::autodetect_open()
                       "you may need to replace %s with /dev/twaN or /dev/tweN", get_dev_name());
       return this;
     }
-
+    // DELL?
+    if (!memcmp(req_buff + 8, "DELL    PERC", 12)) {
+      close();
+      set_err(EINVAL, "DELL controller, please try adding '-d megaraid,N'");
+      return this;
+    }
+    
     // Marvell ?
     if (len >= 42 && !memcmp(req_buff + 36, "MVSATA", 6)) {
       //pout("Device %s: using '-d marvell' for ATA disk with Marvell driver\n", get_dev_name());
-- 
GitLab