Added support for new Samsung SSDs (like Samsung SSD 840 PRO).
authormoel.mich
Tue, 25 Jun 2013 20:34:29 +0000
changeset 4063890d78140c2
parent 405 8eeac521b3b6
child 407 c9dfdbd59bf8
Added support for new Samsung SSDs (like Samsung SSD 840 PRO).
Hardware/HDD/DebugSmart.cs
Hardware/HDD/SSDSamsung.cs
Hardware/HDD/SmartNames.cs
     1.1 --- a/Hardware/HDD/DebugSmart.cs	Sun Jun 23 19:10:28 2013 +0000
     1.2 +++ b/Hardware/HDD/DebugSmart.cs	Tue Jun 25 20:34:29 2013 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4    License, v. 2.0. If a copy of the MPL was not distributed with this
     1.5    file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.6   
     1.7 -  Copyright (C) 2011-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
     1.8 +  Copyright (C) 2011-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
     1.9  	
    1.10  */
    1.11  
    1.12 @@ -313,7 +313,23 @@
    1.13              C6 000000000000 100 100 1  
    1.14              C7 000000000000 100 100 1  
    1.15              CA 010000000000 99  99  1  
    1.16 -            CE 000000000000 100 100 1 ")};
    1.17 +            CE 000000000000 100 100 1 "),
    1.18 +
    1.19 +        new Drive("Samsung SSD 840 PRO Series", "DXM05B0Q", 16,
    1.20 +          @"05 000000000000 100 100 10 
    1.21 +            09 260000000000 99  99  0  
    1.22 +            0C 170000000000 99  99  0  
    1.23 +            B1 010000000000 99  99  0  
    1.24 +            B3 000000000000 100 100 10 
    1.25 +            B5 000000000000 100 100 10 
    1.26 +            B6 000000000000 100 100 10 
    1.27 +            B7 000000000000 100 100 10 
    1.28 +            BB 000000000000 100 100 0  
    1.29 +            BE 190000000000 60  75  0  
    1.30 +            C3 000000000000 200 200 0  
    1.31 +            C7 000000000000 100 100 0  
    1.32 +            EB 030000000000 99  99  0  
    1.33 +            F1 8FF425100000 99  99  0")};
    1.34  
    1.35      public IntPtr OpenDrive(int driveNumber) {
    1.36        if (driveNumber < drives.Length)
     2.1 --- a/Hardware/HDD/SSDSamsung.cs	Sun Jun 23 19:10:28 2013 +0000
     2.2 +++ b/Hardware/HDD/SSDSamsung.cs	Tue Jun 25 20:34:29 2013 +0000
     2.3 @@ -4,20 +4,22 @@
     2.4    License, v. 2.0. If a copy of the MPL was not distributed with this
     2.5    file, You can obtain one at http://mozilla.org/MPL/2.0/.
     2.6   
     2.7 -  Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
     2.8 +  Copyright (C) 2012-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
     2.9  	
    2.10  */
    2.11  
    2.12  namespace OpenHardwareMonitor.Hardware.HDD {
    2.13    using System.Collections.Generic;
    2.14 +  using OpenHardwareMonitor.Collections;
    2.15  
    2.16 -  [NamePrefix(""), RequireSmart(0xB0), RequireSmart(0xB1), RequireSmart(0xB2), 
    2.17 -    RequireSmart(0xB3), RequireSmart(0xB4), RequireSmart(0xB5), 
    2.18 -    RequireSmart(0xB6), RequireSmart(0xB7)]
    2.19 +  [NamePrefix(""), RequireSmart(0xB1), RequireSmart(0xB3), RequireSmart(0xB5),
    2.20 +    RequireSmart(0xB6), RequireSmart(0xB7), RequireSmart(0xBB), 
    2.21 +    RequireSmart(0xC3), RequireSmart(0xC7)]
    2.22    internal class SSDSamsung : AbstractHarddrive {
    2.23  
    2.24      private static readonly IEnumerable<SmartAttribute> smartAttributes =
    2.25        new List<SmartAttribute> {
    2.26 +      new SmartAttribute(0x05, SmartNames.ReallocatedSectorsCount),
    2.27        new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt),
    2.28        new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt),
    2.29        new SmartAttribute(0xAF, SmartNames.ProgramFailCountChip, RawToInt),
    2.30 @@ -34,13 +36,21 @@
    2.31        new SmartAttribute(0xB6, SmartNames.EraseFailCountTotal, RawToInt),
    2.32        new SmartAttribute(0xB7, SmartNames.RuntimeBadBlockTotal, RawToInt),
    2.33        new SmartAttribute(0xBB, SmartNames.UncorrectableErrorCount, RawToInt),
    2.34 -      new SmartAttribute(0xBE, SmartNames.TemperatureExceedCount, RawToInt),
    2.35 +      new SmartAttribute(0xBE, SmartNames.Temperature, 
    2.36 +        (byte[] r, byte v, IReadOnlyArray<IParameter> p) 
    2.37 +          => { return r[0] + (p == null ? 0 : p[0].Value); }, 
    2.38 +          SensorType.Temperature, 0, false, 
    2.39 +        new[] { new ParameterDescription("Offset [°C]", 
    2.40 +                  "Temperature offset of the thermal sensor.\n" + 
    2.41 +                  "Temperature = Value + Offset.", 0) }),
    2.42        new SmartAttribute(0xC2, SmartNames.AirflowTemperature),
    2.43        new SmartAttribute(0xC3, SmartNames.ECCRate),
    2.44        new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt),
    2.45        new SmartAttribute(0xC7, SmartNames.CRCErrorCount, RawToInt),
    2.46        new SmartAttribute(0xC9, SmartNames.SupercapStatus),
    2.47 -      new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus)
    2.48 +      new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus),
    2.49 +      new SmartAttribute(0xEB, SmartNames.PowerRecoveryCount),
    2.50 +      new SmartAttribute(0xF1, SmartNames.TotalLBAWritten)
    2.51      };
    2.52  
    2.53      public SSDSamsung(ISmart smart, string name, string firmwareRevision,
     3.1 --- a/Hardware/HDD/SmartNames.cs	Sun Jun 23 19:10:28 2013 +0000
     3.2 +++ b/Hardware/HDD/SmartNames.cs	Tue Jun 25 20:34:29 2013 +0000
     3.3 @@ -4,7 +4,7 @@
     3.4    License, v. 2.0. If a copy of the MPL was not distributed with this
     3.5    file, You can obtain one at http://mozilla.org/MPL/2.0/.
     3.6   
     3.7 -  Copyright (C) 2011-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
     3.8 +  Copyright (C) 2011-2013 Michael Möller <mmoeller@openhardwaremonitor.org>
     3.9    Copyright (C) 2011 Roland Reinl <roland-reinl@gmx.de>
    3.10  	
    3.11  */
    3.12 @@ -490,5 +490,13 @@
    3.13      public static string FactoryBadBlockCount {
    3.14        get { return "Factory Bad Block Count"; }
    3.15      }
    3.16 +
    3.17 +    public static string PowerRecoveryCount {
    3.18 +      get { return "Power Recovery Count"; }
    3.19 +    }
    3.20 +
    3.21 +    public static string TotalLBAWritten {
    3.22 +      get { return "Total LBA Written"; }
    3.23 +    }
    3.24    }
    3.25  }
    3.26 \ No newline at end of file