Added SMART support for Samsung SSDs.
3 Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 The contents of this file are subject to the Mozilla Public License Version
6 1.1 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.mozilla.org/MPL/
11 Software distributed under the License is distributed on an "AS IS" basis,
12 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 for the specific language governing rights and limitations under the License.
15 The Original Code is the Open Hardware Monitor code.
17 The Initial Developer of the Original Code is
18 Roland Reinl <roland-reinl@gmx.de>.
19 Portions created by the Initial Developer are Copyright (C) 2011-2012
20 the Initial Developer. All Rights Reserved.
24 Michael Möller <m.moeller@gmx.ch>
26 Alternatively, the contents of this file may be used under the terms of
27 either the GNU General Public License Version 2 or later (the "GPL"), or
28 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 in which case the provisions of the GPL or the LGPL are applicable instead
30 of those above. If you wish to allow use of your version of this file only
31 under the terms of either the GPL or the LGPL, and not to allow others to
32 use your version of this file under the terms of the MPL, indicate your
33 decision by deleting the provisions above and replace them with the notice
34 and other provisions required by the GPL or the LGPL. If you do not delete
35 the provisions above, a recipient may use your version of this file under
36 the terms of any one of the MPL, the GPL or the LGPL.
41 using System.Collections.Generic;
44 namespace OpenHardwareMonitor.Hardware.HDD {
47 internal class GenericHarddisk : AbstractHarddrive {
49 private static readonly List<SmartAttribute> smartAttributes =
50 new List<SmartAttribute> {
51 new SmartAttribute(0x01, SmartNames.ReadErrorRate),
52 new SmartAttribute(0x02, SmartNames.ThroughputPerformance),
53 new SmartAttribute(0x03, SmartNames.SpinUpTime),
54 new SmartAttribute(0x04, SmartNames.StartStopCount, RawToInt),
55 new SmartAttribute(0x05, SmartNames.ReallocatedSectorsCount),
56 new SmartAttribute(0x06, SmartNames.ReadChannelMargin),
57 new SmartAttribute(0x07, SmartNames.SeekErrorRate),
58 new SmartAttribute(0x08, SmartNames.SeekTimePerformance),
59 new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt),
60 new SmartAttribute(0x0A, SmartNames.SpinRetryCount),
61 new SmartAttribute(0x0B, SmartNames.RecalibrationRetries),
62 new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt),
63 new SmartAttribute(0x0D, SmartNames.SoftReadErrorRate),
64 new SmartAttribute(0xAA, SmartNames.Unknown),
65 new SmartAttribute(0xAB, SmartNames.Unknown),
66 new SmartAttribute(0xAC, SmartNames.Unknown),
67 new SmartAttribute(0xB7, SmartNames.SataDownshiftErrorCount),
68 new SmartAttribute(0xB8, SmartNames.EndToEndError),
69 new SmartAttribute(0xB9, SmartNames.HeadStability),
70 new SmartAttribute(0xBA, SmartNames.InducedOpVibrationDetection),
71 new SmartAttribute(0xBB, SmartNames.ReportedUncorrectableErrors),
72 new SmartAttribute(0xBC, SmartNames.CommandTimeout),
73 new SmartAttribute(0xBD, SmartNames.HighFlyWrites),
74 new SmartAttribute(0xBF, SmartNames.GSenseErrorRate),
75 new SmartAttribute(0xC0, SmartNames.EmergencyRetractCycleCount),
76 new SmartAttribute(0xC1, SmartNames.LoadCycleCount),
77 new SmartAttribute(0xC3, SmartNames.HardwareEccRecovered),
78 new SmartAttribute(0xC4, SmartNames.ReallocationEventCount),
79 new SmartAttribute(0xC5, SmartNames.CurrentPendingSectorCount),
80 new SmartAttribute(0xC6, SmartNames.UncorrectableSectorCount),
81 new SmartAttribute(0xC7, SmartNames.UltraDmaCrcErrorCount),
82 new SmartAttribute(0xC8, SmartNames.WriteErrorRate),
83 new SmartAttribute(0xCA, SmartNames.DataAddressMarkErrors),
84 new SmartAttribute(0xCB, SmartNames.RunOutCancel),
85 new SmartAttribute(0xCC, SmartNames.SoftEccCorrection),
86 new SmartAttribute(0xCD, SmartNames.ThermalAsperityRate),
87 new SmartAttribute(0xCE, SmartNames.FlyingHeight),
88 new SmartAttribute(0xCF, SmartNames.SpinHighCurrent),
89 new SmartAttribute(0xD0, SmartNames.SpinBuzz),
90 new SmartAttribute(0xD1, SmartNames.OfflineSeekPerformance),
91 new SmartAttribute(0xD3, SmartNames.VibrationDuringWrite),
92 new SmartAttribute(0xD4, SmartNames.ShockDuringWrite),
93 new SmartAttribute(0xDC, SmartNames.DiskShift),
94 new SmartAttribute(0xDD, SmartNames.AlternativeGSenseErrorRate),
95 new SmartAttribute(0xDE, SmartNames.LoadedHours),
96 new SmartAttribute(0xDF, SmartNames.LoadUnloadRetryCount),
97 new SmartAttribute(0xE0, SmartNames.LoadFriction),
98 new SmartAttribute(0xE1, SmartNames.LoadUnloadCycleCount),
99 new SmartAttribute(0xE2, SmartNames.LoadInTime),
100 new SmartAttribute(0xE3, SmartNames.TorqueAmplificationCount),
101 new SmartAttribute(0xE4, SmartNames.PowerOffRetractCycle),
102 new SmartAttribute(0xE6, SmartNames.GmrHeadAmplitude),
103 new SmartAttribute(0xE8, SmartNames.EnduranceRemaining),
104 new SmartAttribute(0xE9, SmartNames.PowerOnHours),
105 new SmartAttribute(0xF0, SmartNames.HeadFlyingHours),
106 new SmartAttribute(0xF1, SmartNames.TotalLbasWritten),
107 new SmartAttribute(0xF2, SmartNames.TotalLbasRead),
108 new SmartAttribute(0xFA, SmartNames.ReadErrorRetryRate),
109 new SmartAttribute(0xFE, SmartNames.FreeFallProtection),
111 new SmartAttribute(0xC2, SmartNames.Temperature,
112 (byte[] r, byte v) => { return r[0]; }, SensorType.Temperature, 0),
113 new SmartAttribute(0xE7, SmartNames.Temperature,
114 (byte[] r, byte v) => { return r[0]; }, SensorType.Temperature, 0),
115 new SmartAttribute(0xBE, SmartNames.TemperatureDifferenceFrom100,
116 null, SensorType.Temperature, 0)
119 public GenericHarddisk(ISmart smart, string name, string firmwareRevision,
120 int index, ISettings settings)
121 : base(smart, name, firmwareRevision, index, smartAttributes, settings) {}