Hardware/HDD/SSDSamsung.cs
author moel.mich
Tue, 14 Feb 2012 23:07:55 +0000
changeset 340 600962f8a298
child 344 3145aadca3d2
permissions -rw-r--r--
Added a new sensor type "Factor" for dimensionless values (and similar) that are not to be shown as percent ("Level" type). Changed the write amplification sensor to use the new "Factor" sensor type. Added the temperature SMART attribute for Sandforce SSDs as hidden sensor (as it may show fake results on some hardware).
moel@328
     1
/*
moel@328
     2
  
moel@328
     3
  Version: MPL 1.1/GPL 2.0/LGPL 2.1
moel@328
     4
moel@328
     5
  The contents of this file are subject to the Mozilla Public License Version
moel@328
     6
  1.1 (the "License"); you may not use this file except in compliance with
moel@328
     7
  the License. You may obtain a copy of the License at
moel@328
     8
 
moel@328
     9
  http://www.mozilla.org/MPL/
moel@328
    10
moel@328
    11
  Software distributed under the License is distributed on an "AS IS" basis,
moel@328
    12
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
moel@328
    13
  for the specific language governing rights and limitations under the License.
moel@328
    14
moel@328
    15
  The Original Code is the Open Hardware Monitor code.
moel@328
    16
moel@328
    17
  The Initial Developer of the Original Code is 
moel@328
    18
  Michael Möller <m.moeller@gmx.ch>.
moel@328
    19
  Portions created by the Initial Developer are Copyright (C) 2012
moel@328
    20
  the Initial Developer. All Rights Reserved.
moel@328
    21
moel@328
    22
  Contributor(s):
moel@328
    23
moel@328
    24
  Alternatively, the contents of this file may be used under the terms of
moel@328
    25
  either the GNU General Public License Version 2 or later (the "GPL"), or
moel@328
    26
  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
moel@328
    27
  in which case the provisions of the GPL or the LGPL are applicable instead
moel@328
    28
  of those above. If you wish to allow use of your version of this file only
moel@328
    29
  under the terms of either the GPL or the LGPL, and not to allow others to
moel@328
    30
  use your version of this file under the terms of the MPL, indicate your
moel@328
    31
  decision by deleting the provisions above and replace them with the notice
moel@328
    32
  and other provisions required by the GPL or the LGPL. If you do not delete
moel@328
    33
  the provisions above, a recipient may use your version of this file under
moel@328
    34
  the terms of any one of the MPL, the GPL or the LGPL.
moel@328
    35
 
moel@328
    36
*/
moel@328
    37
moel@328
    38
namespace OpenHardwareMonitor.Hardware.HDD {
moel@328
    39
  using System.Collections.Generic;
moel@328
    40
moel@328
    41
  [NamePrefix(""), RequireSmart(0xB0), RequireSmart(0xB1), RequireSmart(0xB2), 
moel@328
    42
    RequireSmart(0xB3), RequireSmart(0xB4), RequireSmart(0xB5), 
moel@328
    43
    RequireSmart(0xB6), RequireSmart(0xB7)]
moel@328
    44
  internal class SSDSamsung : AbstractHarddrive {
moel@328
    45
moel@328
    46
    private static readonly IEnumerable<SmartAttribute> smartAttributes =
moel@328
    47
      new List<SmartAttribute> {
moel@328
    48
      new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt),
moel@328
    49
      new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt),
moel@328
    50
      new SmartAttribute(0xAF, SmartNames.ProgramFailCountChip, RawToInt),
moel@328
    51
      new SmartAttribute(0xB0, SmartNames.EraseFailCountChip, RawToInt),
moel@328
    52
      new SmartAttribute(0xB1, SmartNames.WearLevelingCount, RawToInt),
moel@328
    53
      new SmartAttribute(0xB2, SmartNames.UsedReservedBlockCountChip, RawToInt),
moel@328
    54
      new SmartAttribute(0xB3, SmartNames.UsedReservedBlockCountTotal, RawToInt),
moel@328
    55
moel@328
    56
      // Unused Reserved Block Count (Total)
moel@328
    57
      new SmartAttribute(0xB4, SmartNames.RemainingLife,
moel@328
    58
        null, SensorType.Level, 0),
moel@328
    59
      
moel@328
    60
      new SmartAttribute(0xB5, SmartNames.ProgramFailCountTotal, RawToInt),
moel@328
    61
      new SmartAttribute(0xB6, SmartNames.EraseFailCountTotal, RawToInt),
moel@328
    62
      new SmartAttribute(0xB7, SmartNames.RuntimeBadBlockTotal, RawToInt),
moel@328
    63
      new SmartAttribute(0xBB, SmartNames.UncorrectableErrorCount, RawToInt),
moel@328
    64
      new SmartAttribute(0xBE, SmartNames.TemperatureExceedCount, RawToInt),
moel@328
    65
      new SmartAttribute(0xC2, SmartNames.AirflowTemperature),
moel@328
    66
      new SmartAttribute(0xC3, SmartNames.ECCRate),
moel@328
    67
      new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt),
moel@328
    68
      new SmartAttribute(0xC7, SmartNames.CRCErrorCount, RawToInt),
moel@328
    69
      new SmartAttribute(0xC9, SmartNames.SupercapStatus),
moel@328
    70
      new SmartAttribute(0xCA, SmartNames.ExceptionModeStatus)
moel@328
    71
    };
moel@328
    72
moel@328
    73
    public SSDSamsung(ISmart smart, string name, string firmwareRevision,
moel@328
    74
      int index, ISettings settings)
moel@328
    75
      : base(smart, name, firmwareRevision, index, smartAttributes, settings) { }
moel@328
    76
  }
moel@328
    77
}