diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index 7f66d7e41fce5e0d785de87a4ef9fe068151208f..5865a5f877c311825b59dd2c288038f678aea2ac 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.758 2008/12/26 22:12:48 manfred99 Exp $ +$Id: CHANGELOG,v 1.759 2009/01/08 22:05:38 dpgilbert Exp $ The most recent version of this file is: http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup @@ -41,6 +41,13 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [DG] Accept half healthy (and half unhealthy) indication from the + SMART RETURN STATUS. This makes allowance for SAT implementations + (e.g. via USB) that truncate the SCSI sense buffer to 18 bytes. + This truncation causes the SMART RETURN STATUS indication to be + half health or unhealthy. If the half indication is used, then + warn if '-r ioctl' is given. + [MS] knowndrives.cpp updates: - Added Apple SSD - Added Seagate U8 family diff --git a/sm5/atacmds.cpp b/sm5/atacmds.cpp index e24a75ba26409153a4f3e226c048dbe678b5a17d..accfa9f5f3a09f4a354b4dd4e86ad10bb17096d1 100644 --- a/sm5/atacmds.cpp +++ b/sm5/atacmds.cpp @@ -39,7 +39,7 @@ #include <algorithm> // std::sort -const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.209 2008/10/24 21:43:12 manfred99 Exp $" +const char *atacmds_c_cvsid="$Id: atacmds.cpp,v 1.210 2009/01/08 22:05:38 dpgilbert Exp $" ATACMDS_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSIATA_H_CVSID UTILITY_H_CVSID; // for passing global control variables @@ -48,6 +48,13 @@ extern smartmonctrl *con; #define SMART_CYL_LOW 0x4F #define SMART_CYL_HI 0xC2 +// SMART RETURN STATUS yields SMART_CYL_HI,SMART_CYL_LOW to indicate drive +// is healthy and SRET_STATUS_HI_EXCEEDED,SRET_STATUS_MID_EXCEEDED to +// indicate that a threshhold exceeded condition has been detected. +// Those values (byte pairs) are placed in ATA register "LBA 23:8". +#define SRET_STATUS_HI_EXCEEDED 0x2C +#define SRET_STATUS_MID_EXCEEDED 0xF4 + // These Drive Identity tables are taken from hdparm 5.2, and are also // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // that SMART was first added into the ATA/ATAPI-3 Standard with @@ -629,12 +636,24 @@ int smartcommandhandler(ata_device * device, smart_command_set command, int sele break; case STATUS_CHECK: // Cyl low and Cyl high unchanged means "Good SMART status" - if (out.out_regs.lba_high == SMART_CYL_HI && out.out_regs.lba_mid == SMART_CYL_LOW) + if ((out.out_regs.lba_high == SMART_CYL_HI) && + (out.out_regs.lba_mid == SMART_CYL_LOW)) retval = 0; // These values mean "Bad SMART status" - else if (out.out_regs.lba_high == 0x2c && out.out_regs.lba_mid == 0xf4) + else if ((out.out_regs.lba_high == SRET_STATUS_HI_EXCEEDED) && + (out.out_regs.lba_mid == SRET_STATUS_MID_EXCEEDED)) + retval = 1; + else if (out.out_regs.lba_mid == SMART_CYL_LOW) { + retval = 0; + if (con->reportataioctl) + pout("SMART STATUS RETURN: half healthy response sequence, " + "probable SAT/USB truncation\n"); + } else if (out.out_regs.lba_mid == SRET_STATUS_MID_EXCEEDED) { retval = 1; - else { + if (con->reportataioctl) + pout("SMART STATUS RETURN: half unhealthy response sequence, " + "probable SAT/USB truncation\n"); + } else { // We haven't gotten output that makes sense; print out some debugging info pout("Error SMART Status command failed\n" "Please get assistance from %s\n", PACKAGE_HOMEPAGE);