Hardware/HDD/SSDSamsung.cs
changeset 328 f837f9f0973e
child 344 3145aadca3d2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Hardware/HDD/SSDSamsung.cs	Mon Jan 02 18:44:19 2012 +0000
     1.3 @@ -0,0 +1,77 @@
     1.4 +/*
     1.5 +  
     1.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
     1.7 +
     1.8 +  The contents of this file are subject to the Mozilla Public License Version
     1.9 +  1.1 (the "License"); you may not use this file except in compliance with
    1.10 +  the License. You may obtain a copy of the License at
    1.11 + 
    1.12 +  http://www.mozilla.org/MPL/
    1.13 +
    1.14 +  Software distributed under the License is distributed on an "AS IS" basis,
    1.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    1.16 +  for the specific language governing rights and limitations under the License.
    1.17 +
    1.18 +  The Original Code is the Open Hardware Monitor code.
    1.19 +
    1.20 +  The Initial Developer of the Original Code is 
    1.21 +  Michael Möller <m.moeller@gmx.ch>.
    1.22 +  Portions created by the Initial Developer are Copyright (C) 2012
    1.23 +  the Initial Developer. All Rights Reserved.
    1.24 +
    1.25 +  Contributor(s):
    1.26 +
    1.27 +  Alternatively, the contents of this file may be used under the terms of
    1.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
    1.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    1.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
    1.31 +  of those above. If you wish to allow use of your version of this file only
    1.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
    1.33 +  use your version of this file under the terms of the MPL, indicate your
    1.34 +  decision by deleting the provisions above and replace them with the notice
    1.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
    1.36 +  the provisions above, a recipient may use your version of this file under
    1.37 +  the terms of any one of the MPL, the GPL or the LGPL.
    1.38 + 
    1.39 +*/
    1.40 +
    1.41 +namespace OpenHardwareMonitor.Hardware.HDD {
    1.42 +  using System.Collections.Generic;
    1.43 +
    1.44 +  [NamePrefix(""), RequireSmart(0xB0), RequireSmart(0xB1), RequireSmart(0xB2), 
    1.45 +    RequireSmart(0xB3), RequireSmart(0xB4), RequireSmart(0xB5), 
    1.46 +    RequireSmart(0xB6), RequireSmart(0xB7)]
    1.47 +  internal class SSDSamsung : AbstractHarddrive {
    1.48 +
    1.49 +    private static readonly IEnumerable<SmartAttribute> smartAttributes =
    1.50 +      new List<SmartAttribute> {
    1.51 +      new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt),
    1.52 +      new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt),
    1.53 +      new SmartAttribute(0xAF, SmartNames.ProgramFailCountChip, RawToInt),
    1.54 +      new SmartAttribute(0xB0, SmartNames.EraseFailCountChip, RawToInt),
    1.55 +      new SmartAttribute(0xB1, SmartNames.WearLevelingCount, RawToInt),
    1.56 +      new SmartAttribute(0xB2, SmartNames.UsedReservedBlockCountChip, RawToInt),
    1.57 +      new SmartAttribute(0xB3, SmartNames.UsedReservedBlockCountTotal, RawToInt),
    1.58 +
    1.59 +      // Unused Reserved Block Count (Total)
    1.60 +      new SmartAttribute(0xB4, SmartNames.RemainingLife,
    1.61 +        null, SensorType.Level, 0),
    1.62 +      
    1.63 +      new SmartAttribute(0xB5, SmartNames.ProgramFailCountTotal, RawToInt),
    1.64 +      new SmartAttribute(0xB6, SmartNames.EraseFailCountTotal, RawToInt),
    1.65 +      new SmartAttribute(0xB7, SmartNames.RuntimeBadBlockTotal, RawToInt),
    1.66 +      new SmartAttribute(0xBB, SmartNames.UncorrectableErrorCount, RawToInt),
    1.67 +      new SmartAttribute(0xBE, SmartNames.TemperatureExceedCount, RawToInt),
    1.68 +      new SmartAttribute(0xC2, SmartNames.AirflowTemperature),
    1.69 +      new SmartAttribute(0xC3, SmartNames.ECCRate),
    1.70 +      new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt),
    1.71 +      new SmartAttribute(0xC7, SmartNames.CRCErrorCount, RawToInt),
    1.72 +      new SmartAttribute(0xC9, SmartNames.SupercapStatus),
    1.73 +      new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus)
    1.74 +    };
    1.75 +
    1.76 +    public SSDSamsung(ISmart smart, string name, string firmwareRevision,
    1.77 +      int index, ISettings settings)
    1.78 +      : base(smart, name, firmwareRevision, index, smartAttributes, settings) { }
    1.79 +  }
    1.80 +}