From 4d766f338fd822a9cc99d37a07d840ec89f96925 Mon Sep 17 00:00:00 2001 From: samm2 <samm2@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Thu, 8 Oct 2009 10:32:40 +0000 Subject: [PATCH] Linux: Fixed IDE drives support on megaraid device (see ticket #15) git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2948 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/CHANGELOG | 2 ++ smartmontools/os_linux.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG index 9930001e2..20076c515 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: Fixed IDE drives support on megaraid device (see ticket #15). + [AS] FreeBSD: Removed all old detection code, moving everything to the objects. Now we are using CAM/ATA enumerators to guess device type. diff --git a/smartmontools/os_linux.cpp b/smartmontools/os_linux.cpp index 98ffceee2..3bb16ddef 100644 --- a/smartmontools/os_linux.cpp +++ b/smartmontools/os_linux.cpp @@ -1044,6 +1044,16 @@ bool linux_megaraid_device::scsi_pass_through(scsi_cmnd_io *iop) return true; if (iop->cmnd[0] == 0x85 && iop->cmnd[1] == 0x06) { pout("Rejecting SMART/ATA command to controller\n"); + // Emulate SMART STATUS CHECK drive reply + // smartctl fail to work without this + if(iop->cmnd[2]==0x2c) { + iop->resp_sense_len=22; + iop->sensep[0]=0x72; // response code + iop->sensep[7]=0x0e; // no idea what it is, copied from sat device answer + iop->sensep[8]=0x09; // + iop->sensep[17]=0x4f; // lm + iop->sensep[19]=0xc2; // lh + } return true; } -- GitLab