Hardware/HDD/SSDIndilinx.cs
author moel.mich
Mon, 02 Jan 2012 21:17:21 +0000
changeset 330 b2c6d350396d
parent 328 f837f9f0973e
child 344 3145aadca3d2
permissions -rw-r--r--
Further restricted the identification for Indilinx SSDs to prevent Maxtor HDDs to be identified as Indilinx SSD.
     1 /*
     2   
     3   Version: MPL 1.1/GPL 2.0/LGPL 2.1
     4 
     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
     8  
     9   http://www.mozilla.org/MPL/
    10 
    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.
    14 
    15   The Original Code is the Open Hardware Monitor code.
    16 
    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) 2009-2012
    20   the Initial Developer. All Rights Reserved.
    21 
    22   Contributor(s):
    23     Paul Werelds
    24     Michael Möller <m.moeller@gmx.ch>
    25  
    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.
    37  
    38 */
    39 
    40 namespace OpenHardwareMonitor.Hardware.HDD {
    41   using System.Collections.Generic;
    42 
    43   [NamePrefix(""), RequireSmart(0x01), RequireSmart(0x09), RequireSmart(0x0C), 
    44     RequireSmart(0xD1), RequireSmart(0xCE), RequireSmart(0xCF)]
    45   internal class SSDIndilinx : AbstractHarddrive {
    46 
    47     private static readonly IEnumerable<SmartAttribute> smartAttributes =
    48       new List<SmartAttribute> {
    49         new SmartAttribute(0x01, SmartNames.ReadErrorRate),
    50         new SmartAttribute(0x09, SmartNames.PowerOnHours),
    51         new SmartAttribute(0x0C, SmartNames.PowerCycleCount),
    52         new SmartAttribute(0xB8, SmartNames.InitialBadBlockCount),
    53         new SmartAttribute(0xC3, SmartNames.ProgramFailure),
    54         new SmartAttribute(0xC4, SmartNames.EraseFailure),
    55         new SmartAttribute(0xC5, SmartNames.ReadFailure),
    56         new SmartAttribute(0xC6, SmartNames.SectorsRead),
    57         new SmartAttribute(0xC7, SmartNames.SectorsWritten),
    58         new SmartAttribute(0xC8, SmartNames.ReadCommands),
    59         new SmartAttribute(0xC9, SmartNames.WriteCommands),
    60         new SmartAttribute(0xCA, SmartNames.BitErrors),
    61         new SmartAttribute(0xCB, SmartNames.CorrectedErrors),
    62         new SmartAttribute(0xCC, SmartNames.BadBlockFullFlag),
    63         new SmartAttribute(0xCD, SmartNames.MaxCellCycles),
    64         new SmartAttribute(0xCE, SmartNames.MinErase),
    65         new SmartAttribute(0xCF, SmartNames.MaxErase),
    66         new SmartAttribute(0xD0, SmartNames.AverageEraseCount),
    67         new SmartAttribute(0xD1, SmartNames.RemainingLife,
    68           null, SensorType.Level, 0),
    69         new SmartAttribute(0xD2, SmartNames.UnknownUnique),
    70         new SmartAttribute(0xD3, SmartNames.SataErrorCountCrc),
    71         new SmartAttribute(0xD4, SmartNames.SataErrorCountHandshake)
    72       };
    73 
    74     public SSDIndilinx(ISmart smart, string name, string firmwareRevision, 
    75       int index, ISettings settings)
    76       : base(smart, name, firmwareRevision, index, smartAttributes, settings) {}
    77   }
    78 }
    79 
    80 
    81