mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-22 09:57:20 +00:00
Added support for SSDs with a controller from Micron.
This commit is contained in:
parent
2f5434e6f6
commit
d6262767bb
@ -11,7 +11,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
@ -28,6 +28,7 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
|||||||
typeof(SSDSandforce),
|
typeof(SSDSandforce),
|
||||||
typeof(SSDIndilinx),
|
typeof(SSDIndilinx),
|
||||||
typeof(SSDSamsung),
|
typeof(SSDSamsung),
|
||||||
|
typeof(SSDMicron),
|
||||||
typeof(GenericHarddisk)
|
typeof(GenericHarddisk)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -263,8 +263,57 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
|||||||
C6 000000000000 100 100 0
|
C6 000000000000 100 100 0
|
||||||
C7 000000000000 100 100 0
|
C7 000000000000 100 100 0
|
||||||
CA 000000000000 100 100 0
|
CA 000000000000 100 100 0
|
||||||
CE 000000000000 100 100 0")
|
CE 000000000000 100 100 0"),
|
||||||
};
|
|
||||||
|
new Drive("M4-CT064M4SSD2", "0009", 16,
|
||||||
|
@"01 000000000000 100 100 50
|
||||||
|
05 000000000000 100 100 10
|
||||||
|
09 260000000000 100 100 1
|
||||||
|
0C 5A0000000000 100 100 1
|
||||||
|
AA 000000000000 100 100 10
|
||||||
|
AB 000000000000 100 100 1
|
||||||
|
AC 000000000000 100 100 1
|
||||||
|
AD 010000000000 100 100 10
|
||||||
|
AE 000000000000 100 100 1
|
||||||
|
B5 2B000E003A00 100 100 1
|
||||||
|
B7 000000000000 100 100 1
|
||||||
|
B8 000000000000 100 100 50
|
||||||
|
BB 000000000000 100 100 1
|
||||||
|
BC 000000000000 100 100 1
|
||||||
|
BD 310000000000 100 100 1
|
||||||
|
C2 000000000000 100 100 0
|
||||||
|
C3 000000000000 100 100 1
|
||||||
|
C4 000000000000 100 100 1
|
||||||
|
C5 000000000000 100 100 1
|
||||||
|
C6 000000000000 100 100 1
|
||||||
|
C7 000000000000 100 100 1
|
||||||
|
CA 000000000000 100 100 1
|
||||||
|
CE 000000000000 100 100 1"),
|
||||||
|
|
||||||
|
new Drive("M4-CT128M4SSD2", "000F", 16,
|
||||||
|
@"01 000000000000 100 100 50
|
||||||
|
05 000000000000 100 100 10
|
||||||
|
09 CA1400000000 100 100 1
|
||||||
|
0C A30200000000 100 100 1
|
||||||
|
AA 000000000000 100 100 10
|
||||||
|
AB 000000000000 100 100 1
|
||||||
|
AC 000000000000 100 100 1
|
||||||
|
AD 1F0000000000 99 99 10
|
||||||
|
AE 140000000000 100 100 1
|
||||||
|
B5 12037C028E05 100 100 1
|
||||||
|
B7 000000000000 100 100 1
|
||||||
|
B8 000000000000 100 100 50
|
||||||
|
BB 000000000000 100 100 1
|
||||||
|
BC 000000000000 100 100 1
|
||||||
|
BD 510000000000 100 100 1
|
||||||
|
C2 000000000000 100 100 0
|
||||||
|
C3 000000000000 100 100 1
|
||||||
|
C4 000000000000 100 100 1
|
||||||
|
C5 000000000000 100 100 1
|
||||||
|
C6 000000000000 100 100 1
|
||||||
|
C7 000000000000 100 100 1
|
||||||
|
CA 010000000000 99 99 1
|
||||||
|
CE 000000000000 100 100 1 ")};
|
||||||
|
|
||||||
public IntPtr OpenDrive(int driveNumber) {
|
public IntPtr OpenDrive(int driveNumber) {
|
||||||
if (driveNumber < drives.Length)
|
if (driveNumber < drives.Length)
|
||||||
|
@ -37,12 +37,12 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
|||||||
new SmartAttribute(0xAA, SmartNames.Unknown),
|
new SmartAttribute(0xAA, SmartNames.Unknown),
|
||||||
new SmartAttribute(0xAB, SmartNames.Unknown),
|
new SmartAttribute(0xAB, SmartNames.Unknown),
|
||||||
new SmartAttribute(0xAC, SmartNames.Unknown),
|
new SmartAttribute(0xAC, SmartNames.Unknown),
|
||||||
new SmartAttribute(0xB7, SmartNames.SataDownshiftErrorCount),
|
new SmartAttribute(0xB7, SmartNames.SataDownshiftErrorCount, RawToInt),
|
||||||
new SmartAttribute(0xB8, SmartNames.EndToEndError),
|
new SmartAttribute(0xB8, SmartNames.EndToEndError),
|
||||||
new SmartAttribute(0xB9, SmartNames.HeadStability),
|
new SmartAttribute(0xB9, SmartNames.HeadStability),
|
||||||
new SmartAttribute(0xBA, SmartNames.InducedOpVibrationDetection),
|
new SmartAttribute(0xBA, SmartNames.InducedOpVibrationDetection),
|
||||||
new SmartAttribute(0xBB, SmartNames.ReportedUncorrectableErrors),
|
new SmartAttribute(0xBB, SmartNames.ReportedUncorrectableErrors, RawToInt),
|
||||||
new SmartAttribute(0xBC, SmartNames.CommandTimeout),
|
new SmartAttribute(0xBC, SmartNames.CommandTimeout, RawToInt),
|
||||||
new SmartAttribute(0xBD, SmartNames.HighFlyWrites),
|
new SmartAttribute(0xBD, SmartNames.HighFlyWrites),
|
||||||
new SmartAttribute(0xBF, SmartNames.GSenseErrorRate),
|
new SmartAttribute(0xBF, SmartNames.GSenseErrorRate),
|
||||||
new SmartAttribute(0xC0, SmartNames.EmergencyRetractCycleCount),
|
new SmartAttribute(0xC0, SmartNames.EmergencyRetractCycleCount),
|
||||||
|
51
Hardware/HDD/SSDMicron.cs
Normal file
51
Hardware/HDD/SSDMicron.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OpenHardwareMonitor.Hardware.HDD {
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
[NamePrefix(""), RequireSmart(0xAA), RequireSmart(0xAB), RequireSmart(0xAC),
|
||||||
|
RequireSmart(0xAD), RequireSmart(0xAE), RequireSmart(0xCA)]
|
||||||
|
internal class SSDMicron : AbstractHarddrive {
|
||||||
|
|
||||||
|
private static readonly IEnumerable<SmartAttribute> smartAttributes =
|
||||||
|
new List<SmartAttribute> {
|
||||||
|
|
||||||
|
new SmartAttribute(0x01, SmartNames.ReadErrorRate, RawToInt),
|
||||||
|
new SmartAttribute(0x05, SmartNames.ReallocatedSectorsCount, RawToInt),
|
||||||
|
new SmartAttribute(0x09, SmartNames.PowerOnHours, RawToInt),
|
||||||
|
new SmartAttribute(0x0C, SmartNames.PowerCycleCount, RawToInt),
|
||||||
|
new SmartAttribute(0xAA, SmartNames.NewFailingBlockCount, RawToInt),
|
||||||
|
new SmartAttribute(0xAB, SmartNames.ProgramFailCount, RawToInt),
|
||||||
|
new SmartAttribute(0xAC, SmartNames.EraseFailCount, RawToInt),
|
||||||
|
new SmartAttribute(0xAD, SmartNames.WearLevelingCount, RawToInt),
|
||||||
|
new SmartAttribute(0xAE, SmartNames.UnexpectedPowerLossCount, RawToInt),
|
||||||
|
new SmartAttribute(0xB5, SmartNames.Non4kAlignedAccess,
|
||||||
|
(byte[] raw, byte value) => { return 6e4f * ((raw[5] << 8) | raw[4]); }),
|
||||||
|
new SmartAttribute(0xB7, SmartNames.SataDownshiftErrorCount, RawToInt),
|
||||||
|
new SmartAttribute(0xBB, SmartNames.ReportedUncorrectableErrors, RawToInt),
|
||||||
|
new SmartAttribute(0xBC, SmartNames.CommandTimeout, RawToInt),
|
||||||
|
new SmartAttribute(0xBD, SmartNames.FactoryBadBlockCount, RawToInt),
|
||||||
|
new SmartAttribute(0xC4, SmartNames.ReallocationEventCount, RawToInt),
|
||||||
|
new SmartAttribute(0xC5, SmartNames.CurrentPendingSectorCount),
|
||||||
|
new SmartAttribute(0xC6, SmartNames.OffLineUncorrectableErrorCount, RawToInt),
|
||||||
|
new SmartAttribute(0xC7, SmartNames.UltraDmaCrcErrorCount, RawToInt),
|
||||||
|
new SmartAttribute(0xCA, SmartNames.RemainingLife,
|
||||||
|
(byte[] raw, byte value) => { return 100 - RawToInt(raw, value); },
|
||||||
|
SensorType.Level, 0),
|
||||||
|
new SmartAttribute(0xCE, SmartNames.WriteErrorRate,
|
||||||
|
(byte[] raw, byte value) => { return 6e4f * ((raw[1] << 8) | raw[0]); }),
|
||||||
|
};
|
||||||
|
|
||||||
|
public SSDMicron(ISmart smart, string name, string firmwareRevision,
|
||||||
|
int index, ISettings settings)
|
||||||
|
: base(smart, name, firmwareRevision, index, smartAttributes, settings) {}
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
Copyright (C) 2011 Michael Möller <mmoeller@openhardwaremonitor.org>
|
Copyright (C) 2011-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
|
||||||
Copyright (C) 2011 Roland Reinl <roland-reinl@gmx.de>
|
Copyright (C) 2011 Roland Reinl <roland-reinl@gmx.de>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@ -478,5 +478,17 @@ namespace OpenHardwareMonitor.Hardware.HDD {
|
|||||||
public static string RawReadErrorRate {
|
public static string RawReadErrorRate {
|
||||||
get { return "Raw Read Error Rate"; }
|
get { return "Raw Read Error Rate"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string NewFailingBlockCount {
|
||||||
|
get { return "New Failing Block Count"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Non4kAlignedAccess {
|
||||||
|
get { return "Non-4k Aligned Access"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string FactoryBadBlockCount {
|
||||||
|
get { return "Factory Bad Block Count"; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -66,7 +66,7 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
this.name = settings.GetValue(
|
this.name = settings.GetValue(
|
||||||
new Identifier(Identifier, "name").ToString(), name);
|
new Identifier(Identifier, "name").ToString(), name);
|
||||||
|
|
||||||
GetSensorValuesFromSettings();
|
GetSensorValuesFromSettings();
|
||||||
|
|
||||||
hardware.Closing += delegate(IHardware h) {
|
hardware.Closing += delegate(IHardware h) {
|
||||||
SetSensorValuesToSettings();
|
SetSensorValuesToSettings();
|
||||||
@ -88,12 +88,12 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void GetSensorValuesFromSettings() {
|
private void GetSensorValuesFromSettings() {
|
||||||
string s = settings.GetValue(
|
string name = new Identifier(Identifier, "values").ToString();
|
||||||
new Identifier(Identifier, "values").ToString(), null);
|
string s = settings.GetValue(name, null);
|
||||||
|
|
||||||
byte[] array = null;
|
|
||||||
try {
|
try {
|
||||||
array = Convert.FromBase64String(s);
|
byte[] array = Convert.FromBase64String(s);
|
||||||
|
s = null;
|
||||||
using (MemoryStream m = new MemoryStream(array))
|
using (MemoryStream m = new MemoryStream(array))
|
||||||
using (GZipStream c = new GZipStream(m, CompressionMode.Decompress))
|
using (GZipStream c = new GZipStream(m, CompressionMode.Decompress))
|
||||||
using (BinaryReader reader = new BinaryReader(c)) {
|
using (BinaryReader reader = new BinaryReader(c)) {
|
||||||
@ -108,6 +108,9 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
} catch { }
|
} catch { }
|
||||||
if (values.Count > 0)
|
if (values.Count > 0)
|
||||||
AppendValue(float.NaN, DateTime.UtcNow);
|
AppendValue(float.NaN, DateTime.UtcNow);
|
||||||
|
|
||||||
|
// remove the value string from the settings to reduce memory usage
|
||||||
|
settings.Remove(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AppendValue(float value, DateTime time) {
|
private void AppendValue(float value, DateTime time) {
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
<Compile Include="Hardware\HDD\NamePrefixAttribute.cs" />
|
<Compile Include="Hardware\HDD\NamePrefixAttribute.cs" />
|
||||||
<Compile Include="Hardware\HDD\SSDIndilinx.cs" />
|
<Compile Include="Hardware\HDD\SSDIndilinx.cs" />
|
||||||
<Compile Include="Hardware\HDD\SSDIntel.cs" />
|
<Compile Include="Hardware\HDD\SSDIntel.cs" />
|
||||||
|
<Compile Include="Hardware\HDD\SSDMicron.cs" />
|
||||||
<Compile Include="Hardware\HDD\SSDPlextor.cs" />
|
<Compile Include="Hardware\HDD\SSDPlextor.cs" />
|
||||||
<Compile Include="Hardware\HDD\SSDSamsung.cs" />
|
<Compile Include="Hardware\HDD\SSDSamsung.cs" />
|
||||||
<Compile Include="Hardware\HDD\SSDSandforce.cs" />
|
<Compile Include="Hardware\HDD\SSDSandforce.cs" />
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.4.0.12")]
|
[assembly: AssemblyVersion("0.4.0.13")]
|
||||||
[assembly: AssemblyInformationalVersion("0.4.0.12 Alpha")]
|
[assembly: AssemblyInformationalVersion("0.4.0.13 Alpha")]
|
Loading…
x
Reference in New Issue
Block a user