From ac5a861c13db54f56a7255d87397de0b36dc075e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Tue, 25 Jun 2013 20:34:29 +0000 Subject: [PATCH] Added support for new Samsung SSDs (like Samsung SSD 840 PRO). --- Hardware/HDD/DebugSmart.cs | 20 ++++++++++++++++++-- Hardware/HDD/SSDSamsung.cs | 22 ++++++++++++++++------ Hardware/HDD/SmartNames.cs | 10 +++++++++- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/Hardware/HDD/DebugSmart.cs b/Hardware/HDD/DebugSmart.cs index 9140e78..217851f 100644 --- a/Hardware/HDD/DebugSmart.cs +++ b/Hardware/HDD/DebugSmart.cs @@ -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 @@ namespace OpenHardwareMonitor.Hardware.HDD { 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 --git a/Hardware/HDD/SSDSamsung.cs b/Hardware/HDD/SSDSamsung.cs index 72b737a..a571d47 100644 --- a/Hardware/HDD/SSDSamsung.cs +++ b/Hardware/HDD/SSDSamsung.cs @@ -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 @@ namespace OpenHardwareMonitor.Hardware.HDD { 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 --git a/Hardware/HDD/SmartNames.cs b/Hardware/HDD/SmartNames.cs index d934f54..8a69529 100644 --- a/Hardware/HDD/SmartNames.cs +++ b/Hardware/HDD/SmartNames.cs @@ -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 @@ namespace OpenHardwareMonitor.Hardware.HDD { 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