1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Hardware/HDD/HDDGeneric.cs Sat Dec 31 17:31:04 2011 +0000
1.3 @@ -0,0 +1,123 @@
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 + Roland Reinl <roland-reinl@gmx.de>.
1.22 + Portions created by the Initial Developer are Copyright (C) 2011
1.23 + the Initial Developer. All Rights Reserved.
1.24 +
1.25 + Contributor(s):
1.26 + Paul Werelds
1.27 + Michael Möller <m.moeller@gmx.ch>
1.28 +
1.29 + Alternatively, the contents of this file may be used under the terms of
1.30 + either the GNU General Public License Version 2 or later (the "GPL"), or
1.31 + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1.32 + in which case the provisions of the GPL or the LGPL are applicable instead
1.33 + of those above. If you wish to allow use of your version of this file only
1.34 + under the terms of either the GPL or the LGPL, and not to allow others to
1.35 + use your version of this file under the terms of the MPL, indicate your
1.36 + decision by deleting the provisions above and replace them with the notice
1.37 + and other provisions required by the GPL or the LGPL. If you do not delete
1.38 + the provisions above, a recipient may use your version of this file under
1.39 + the terms of any one of the MPL, the GPL or the LGPL.
1.40 +
1.41 +*/
1.42 +
1.43 +using System;
1.44 +using System.Collections.Generic;
1.45 +using System.Text;
1.46 +
1.47 +namespace OpenHardwareMonitor.Hardware.HDD {
1.48 +
1.49 + [NamePrefix("")]
1.50 + internal class GenericHarddisk : AbstractHarddrive {
1.51 +
1.52 + private static readonly List<SmartAttribute> smartAttributes =
1.53 + new List<SmartAttribute> {
1.54 + new SmartAttribute(0x01, SmartAttributeNames.ReadErrorRate),
1.55 + new SmartAttribute(0x02, SmartAttributeNames.ThroughputPerformance),
1.56 + new SmartAttribute(0x03, SmartAttributeNames.SpinUpTime),
1.57 + new SmartAttribute(0x04, SmartAttributeNames.StartStopCount, RawToInt),
1.58 + new SmartAttribute(0x05, SmartAttributeNames.ReallocatedSectorsCount),
1.59 + new SmartAttribute(0x06, SmartAttributeNames.ReadChannelMargin),
1.60 + new SmartAttribute(0x07, SmartAttributeNames.SeekErrorRate),
1.61 + new SmartAttribute(0x08, SmartAttributeNames.SeekTimePerformance),
1.62 + new SmartAttribute(0x09, SmartAttributeNames.PowerOnHours, RawToInt),
1.63 + new SmartAttribute(0x0A, SmartAttributeNames.SpinRetryCount),
1.64 + new SmartAttribute(0x0B, SmartAttributeNames.RecalibrationRetries),
1.65 + new SmartAttribute(0x0C, SmartAttributeNames.PowerCycleCount, RawToInt),
1.66 + new SmartAttribute(0x0D, SmartAttributeNames.SoftReadErrorRate),
1.67 + new SmartAttribute(0xAA, SmartAttributeNames.Unknown),
1.68 + new SmartAttribute(0xAB, SmartAttributeNames.Unknown),
1.69 + new SmartAttribute(0xAC, SmartAttributeNames.Unknown),
1.70 + new SmartAttribute(0xB7, SmartAttributeNames.SataDownshiftErrorCount),
1.71 + new SmartAttribute(0xB8, SmartAttributeNames.EndToEndError),
1.72 + new SmartAttribute(0xB9, SmartAttributeNames.HeadStability),
1.73 + new SmartAttribute(0xBA, SmartAttributeNames.InducedOpVibrationDetection),
1.74 + new SmartAttribute(0xBB, SmartAttributeNames.ReportedUncorrectableErrors),
1.75 + new SmartAttribute(0xBC, SmartAttributeNames.CommandTimeout),
1.76 + new SmartAttribute(0xBD, SmartAttributeNames.HighFlyWrites),
1.77 + new SmartAttribute(0xBF, SmartAttributeNames.GSenseErrorRate),
1.78 + new SmartAttribute(0xC0, SmartAttributeNames.EmergencyRetractCycleCount),
1.79 + new SmartAttribute(0xC1, SmartAttributeNames.LoadCycleCount),
1.80 + new SmartAttribute(0xC3, SmartAttributeNames.HardwareEccRecovered),
1.81 + new SmartAttribute(0xC4, SmartAttributeNames.ReallocationEventCount),
1.82 + new SmartAttribute(0xC5, SmartAttributeNames.CurrentPendingSectorCount),
1.83 + new SmartAttribute(0xC6, SmartAttributeNames.UncorrectableSectorCount),
1.84 + new SmartAttribute(0xC7, SmartAttributeNames.UltraDmaCrcErrorCount),
1.85 + new SmartAttribute(0xC8, SmartAttributeNames.WriteErrorRate),
1.86 + new SmartAttribute(0xCA, SmartAttributeNames.DataAddressMarkErrors),
1.87 + new SmartAttribute(0xCB, SmartAttributeNames.RunOutCancel),
1.88 + new SmartAttribute(0xCC, SmartAttributeNames.SoftEccCorrection),
1.89 + new SmartAttribute(0xCD, SmartAttributeNames.ThermalAsperityRate),
1.90 + new SmartAttribute(0xCE, SmartAttributeNames.FlyingHeight),
1.91 + new SmartAttribute(0xCF, SmartAttributeNames.SpinHighCurrent),
1.92 + new SmartAttribute(0xD0, SmartAttributeNames.SpinBuzz),
1.93 + new SmartAttribute(0xD1, SmartAttributeNames.OfflineSeekPerformance),
1.94 + new SmartAttribute(0xD3, SmartAttributeNames.VibrationDuringWrite),
1.95 + new SmartAttribute(0xD4, SmartAttributeNames.ShockDuringWrite),
1.96 + new SmartAttribute(0xDC, SmartAttributeNames.DiskShift),
1.97 + new SmartAttribute(0xDD, SmartAttributeNames.AlternativeGSenseErrorRate),
1.98 + new SmartAttribute(0xDE, SmartAttributeNames.LoadedHours),
1.99 + new SmartAttribute(0xDF, SmartAttributeNames.LoadUnloadRetryCount),
1.100 + new SmartAttribute(0xE0, SmartAttributeNames.LoadFriction),
1.101 + new SmartAttribute(0xE1, SmartAttributeNames.LoadUnloadCycleCount),
1.102 + new SmartAttribute(0xE2, SmartAttributeNames.LoadInTime),
1.103 + new SmartAttribute(0xE3, SmartAttributeNames.TorqueAmplificationCount),
1.104 + new SmartAttribute(0xE4, SmartAttributeNames.PowerOffRetractCycle),
1.105 + new SmartAttribute(0xE6, SmartAttributeNames.GmrHeadAmplitude),
1.106 + new SmartAttribute(0xE8, SmartAttributeNames.EnduranceRemaining),
1.107 + new SmartAttribute(0xE9, SmartAttributeNames.PowerOnHours),
1.108 + new SmartAttribute(0xF0, SmartAttributeNames.HeadFlyingHours),
1.109 + new SmartAttribute(0xF1, SmartAttributeNames.TotalLbasWritten),
1.110 + new SmartAttribute(0xF2, SmartAttributeNames.TotalLbasRead),
1.111 + new SmartAttribute(0xFA, SmartAttributeNames.ReadErrorRetryRate),
1.112 + new SmartAttribute(0xFE, SmartAttributeNames.FreeFallProtection),
1.113 +
1.114 + new SmartAttribute(0xC2, SmartAttributeNames.Temperature,
1.115 + (byte[] r, byte v) => { return r[0]; }, SensorType.Temperature, 0),
1.116 + new SmartAttribute(0xE7, SmartAttributeNames.Temperature,
1.117 + (byte[] r, byte v) => { return r[0]; }, SensorType.Temperature, 0),
1.118 + new SmartAttribute(0xBE, SmartAttributeNames.TemperatureDifferenceFrom100,
1.119 + null, SensorType.Temperature, 0)
1.120 + };
1.121 +
1.122 + public GenericHarddisk(ISmart smart, string name, int index,
1.123 + ISettings settings)
1.124 + : base(smart, name, index, smartAttributes, settings) { }
1.125 + }
1.126 +}