# HG changeset patch # User moel.mich # Date 1372192469 0 # Node ID 3890d78140c23a582c81e51edd0378e7b35dfe8d # Parent 8eeac521b3b6f14aa1d8a8354b597329205bebd8 Added support for new Samsung SSDs (like Samsung SSD 840 PRO). diff -r 8eeac521b3b6 -r 3890d78140c2 Hardware/HDD/DebugSmart.cs --- a/Hardware/HDD/DebugSmart.cs Sun Jun 23 19:10:28 2013 +0000 +++ b/Hardware/HDD/DebugSmart.cs Tue Jun 25 20:34:29 2013 +0000 @@ -4,7 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - Copyright (C) 2011-2012 Michael Möller + Copyright (C) 2011-2013 Michael Möller */ @@ -313,7 +313,23 @@ C6 000000000000 100 100 1 C7 000000000000 100 100 1 CA 010000000000 99 99 1 - CE 000000000000 100 100 1 ")}; + CE 000000000000 100 100 1 "), + + new Drive("Samsung SSD 840 PRO Series", "DXM05B0Q", 16, + @"05 000000000000 100 100 10 + 09 260000000000 99 99 0 + 0C 170000000000 99 99 0 + B1 010000000000 99 99 0 + B3 000000000000 100 100 10 + B5 000000000000 100 100 10 + B6 000000000000 100 100 10 + B7 000000000000 100 100 10 + BB 000000000000 100 100 0 + BE 190000000000 60 75 0 + C3 000000000000 200 200 0 + C7 000000000000 100 100 0 + EB 030000000000 99 99 0 + F1 8FF425100000 99 99 0")}; public IntPtr OpenDrive(int driveNumber) { if (driveNumber < drives.Length) diff -r 8eeac521b3b6 -r 3890d78140c2 Hardware/HDD/SSDSamsung.cs --- a/Hardware/HDD/SSDSamsung.cs Sun Jun 23 19:10:28 2013 +0000 +++ b/Hardware/HDD/SSDSamsung.cs Tue Jun 25 20:34:29 2013 +0000 @@ -4,20 +4,22 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - Copyright (C) 2012 Michael Möller + Copyright (C) 2012-2013 Michael Möller */ namespace OpenHardwareMonitor.Hardware.HDD { using System.Collections.Generic; + using OpenHardwareMonitor.Collections; - [NamePrefix(""), RequireSmart(0xB0), RequireSmart(0xB1), RequireSmart(0xB2), - RequireSmart(0xB3), RequireSmart(0xB4), RequireSmart(0xB5), - RequireSmart(0xB6), RequireSmart(0xB7)] + [NamePrefix(""), RequireSmart(0xB1), RequireSmart(0xB3), RequireSmart(0xB5), + RequireSmart(0xB6), RequireSmart(0xB7), RequireSmart(0xBB), + RequireSmart(0xC3), RequireSmart(0xC7)] internal class SSDSamsung : AbstractHarddrive { private static readonly IEnumerable smartAttributes = new List { + new SmartAttribute(0x05, SmartNames.ReallocatedSectorsCount), new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt), new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt), new SmartAttribute(0xAF, SmartNames.ProgramFailCountChip, RawToInt), @@ -34,13 +36,21 @@ new SmartAttribute(0xB6, SmartNames.EraseFailCountTotal, RawToInt), new SmartAttribute(0xB7, SmartNames.RuntimeBadBlockTotal, RawToInt), new SmartAttribute(0xBB, SmartNames.UncorrectableErrorCount, RawToInt), - new SmartAttribute(0xBE, SmartNames.TemperatureExceedCount, RawToInt), + new SmartAttribute(0xBE, SmartNames.Temperature, + (byte[] r, byte v, IReadOnlyArray p) + => { return r[0] + (p == null ? 0 : p[0].Value); }, + SensorType.Temperature, 0, false, + new[] { new ParameterDescription("Offset [°C]", + "Temperature offset of the thermal sensor.\n" + + "Temperature = Value + Offset.", 0) }), new SmartAttribute(0xC2, SmartNames.AirflowTemperature), new SmartAttribute(0xC3, SmartNames.ECCRate), new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt), new SmartAttribute(0xC7, SmartNames.CRCErrorCount, RawToInt), new SmartAttribute(0xC9, SmartNames.SupercapStatus), - new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus) + new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus), + new SmartAttribute(0xEB, SmartNames.PowerRecoveryCount), + new SmartAttribute(0xF1, SmartNames.TotalLBAWritten) }; public SSDSamsung(ISmart smart, string name, string firmwareRevision, diff -r 8eeac521b3b6 -r 3890d78140c2 Hardware/HDD/SmartNames.cs --- a/Hardware/HDD/SmartNames.cs Sun Jun 23 19:10:28 2013 +0000 +++ b/Hardware/HDD/SmartNames.cs Tue Jun 25 20:34:29 2013 +0000 @@ -4,7 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - Copyright (C) 2011-2012 Michael Möller + Copyright (C) 2011-2013 Michael Möller Copyright (C) 2011 Roland Reinl */ @@ -490,5 +490,13 @@ public static string FactoryBadBlockCount { get { return "Factory Bad Block Count"; } } + + public static string PowerRecoveryCount { + get { return "Power Recovery Count"; } + } + + public static string TotalLBAWritten { + get { return "Total LBA Written"; } + } } } \ No newline at end of file