Files
Aaru.Server/DiscImageChef.Server/App_Start/Ata.cs

1520 lines
88 KiB
C#
Raw Normal View History

2019-11-02 01:40:41 +00:00
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Ata.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Decodes ATA information from reports.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using DiscImageChef.CommonTypes.Metadata;
using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.SCSI;
namespace DiscImageChef.Server
{
public static class Ata
{
/// <summary>
/// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to be
/// sequenced by ASP.NET in the rendering
/// </summary>
/// <param name="ataReport">ATA part of a device report</param>
/// <param name="cfa"><c>true</c> if compact flash device</param>
/// <param name="atapi"><c>true</c> if atapi device</param>
/// <param name="removable"><c>true</c> if removable device</param>
/// <param name="ataOneValue">List to put values on</param>
/// <param name="ataTwoValue">List to put key=value pairs on</param>
/// <param name="testedMedia">List of tested media</param>
public static void Report(CommonTypes.Metadata.Ata ataReport, bool cfa, bool atapi,
2019-11-02 21:37:09 +00:00
ref bool removable,
ref List<string> ataOneValue, ref Dictionary<string, string> ataTwoValue,
ref List<TestedMedia> testedMedia)
2019-11-02 01:40:41 +00:00
{
uint logicalsectorsize = 0;
2019-11-02 21:37:09 +00:00
var ataIdentifyNullable = Identify.Decode(ataReport.Identify);
if (!ataIdentifyNullable.HasValue) return;
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
var ataIdentify = ataIdentifyNullable.Value;
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(ataIdentify.Model)) ataTwoValue.Add("Model", ataIdentify.Model);
if (!string.IsNullOrEmpty(ataIdentify.FirmwareRevision))
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Firmware revision", ataIdentify.FirmwareRevision);
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(ataIdentify.AdditionalPID))
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Additional product ID", ataIdentify.AdditionalPID);
bool ata1 = false,
2019-11-02 21:37:09 +00:00
ata2 = false,
ata3 = false,
ata4 = false,
ata5 = false,
ata6 = false,
ata7 = false,
acs = false,
acs2 = false,
acs3 = false,
acs4 = false;
if ((ushort) ataIdentify.MajorVersion == 0x0000 || (ushort) ataIdentify.MajorVersion == 0xFFFF)
2019-11-02 01:40:41 +00:00
{
// Obsolete in ATA-2, if present, device supports ATA-1
ata1 |= ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FastIDE) ||
ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SlowIDE) ||
ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.UltraFastIDE);
ata2 |= ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Words54to58Valid) ||
ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Words64to70Valid) ||
ataIdentify.ExtendedIdentify.HasFlag(Identify.ExtendedIdentifyBit.Word88Valid);
2019-11-02 21:37:09 +00:00
if (!ata1 && !ata2 && !atapi && !cfa) ata2 = true;
2019-11-02 01:40:41 +00:00
ata4 |= atapi;
ata3 |= cfa;
2019-11-02 21:37:09 +00:00
if (cfa && ata1) ata1 = false;
if (cfa && ata2) ata2 = false;
2019-11-02 01:40:41 +00:00
}
else
{
ata1 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata1);
ata2 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata2);
ata3 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata3);
ata4 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi4);
ata5 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi5);
ata6 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi6);
ata7 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.AtaAtapi7);
2019-11-02 21:37:09 +00:00
acs |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.Ata8ACS);
2019-11-02 01:40:41 +00:00
acs2 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS2);
acs3 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS3);
acs4 |= ataIdentify.MajorVersion.HasFlag(Identify.MajorVersionBit.ACS4);
}
2019-11-02 21:37:09 +00:00
var maxatalevel = 0;
var minatalevel = 255;
var tmpString = "";
if (ata1)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA-1 ";
maxatalevel = 1;
if (minatalevel > 1) minatalevel = 1;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata2)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA-2 ";
maxatalevel = 2;
if (minatalevel > 2) minatalevel = 2;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata3)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA-3 ";
maxatalevel = 3;
if (minatalevel > 3) minatalevel = 3;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata4)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA/ATAPI-4 ";
maxatalevel = 4;
if (minatalevel > 4) minatalevel = 4;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata5)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA/ATAPI-5 ";
maxatalevel = 5;
if (minatalevel > 5) minatalevel = 5;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata6)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA/ATAPI-6 ";
maxatalevel = 6;
if (minatalevel > 6) minatalevel = 6;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata7)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA/ATAPI-7 ";
maxatalevel = 7;
if (minatalevel > 7) minatalevel = 7;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (acs)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA8-ACS ";
maxatalevel = 8;
if (minatalevel > 8) minatalevel = 8;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (acs2)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA8-ACS2 ";
maxatalevel = 9;
if (minatalevel > 9) minatalevel = 9;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (acs3)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA8-ACS3 ";
maxatalevel = 10;
if (minatalevel > 10) minatalevel = 10;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (acs4)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
tmpString += "ATA8-ACS4 ";
maxatalevel = 11;
if (minatalevel > 11) minatalevel = 11;
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (tmpString != "") ataTwoValue.Add("Supported ATA versions", tmpString);
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (maxatalevel >= 3)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
switch (ataIdentify.MinorVersion)
2019-11-02 01:40:41 +00:00
{
case 0x0000:
case 0xFFFF:
tmpString = "Minor ATA version not specified";
break;
case 0x0001:
tmpString = "ATA (ATA-1) X3T9.2 781D prior to revision 4";
break;
case 0x0002:
tmpString = "ATA-1 published, ANSI X3.221-1994";
break;
case 0x0003:
tmpString = "ATA (ATA-1) X3T9.2 781D revision 4";
break;
case 0x0004:
tmpString = "ATA-2 published, ANSI X3.279-1996";
break;
case 0x0005:
tmpString = "ATA-2 X3T10 948D prior to revision 2k";
break;
case 0x0006:
tmpString = "ATA-3 X3T10 2008D revision 1";
break;
case 0x0007:
tmpString = "ATA-2 X3T10 948D revision 2k";
break;
case 0x0008:
tmpString = "ATA-3 X3T10 2008D revision 0";
break;
case 0x0009:
tmpString = "ATA-2 X3T10 948D revision 3";
break;
case 0x000A:
tmpString = "ATA-3 published, ANSI X3.298-1997";
break;
case 0x000B:
tmpString = "ATA-3 X3T10 2008D revision 6";
break;
case 0x000C:
tmpString = "ATA-3 X3T13 2008D revision 7";
break;
case 0x000D:
tmpString = "ATA/ATAPI-4 X3T13 1153D revision 6";
break;
case 0x000E:
tmpString = "ATA/ATAPI-4 T13 1153D revision 13";
break;
case 0x000F:
tmpString = "ATA/ATAPI-4 X3T13 1153D revision 7";
break;
case 0x0010:
tmpString = "ATA/ATAPI-4 T13 1153D revision 18";
break;
case 0x0011:
tmpString = "ATA/ATAPI-4 T13 1153D revision 15";
break;
case 0x0012:
tmpString = "ATA/ATAPI-4 published, ANSI INCITS 317-1998";
break;
case 0x0013:
tmpString = "ATA/ATAPI-5 T13 1321D revision 3";
break;
case 0x0014:
tmpString = "ATA/ATAPI-4 T13 1153D revision 14";
break;
case 0x0015:
tmpString = "ATA/ATAPI-5 T13 1321D revision 1";
break;
case 0x0016:
tmpString = "ATA/ATAPI-5 published, ANSI INCITS 340-2000";
break;
case 0x0017:
tmpString = "ATA/ATAPI-4 T13 1153D revision 17";
break;
case 0x0018:
tmpString = "ATA/ATAPI-6 T13 1410D revision 0";
break;
case 0x0019:
tmpString = "ATA/ATAPI-6 T13 1410D revision 3a";
break;
case 0x001A:
tmpString = "ATA/ATAPI-7 T13 1532D revision 1";
break;
case 0x001B:
tmpString = "ATA/ATAPI-6 T13 1410D revision 2";
break;
case 0x001C:
tmpString = "ATA/ATAPI-6 T13 1410D revision 1";
break;
case 0x001D:
tmpString = "ATA/ATAPI-7 published ANSI INCITS 397-2005";
break;
case 0x001E:
tmpString = "ATA/ATAPI-7 T13 1532D revision 0";
break;
case 0x001F:
tmpString = "ACS-3 Revision 3b";
break;
case 0x0021:
tmpString = "ATA/ATAPI-7 T13 1532D revision 4a";
break;
case 0x0022:
tmpString = "ATA/ATAPI-6 published, ANSI INCITS 361-2002";
break;
case 0x0027:
tmpString = "ATA8-ACS revision 3c";
break;
case 0x0028:
tmpString = "ATA8-ACS revision 6";
break;
case 0x0029:
tmpString = "ATA8-ACS revision 4";
break;
case 0x0031:
tmpString = "ACS-2 Revision 2";
break;
case 0x0033:
tmpString = "ATA8-ACS Revision 3e";
break;
case 0x0039:
tmpString = "ATA8-ACS Revision 4c";
break;
case 0x0042:
tmpString = "ATA8-ACS Revision 3f";
break;
case 0x0052:
tmpString = "ATA8-ACS revision 3b";
break;
case 0x006D:
tmpString = "ACS-3 Revision 5";
break;
case 0x0082:
tmpString = "ACS-2 published, ANSI INCITS 482-2012";
break;
case 0x0107:
tmpString = "ATA8-ACS revision 2d";
break;
case 0x0110:
tmpString = "ACS-2 Revision 3";
break;
case 0x011B:
tmpString = "ACS-3 Revision 4";
break;
default:
tmpString = $"Unknown ATA revision 0x{ataIdentify.MinorVersion:X4}";
break;
}
ataTwoValue.Add("Maximum ATA revision supported", tmpString);
}
tmpString = "";
2019-11-02 21:37:09 +00:00
switch ((ataIdentify.TransportMajorVersion & 0xF000) >> 12)
2019-11-02 01:40:41 +00:00
{
case 0x0:
2019-11-02 21:37:09 +00:00
if ((ataIdentify.TransportMajorVersion & 0x0002) == 0x0002) tmpString += "ATA/ATAPI-7 ";
if ((ataIdentify.TransportMajorVersion & 0x0001) == 0x0001) tmpString += "ATA8-APT ";
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Parallel ATA device", tmpString);
break;
case 0x1:
2019-11-02 21:37:09 +00:00
if ((ataIdentify.TransportMajorVersion & 0x0001) == 0x0001) tmpString += "ATA8-AST ";
if ((ataIdentify.TransportMajorVersion & 0x0002) == 0x0002) tmpString += "SATA 1.0a ";
if ((ataIdentify.TransportMajorVersion & 0x0004) == 0x0004) tmpString += "SATA II Extensions ";
if ((ataIdentify.TransportMajorVersion & 0x0008) == 0x0008) tmpString += "SATA 2.5 ";
if ((ataIdentify.TransportMajorVersion & 0x0010) == 0x0010) tmpString += "SATA 2.6 ";
if ((ataIdentify.TransportMajorVersion & 0x0020) == 0x0020) tmpString += "SATA 3.0 ";
if ((ataIdentify.TransportMajorVersion & 0x0040) == 0x0040) tmpString += "SATA 3.1 ";
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Serial ATA device: ", tmpString);
break;
case 0xE:
ataTwoValue.Add("SATA Express device", "No version");
break;
default:
ataTwoValue.Add("Unknown transport type",
2019-11-02 21:37:09 +00:00
$"0x{(ataIdentify.TransportMajorVersion & 0xF000) >> 12:X1}");
2019-11-02 01:40:41 +00:00
break;
}
2019-11-02 21:37:09 +00:00
if (atapi)
2019-11-02 01:40:41 +00:00
{
// Bits 12 to 8, SCSI Peripheral Device Type
2019-11-02 21:37:09 +00:00
switch ((PeripheralDeviceTypes) (((ushort) ataIdentify.GeneralConfiguration & 0x1F00) >> 8))
2019-11-02 01:40:41 +00:00
{
case PeripheralDeviceTypes.DirectAccess: //0x00,
ataOneValue.Add("ATAPI Direct-access device");
break;
case PeripheralDeviceTypes.SequentialAccess: //0x01,
ataOneValue.Add("ATAPI Sequential-access device");
break;
case PeripheralDeviceTypes.PrinterDevice: //0x02,
ataOneValue.Add("ATAPI Printer device");
break;
case PeripheralDeviceTypes.ProcessorDevice: //0x03,
ataOneValue.Add("ATAPI Processor device");
break;
case PeripheralDeviceTypes.WriteOnceDevice: //0x04,
ataOneValue.Add("ATAPI Write-once device");
break;
case PeripheralDeviceTypes.MultiMediaDevice: //0x05,
ataOneValue.Add("ATAPI CD-ROM/DVD/etc device");
break;
case PeripheralDeviceTypes.ScannerDevice: //0x06,
ataOneValue.Add("ATAPI Scanner device");
break;
case PeripheralDeviceTypes.OpticalDevice: //0x07,
ataOneValue.Add("ATAPI Optical memory device");
break;
case PeripheralDeviceTypes.MediumChangerDevice: //0x08,
ataOneValue.Add("ATAPI Medium change device");
break;
case PeripheralDeviceTypes.CommsDevice: //0x09,
ataOneValue.Add("ATAPI Communications device");
break;
case PeripheralDeviceTypes.PrePressDevice1: //0x0A,
ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)");
break;
case PeripheralDeviceTypes.PrePressDevice2: //0x0B,
ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)");
break;
case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C,
ataOneValue.Add("ATAPI Array controller device");
break;
case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D,
ataOneValue.Add("ATAPI Enclosure services device");
break;
case PeripheralDeviceTypes.SimplifiedDevice: //0x0E,
ataOneValue.Add("ATAPI Simplified direct-access device");
break;
case PeripheralDeviceTypes.OCRWDevice: //0x0F,
ataOneValue.Add("ATAPI Optical card reader/writer device");
break;
case PeripheralDeviceTypes.BridgingExpander: //0x10,
ataOneValue.Add("ATAPI Bridging Expanders");
break;
case PeripheralDeviceTypes.ObjectDevice: //0x11,
ataOneValue.Add("ATAPI Object-based Storage Device");
break;
case PeripheralDeviceTypes.ADCDevice: //0x12,
ataOneValue.Add("ATAPI Automation/Drive Interface");
break;
case PeripheralDeviceTypes.WellKnownDevice: //0x1E,
ataOneValue.Add("ATAPI Well known logical unit");
break;
case PeripheralDeviceTypes.UnknownDevice: //0x1F
ataOneValue.Add("ATAPI Unknown or no device type");
break;
default:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"ATAPI Unknown device type field value 0x{((ushort) ataIdentify.GeneralConfiguration & 0x1F00) >> 8:X2}");
2019-11-02 01:40:41 +00:00
break;
}
// ATAPI DRQ behaviour
2019-11-02 21:37:09 +00:00
switch (((ushort) ataIdentify.GeneralConfiguration & 0x60) >> 5)
2019-11-02 01:40:41 +00:00
{
case 0:
ataOneValue.Add("Device shall set DRQ within 3 ms of receiving PACKET");
break;
case 1:
ataOneValue.Add("Device shall assert INTRQ when DRQ is set to one");
break;
case 2:
ataOneValue.Add("Device shall set DRQ within 50 µs of receiving PACKET");
break;
default:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"Unknown ATAPI DRQ behaviour code {((ushort) ataIdentify.GeneralConfiguration & 0x60) >> 5}");
2019-11-02 01:40:41 +00:00
break;
}
// ATAPI PACKET size
2019-11-02 21:37:09 +00:00
switch ((ushort) ataIdentify.GeneralConfiguration & 0x03)
2019-11-02 01:40:41 +00:00
{
case 0:
ataOneValue.Add("ATAPI device uses 12 byte command packet");
break;
case 1:
ataOneValue.Add("ATAPI device uses 16 byte command packet");
break;
default:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add($"Unknown ATAPI packet size code {(ushort) ataIdentify.GeneralConfiguration & 0x03}");
2019-11-02 01:40:41 +00:00
break;
}
}
2019-11-02 21:37:09 +00:00
else if (!cfa)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (minatalevel >= 5)
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.IncompleteResponse))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Incomplete identify response");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.NonMagnetic))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device uses non-magnetic media");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Removable))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is removable");
2019-11-02 21:37:09 +00:00
if (minatalevel <= 5)
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Fixed))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is fixed");
2019-11-02 21:37:09 +00:00
if (ata1)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SlowIDE))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device transfer rate is <= 5 Mb/s");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FastIDE))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device transfer rate is > 5 Mb/s but <= 10 Mb/s");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.UltraFastIDE))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device transfer rate is > 10 Mb/s");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SoftSector))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is soft sectored");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.HardSector))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is hard sectored");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.NotMFM))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is not MFM encoded");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.FormatGapReq))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Format speed tolerance gap is required");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.TrackOffset))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Track offset option is available");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.DataStrobeOffset))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Data strobe offset option is available");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit
.RotationalSpeedTolerance))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Rotational speed tolerance is higher than 0,5%");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.SpindleControl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Spindle motor control is implemented");
2019-11-02 21:37:09 +00:00
if (ataIdentify.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.HighHeadSwitch))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Head switch time is bigger than 15 µs.");
}
}
2019-11-02 21:37:09 +00:00
if ((ushort) ataIdentify.SpecificConfiguration != 0x0000 &&
(ushort) ataIdentify.SpecificConfiguration != 0xFFFF)
switch (ataIdentify.SpecificConfiguration)
2019-11-02 01:40:41 +00:00
{
case Identify.SpecificConfigurationEnum.RequiresSetIncompleteResponse:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
2019-11-02 01:40:41 +00:00
break;
case Identify.SpecificConfigurationEnum.RequiresSetCompleteResponse:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add("Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
2019-11-02 01:40:41 +00:00
break;
case Identify.SpecificConfigurationEnum.NotRequiresSetIncompleteResponse:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
"Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete.");
2019-11-02 01:40:41 +00:00
break;
case Identify.SpecificConfigurationEnum.NotRequiresSetCompleteResponse:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
"Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
2019-11-02 01:40:41 +00:00
break;
default:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"Unknown device specific configuration 0x{(ushort) ataIdentify.SpecificConfiguration:X4}");
2019-11-02 01:40:41 +00:00
break;
}
// Obsolete since ATA-2, however, it is yet used in ATA-8 devices
2019-11-02 21:37:09 +00:00
if (ataIdentify.BufferSize != 0x0000 && ataIdentify.BufferSize != 0xFFFF &&
ataIdentify.BufferType != 0x0000 && ataIdentify.BufferType != 0xFFFF)
switch (ataIdentify.BufferType)
2019-11-02 01:40:41 +00:00
{
case 1:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"{ataIdentify.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
2019-11-02 01:40:41 +00:00
break;
case 2:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"{ataIdentify.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
2019-11-02 01:40:41 +00:00
break;
case 3:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"{ataIdentify.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
2019-11-02 01:40:41 +00:00
break;
default:
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"{ataIdentify.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataIdentify.BufferType} buffer");
2019-11-02 01:40:41 +00:00
break;
}
ataOneValue.Add("<i>Device capabilities:</i>");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.StandardStanbyTimer))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Standby time values are standard");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.IORDY))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.CanDisableIORDY)
2019-11-02 21:37:09 +00:00
? "IORDY is supported and can be disabled"
: "IORDY is supported");
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.DMASupport))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("DMA is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.PhysicalAlignment1) ||
ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.PhysicalAlignment0))
ataOneValue.Add($"Long Physical Alignment setting is {(ushort) ataIdentify.Capabilities & 0x03}");
if (atapi)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.InterleavedDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device supports interleaved DMA");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.CommandQueue))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device supports command queueing");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.OverlapOperation))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device supports overlapped operations");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.RequiresATASoftReset))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device requires ATA software reset");
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.MustBeSet) &&
!ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.MustBeClear))
if (ataIdentify.Capabilities2.HasFlag(Identify.CapabilitiesBit2.SpecificStandbyTimer))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device indicates a specific minimum standby timer value");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.MultipleValid))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
ataOneValue.Add(
$"A maximum of {ataIdentify.MultipleSectorNumber} sectors can be transferred per interrupt on READ/WRITE MULTIPLE");
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"Device supports setting a maximum of {ataIdentify.MultipleMaxSectors} sectors");
}
2019-11-02 21:37:09 +00:00
if (ata1)
if (ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.TrustedComputing))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports doubleword I/O");
2019-11-02 21:37:09 +00:00
if (minatalevel <= 3)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.PIOTransferTimingMode > 0)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("PIO timing mode", $"{ataIdentify.PIOTransferTimingMode}");
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMATransferTimingMode > 0)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("DMA timing mode", $"{ataIdentify.DMATransferTimingMode}");
}
tmpString = "";
2019-11-02 21:37:09 +00:00
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode0)) tmpString += "PIO0 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode1)) tmpString += "PIO1 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode2)) tmpString += "PIO2 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode3)) tmpString += "PIO3 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode4)) tmpString += "PIO4 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode5)) tmpString += "PIO5 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode6)) tmpString += "PIO6 ";
if (ataIdentify.APIOSupported.HasFlag(Identify.TransferMode.Mode7)) tmpString += "PIO7 ";
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Advanced PIO", tmpString);
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (minatalevel <= 3 && !atapi)
2019-11-02 01:40:41 +00:00
{
tmpString = "";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode0))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA0 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode1))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA1 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode2))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA2 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode3))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA3 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode4))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA4 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode5))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA5 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode6))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA6 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMASupported.HasFlag(Identify.TransferMode.Mode7))
2019-11-02 01:40:41 +00:00
{
tmpString += "DMA7 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.DMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Single-word DMA", tmpString);
2019-11-02 01:40:41 +00:00
}
tmpString = "";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode0))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA0 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode1))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA1 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode2))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA2 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode3))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA3 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode4))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA4 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode5))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA5 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode6))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA6 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMASupported.HasFlag(Identify.TransferMode.Mode7))
2019-11-02 01:40:41 +00:00
{
tmpString += "MDMA7 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.MDMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Multi-word DMA", tmpString);
2019-11-02 01:40:41 +00:00
tmpString = "";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode0))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA0 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode0)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode1))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA1 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode1)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode2))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA2 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode2)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode3))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA3 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode3)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode4))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA4 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode4)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode5))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA5 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode5)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode6))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA6 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode6)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMASupported.HasFlag(Identify.TransferMode.Mode7))
2019-11-02 01:40:41 +00:00
{
tmpString += "UDMA7 ";
2019-11-02 21:37:09 +00:00
if (ataIdentify.UDMAActive.HasFlag(Identify.TransferMode.Mode7)) tmpString += "(active) ";
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (!string.IsNullOrEmpty(tmpString)) ataTwoValue.Add("Ultra DMA", tmpString);
if (ataIdentify.MinMDMACycleTime != 0 && ataIdentify.RecMDMACycleTime != 0)
ataOneValue.Add(
$"At minimum {ataIdentify.MinMDMACycleTime} ns. transfer cycle time per word in MDMA, " +
$"{ataIdentify.RecMDMACycleTime} ns. recommended");
if (ataIdentify.MinPIOCycleTimeNoFlow != 0)
ataOneValue.Add(
$"At minimum {ataIdentify.MinPIOCycleTimeNoFlow} ns. transfer cycle time per word in PIO, " +
"without flow control");
if (ataIdentify.MinPIOCycleTimeFlow != 0)
ataOneValue.Add(
$"At minimum {ataIdentify.MinPIOCycleTimeFlow} ns. transfer cycle time per word in PIO, " +
"with IORDY flow control");
if (ataIdentify.MaxQueueDepth != 0)
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"{ataIdentify.MaxQueueDepth + 1} depth of queue maximum");
2019-11-02 21:37:09 +00:00
if (atapi)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.PacketBusRelease != 0)
2019-11-02 01:40:41 +00:00
ataOneValue
2019-11-02 21:37:09 +00:00
.Add($"{ataIdentify.PacketBusRelease} ns. typical to release bus from receipt of PACKET");
if (ataIdentify.ServiceBusyClear != 0)
2019-11-02 01:40:41 +00:00
ataOneValue
2019-11-02 21:37:09 +00:00
.Add($"{ataIdentify.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if ((ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0x1 ||
(ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0xE)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen1Speed))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SATA 1.5Gb/s is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen2Speed))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SATA 3.0Gb/s is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Gen3Speed))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SATA 6.0Gb/s is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.PowerReceipt))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Receipt of host initiated power management requests is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.PHYEventCounter))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("PHY Event counters are supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.HostSlumbTrans))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Supports host automatic partial to slumber transitions is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.DevSlumbTrans))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Supports device automatic partial to slumber transitions is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQ))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("NCQ is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQPriority))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("NCQ priority is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.UnloadNCQ))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Unload is supported with outstanding NCQ commands");
}
}
2019-11-02 21:37:09 +00:00
if (!ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.Clear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear) &&
ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.NCQ))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.NCQMgmt))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("NCQ queue management is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.NCQStream))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("NCQ streaming is supported");
}
2019-11-02 21:37:09 +00:00
if (atapi)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.HostEnvDetect))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device supports host environment detection");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.DevAttSlimline))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("ATAPI device supports attention on slimline connected devices");
}
}
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.InterseekDelay != 0x0000 && ataIdentify.InterseekDelay != 0xFFFF)
ataOneValue.Add(
$"{ataIdentify.InterseekDelay} microseconds of interseek delay for ISO-7779 accoustic testing");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if ((ushort) ataIdentify.DeviceFormFactor != 0x0000 && (ushort) ataIdentify.DeviceFormFactor != 0xFFFF)
switch (ataIdentify.DeviceFormFactor)
2019-11-02 01:40:41 +00:00
{
case Identify.DeviceFormFactorEnum.FiveAndQuarter:
ataOneValue.Add("Device nominal size is 5.25\"");
break;
case Identify.DeviceFormFactorEnum.ThreeAndHalf:
ataOneValue.Add("Device nominal size is 3.5\"");
break;
case Identify.DeviceFormFactorEnum.TwoAndHalf:
ataOneValue.Add("Device nominal size is 2.5\"");
break;
case Identify.DeviceFormFactorEnum.OnePointEight:
ataOneValue.Add("Device nominal size is 1.8\"");
break;
case Identify.DeviceFormFactorEnum.LessThanOnePointEight:
ataOneValue.Add("Device nominal size is smaller than 1.8\"");
break;
default:
ataOneValue.Add($"Device nominal size field value {ataIdentify.DeviceFormFactor} is unknown");
break;
}
2019-11-02 21:37:09 +00:00
if (atapi)
if (ataIdentify.ATAPIByteCount > 0)
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"{ataIdentify.ATAPIByteCount} bytes count limit for ATAPI");
2019-11-02 21:37:09 +00:00
if (cfa)
if ((ataIdentify.CFAPowerMode & 0x8000) == 0x8000)
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("CompactFlash device supports power mode 1");
2019-11-02 21:37:09 +00:00
if ((ataIdentify.CFAPowerMode & 0x2000) == 0x2000)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("CompactFlash power mode 1 required for one or more commands");
2019-11-02 21:37:09 +00:00
if ((ataIdentify.CFAPowerMode & 0x1000) == 0x1000)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("CompactFlash power mode 1 is disabled");
ataOneValue.Add($"CompactFlash device uses a maximum of {ataIdentify.CFAPowerMode & 0x0FFF} mA");
}
ataOneValue.Add("<i>Command set and features:</i>");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Nop))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Nop)
2019-11-02 21:37:09 +00:00
? "NOP is supported and enabled"
: "NOP is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.ReadBuffer))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.ReadBuffer)
2019-11-02 21:37:09 +00:00
? "READ BUFFER is supported and enabled"
: "READ BUFFER is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.WriteBuffer))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.WriteBuffer)
2019-11-02 21:37:09 +00:00
? "WRITE BUFFER is supported and enabled"
: "WRITE BUFFER is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.HPA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.HPA)
2019-11-02 21:37:09 +00:00
? "Host Protected Area is supported and enabled"
: "Host Protected Area is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.DeviceReset))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.DeviceReset)
2019-11-02 21:37:09 +00:00
? "DEVICE RESET is supported and enabled"
: "DEVICE RESET is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Service))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Service)
2019-11-02 21:37:09 +00:00
? "SERVICE interrupt is supported and enabled"
: "SERVICE interrupt is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Release))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Release)
2019-11-02 21:37:09 +00:00
? "Release is supported and enabled"
: "Release is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.LookAhead))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.LookAhead)
2019-11-02 21:37:09 +00:00
? "Look-ahead read is supported and enabled"
: "Look-ahead read is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.WriteCache))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.WriteCache)
2019-11-02 21:37:09 +00:00
? "Write cache is supported and enabled"
: "Write cache is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.Packet))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.Packet)
2019-11-02 21:37:09 +00:00
? "PACKET is supported and enabled"
: "PACKET is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.PowerManagement))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.PowerManagement)
2019-11-02 21:37:09 +00:00
? "Power management is supported and enabled"
: "Power management is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.RemovableMedia))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.RemovableMedia)
2019-11-02 21:37:09 +00:00
? "Removable media feature set is supported and enabled"
: "Removable media feature set is supported");
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.SecurityMode))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.SecurityMode)
2019-11-02 21:37:09 +00:00
? "Security mode is supported and enabled"
: "Security mode is supported");
if (ataIdentify.Capabilities.HasFlag(Identify.CapabilitiesBit.LBASupport))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("28-bit LBA is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.MustBeSet) &&
!ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.MustBeClear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.LBA48))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.LBA48)
2019-11-02 21:37:09 +00:00
? "48-bit LBA is supported and enabled"
: "48-bit LBA is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.FlushCache))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.FlushCache)
2019-11-02 21:37:09 +00:00
? "FLUSH CACHE is supported and enabled"
: "FLUSH CACHE is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.FlushCacheExt))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.FlushCacheExt)
2019-11-02 21:37:09 +00:00
? "FLUSH CACHE EXT is supported and enabled"
: "FLUSH CACHE EXT is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.DCO))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.DCO)
2019-11-02 21:37:09 +00:00
? "Device Configuration Overlay feature set is supported and enabled"
: "Device Configuration Overlay feature set is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.AAM))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.AAM)
2019-11-02 21:37:09 +00:00
? $"Automatic Acoustic Management is supported and enabled with value {ataIdentify.CurrentAAM} (vendor recommends {ataIdentify.RecommendedAAM}"
: "Automatic Acoustic Management is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.SetMax))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.SetMax)
2019-11-02 21:37:09 +00:00
? "SET MAX security extension is supported and enabled"
: "SET MAX security extension is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.AddressOffsetReservedAreaBoot))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2
2019-11-02 21:37:09 +00:00
.AddressOffsetReservedAreaBoot)
? "Address Offset Reserved Area Boot is supported and enabled"
: "Address Offset Reserved Area Boot is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.SetFeaturesRequired))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SET FEATURES is required before spin-up");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.PowerUpInStandby))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.PowerUpInStandby)
2019-11-02 21:37:09 +00:00
? "Power-up in standby is supported and enabled"
: "Power-up in standby is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.RemovableNotification))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2
2019-11-02 21:37:09 +00:00
.RemovableNotification)
? "Removable Media Status Notification is supported and enabled"
: "Removable Media Status Notification is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.APM))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.APM)
2019-11-02 21:37:09 +00:00
? $"Advanced Power Management is supported and enabled with value {ataIdentify.CurrentAPM}"
: "Advanced Power Management is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.CompactFlash))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.CompactFlash)
2019-11-02 21:37:09 +00:00
? "CompactFlash feature set is supported and enabled"
: "CompactFlash feature set is supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.RWQueuedDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.RWQueuedDMA)
2019-11-02 21:37:09 +00:00
? "READ DMA QUEUED and WRITE DMA QUEUED are supported and enabled"
: "READ DMA QUEUED and WRITE DMA QUEUED are supported");
if (ataIdentify.CommandSet2.HasFlag(Identify.CommandSetBit2.DownloadMicrocode))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet2.HasFlag(Identify.CommandSetBit2.DownloadMicrocode)
2019-11-02 21:37:09 +00:00
? "DOWNLOAD MICROCODE is supported and enabled"
: "DOWNLOAD MICROCODE is supported");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet.HasFlag(Identify.CommandSetBit.SMART))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet.HasFlag(Identify.CommandSetBit.SMART)
2019-11-02 21:37:09 +00:00
? "S.M.A.R.T. is supported and enabled"
: "S.M.A.R.T. is supported");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.Supported))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("S.M.A.R.T. Command Transport is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) &&
!ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.SMARTSelfTest))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.SMARTSelfTest)
2019-11-02 21:37:09 +00:00
? "S.M.A.R.T. self-testing is supported and enabled"
: "S.M.A.R.T. self-testing is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.SMARTLog))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.SMARTLog)
2019-11-02 21:37:09 +00:00
? "S.M.A.R.T. error logging is supported and enabled"
: "S.M.A.R.T. error logging is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.IdleImmediate))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.IdleImmediate)
2019-11-02 21:37:09 +00:00
? "IDLE IMMEDIATE with UNLOAD FEATURE is supported and enabled"
: "IDLE IMMEDIATE with UNLOAD FEATURE is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.WriteURG))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.ReadURG))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.WWN))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device has a World Wide Name");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.FUAWriteQ))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.FUAWriteQ)
2019-11-02 21:37:09 +00:00
? "WRITE DMA QUEUED FUA EXT is supported and enabled"
: "WRITE DMA QUEUED FUA EXT is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.FUAWrite))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.FUAWrite)
2019-11-02 21:37:09 +00:00
? "WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported and enabled"
: "WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.GPL))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.GPL)
2019-11-02 21:37:09 +00:00
? "General Purpose Logging is supported and enabled"
: "General Purpose Logging is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.Streaming))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.Streaming)
2019-11-02 21:37:09 +00:00
? "Streaming feature set is supported and enabled"
: "Streaming feature set is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MCPT))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MCPT)
2019-11-02 21:37:09 +00:00
? "Media Card Pass Through command set is supported and enabled"
: "Media Card Pass Through command set is supported");
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial)
2019-11-02 21:37:09 +00:00
? "Media Serial is supported and valid"
: "Media Serial is supported");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.MustBeSet) &&
!ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.MustBeClear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.DSN))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.DSN)
2019-11-02 21:37:09 +00:00
? "DSN feature set is supported and enabled"
: "DSN feature set is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.AMAC))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.AMAC)
2019-11-02 21:37:09 +00:00
? "Accessible Max Address Configuration is supported and enabled"
: "Accessible Max Address Configuration is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.ExtPowerCond))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.ExtPowerCond)
2019-11-02 21:37:09 +00:00
? "Extended Power Conditions are supported and enabled"
: "Extended Power Conditions are supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.ExtStatusReport))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.ExtStatusReport)
2019-11-02 21:37:09 +00:00
? "Extended Status Reporting is supported and enabled"
: "Extended Status Reporting is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.FreeFallControl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.FreeFallControl)
2019-11-02 21:37:09 +00:00
? "Free-fall control feature set is supported and enabled"
: "Free-fall control feature set is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.SegmentedDownloadMicrocode))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4
2019-11-02 21:37:09 +00:00
.SegmentedDownloadMicrocode)
? "Segmented feature in DOWNLOAD MICROCODE is supported and enabled"
: "Segmented feature in DOWNLOAD MICROCODE is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.RWDMAExtGpl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.RWDMAExtGpl)
2019-11-02 21:37:09 +00:00
? "READ/WRITE DMA EXT GPL are supported and enabled"
: "READ/WRITE DMA EXT GPL are supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.WriteUnc))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WriteUnc)
2019-11-02 21:37:09 +00:00
? "WRITE UNCORRECTABLE is supported and enabled"
: "WRITE UNCORRECTABLE is supported");
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.WRV))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WRV)
2019-11-02 21:37:09 +00:00
? "Write/Read/Verify is supported and enabled"
: "Write/Read/Verify is supported");
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"{ataIdentify.WRVSectorCountMode2} sectors for Write/Read/Verify mode 2");
ataOneValue.Add($"{ataIdentify.WRVSectorCountMode3} sectors for Write/Read/Verify mode 3");
2019-11-02 21:37:09 +00:00
if (ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.WRV))
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"Current Write/Read/Verify mode: {ataIdentify.WRVMode}");
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet4.HasFlag(Identify.CommandSetBit4.DT1825))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledCommandSet4.HasFlag(Identify.CommandSetBit4.DT1825)
2019-11-02 21:37:09 +00:00
? "DT1825 is supported and enabled"
: "DT1825 is supported");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (true)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.BlockErase))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("BLOCK ERASE EXT is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.Overwrite))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("OVERWRITE EXT is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.CryptoScramble))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("CRYPTO SCRAMBLE EXT is supported");
}
2019-11-02 21:37:09 +00:00
if (true)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DeviceConfDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ReadBufferDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("READ BUFFER DMA is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.WriteBufferDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("WRITE BUFFER DMA is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DownloadMicroCodeDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.SetMaxDMA))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.Ata28))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Not all 28-bit commands are supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.CFast))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device follows CFast specification");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.IEEE1667))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device follows IEEE-1667");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.DeterministicTrim))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("Read after TRIM is deterministic");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ReadZeroTrim))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Read after TRIM returns empty data");
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.LongPhysSectorAligError))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.Encrypted))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device encrypts all user data");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.AllCacheNV))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device's write cache is non-volatile");
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ZonedBit0) ||
ataIdentify.CommandSet5.HasFlag(Identify.CommandSetBit5.ZonedBit1))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device is zoned");
}
2019-11-02 21:37:09 +00:00
if (true)
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.Sanitize))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("Sanitize feature set is supported");
ataOneValue.Add(ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.SanitizeCommands)
2019-11-02 21:37:09 +00:00
? "Sanitize commands are specified by ACS-3 or higher"
: "Sanitize commands are specified by ACS-2");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (ataIdentify.Capabilities3.HasFlag(Identify.CapabilitiesBit3.SanitizeAntifreeze))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SANITIZE ANTIFREEZE LOCK EXT is supported");
}
2019-11-02 21:37:09 +00:00
if (!ata1 && maxatalevel >= 8)
if (ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.Set) &&
!ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.Clear) &&
ataIdentify.TrustedComputing.HasFlag(Identify.TrustedComputingBit.TrustedComputing))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Trusted Computing feature set is supported");
2019-11-02 21:37:09 +00:00
if ((ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0x1 ||
(ataIdentify.TransportMajorVersion & 0xF000) >> 12 == 0xE)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (true)
if (!ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.Clear))
if (ataIdentify.SATACapabilities.HasFlag(Identify.SATACapabilitiesBit.ReadLogDMAExt))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("READ LOG DMA EXT is supported");
2019-11-02 21:37:09 +00:00
if (true)
if (!ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.Clear))
if (ataIdentify.SATACapabilities2.HasFlag(Identify.SATACapabilitiesBit2.FPDMAQ))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED are supported");
2019-11-02 21:37:09 +00:00
if (true)
if (!ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.Clear))
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.NonZeroBufferOffset))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit
2019-11-02 21:37:09 +00:00
.NonZeroBufferOffset)
? "Non-zero buffer offsets are supported and enabled"
: "Non-zero buffer offsets are supported");
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.DMASetup))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.DMASetup)
2019-11-02 21:37:09 +00:00
? "DMA Setup auto-activation is supported and enabled"
: "DMA Setup auto-activation is supported");
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.InitPowerMgmt))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit
2019-11-02 21:37:09 +00:00
.InitPowerMgmt)
? "Device-initiated power management is supported and enabled"
: "Device-initiated power management is supported");
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.InOrderData))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledSATAFeatures
2019-11-02 21:37:09 +00:00
.HasFlag(Identify.SATAFeaturesBit.InOrderData)
? "In-order data delivery is supported and enabled"
: "In-order data delivery is supported");
if (!atapi)
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.HardwareFeatureControl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit
2019-11-02 21:37:09 +00:00
.HardwareFeatureControl)
? "Hardware Feature Control is supported and enabled"
: "Hardware Feature Control is supported");
if (atapi)
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.AsyncNotification))
if (ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.AsyncNotification))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Asynchronous notification is supported");
else
ataOneValue.Add("Asynchronous notification is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.SettingsPreserve))
if (ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.SettingsPreserve))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Software Settings Preservation is supported");
else
ataOneValue.Add("Software Settings Preservation is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SATAFeatures.HasFlag(Identify.SATAFeaturesBit.NCQAutoSense))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("NCQ Autosense is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.EnabledSATAFeatures.HasFlag(Identify.SATAFeaturesBit.EnabledSlumber))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
}
}
2019-11-02 21:37:09 +00:00
if ((ataIdentify.RemovableStatusSet & 0x03) > 0)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Removable Media Status Notification feature set is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.FreeFallSensitivity != 0x00 && ataIdentify.FreeFallSensitivity != 0xFF)
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"Free-fall sensitivity set to {ataIdentify.FreeFallSensitivity}");
2019-11-02 21:37:09 +00:00
if (ataIdentify.DataSetMgmt.HasFlag(Identify.DataSetMgmtBit.Trim)) ataOneValue.Add("TRIM is supported");
if (ataIdentify.DataSetMgmtSize > 0)
ataOneValue.Add(
$"DATA SET MANAGEMENT can receive a maximum of {ataIdentify.DataSetMgmtSize} blocks of 512 bytes");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Supported))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("<i>Security:</i>");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enabled))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("Security is enabled");
ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Locked)
2019-11-02 21:37:09 +00:00
? "Security is locked"
: "Security is not locked");
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Frozen)
2019-11-02 21:37:09 +00:00
? "Security is frozen"
: "Security is not frozen");
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Expired)
2019-11-02 21:37:09 +00:00
? "Security count has expired"
: "Security count has notexpired");
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Maximum)
2019-11-02 21:37:09 +00:00
? "Security level is maximum"
: "Security level is high");
}
else
{
ataOneValue.Add("Security is not enabled");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enhanced))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Supports enhanced security erase");
ataOneValue.Add($"{ataIdentify.SecurityEraseTime * 2} minutes to complete secure erase");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SecurityStatus.HasFlag(Identify.SecurityStatusBit.Enhanced))
2019-11-02 01:40:41 +00:00
ataOneValue
2019-11-02 21:37:09 +00:00
.Add($"{ataIdentify.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"Master password revision code: {ataIdentify.MasterPasswordRevisionCode}");
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) &&
!ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear) &&
ataIdentify.CommandSet3.HasFlag(Identify.CommandSetBit3.Streaming))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("<i>Streaming:</i>");
ataOneValue.Add($"Minimum request size is {ataIdentify.StreamMinReqSize}");
ataOneValue.Add($"Streaming transfer time in PIO is {ataIdentify.StreamTransferTimePIO}");
ataOneValue.Add($"Streaming transfer time in DMA is {ataIdentify.StreamTransferTimeDMA}");
ataOneValue.Add($"Streaming access latency is {ataIdentify.StreamAccessLatency}");
ataOneValue.Add($"Streaming performance granularity is {ataIdentify.StreamPerformanceGranularity}");
}
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.Supported))
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("<i>S.M.A.R.T. Command Transport (SCT):</i>");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.LongSectorAccess))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SCT Long Sector Address is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.WriteSame))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SCT Write Same is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.ErrorRecoveryControl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SCT Error Recovery Control is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.FeaturesControl))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SCT Features Control is supported");
2019-11-02 21:37:09 +00:00
if (ataIdentify.SCTCommandTransport.HasFlag(Identify.SCTCommandTransportBit.DataTables))
2019-11-02 01:40:41 +00:00
ataOneValue.Add("SCT Data Tables are supported");
}
2019-11-02 21:37:09 +00:00
if ((ataIdentify.NVCacheCaps & 0x0010) == 0x0010)
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add("<i>Non-Volatile Cache:</i>");
ataOneValue.Add($"Version {(ataIdentify.NVCacheCaps & 0xF000) >> 12}");
2019-11-02 21:37:09 +00:00
if ((ataIdentify.NVCacheCaps & 0x0001) == 0x0001)
2019-11-02 01:40:41 +00:00
{
ataOneValue.Add((ataIdentify.NVCacheCaps & 0x0002) == 0x0002
2019-11-02 21:37:09 +00:00
? "Power mode feature set is supported and enabled"
: "Power mode feature set is supported");
2019-11-02 01:40:41 +00:00
ataOneValue.Add($"Version {(ataIdentify.NVCacheCaps & 0x0F00) >> 8}");
}
ataOneValue.Add($"Non-Volatile Cache is {ataIdentify.NVCacheSize * logicalsectorsize} bytes");
}
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities != null)
2019-11-02 01:40:41 +00:00
{
removable = false;
ataOneValue.Add("");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.NominalRotationRate != null &&
ataReport.ReadCapabilities.NominalRotationRate != 0x0000 &&
ataReport.ReadCapabilities.NominalRotationRate != 0xFFFF)
2019-11-02 01:40:41 +00:00
ataOneValue.Add(ataReport.ReadCapabilities.NominalRotationRate == 0x0001
2019-11-02 21:37:09 +00:00
? "Device does not rotate."
: $"Device rotates at {ataReport.ReadCapabilities.NominalRotationRate} rpm");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (!atapi)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.BlockSize != null)
2019-11-02 01:40:41 +00:00
{
ataTwoValue.Add("Logical sector size", $"{ataReport.ReadCapabilities.BlockSize} bytes");
logicalsectorsize = ataReport.ReadCapabilities.BlockSize.Value;
}
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.PhysicalBlockSize != null)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Physical sector size",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
if (ataReport.ReadCapabilities.LongBlockSize != null)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("READ LONG sector size", $"{ataReport.ReadCapabilities.LongBlockSize} bytes");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.BlockSize != null &&
ataReport.ReadCapabilities.PhysicalBlockSize != null &&
ataReport.ReadCapabilities.BlockSize.Value !=
ataReport.ReadCapabilities.PhysicalBlockSize.Value &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x8000) == 0x0000 &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x4000) == 0x4000)
2019-11-02 01:40:41 +00:00
ataOneValue
2019-11-02 21:37:09 +00:00
.Add(
$"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.CHS != null && ataReport.ReadCapabilities.CurrentCHS != null)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
var currentSectors = ataReport.ReadCapabilities.CurrentCHS.Cylinders *
ataReport.ReadCapabilities.CurrentCHS.Heads *
2019-11-02 01:40:41 +00:00
ataReport.ReadCapabilities.CurrentCHS.Sectors;
ataTwoValue.Add("Cylinders",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.CHS.Cylinders} max., {ataReport.ReadCapabilities.CurrentCHS.Cylinders} current");
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Heads",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.CHS.Heads} max., {ataReport.ReadCapabilities.CurrentCHS.Heads} current");
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Sectors per track",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.CHS.Sectors} max., {ataReport.ReadCapabilities.CurrentCHS.Sectors} current");
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Sectors addressable in CHS mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.CHS.Cylinders * ataReport.ReadCapabilities.CHS.Heads * ataReport.ReadCapabilities.CHS.Sectors} max., {currentSectors} current");
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Device size in CHS mode",
2019-11-02 21:37:09 +00:00
$"{(ulong) currentSectors * logicalsectorsize} bytes, {(ulong) currentSectors * logicalsectorsize / 1000 / 1000} Mb, {(double) ((ulong) currentSectors * logicalsectorsize) / 1024 / 1024:F2} MiB");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
else if (ataReport.ReadCapabilities.CHS != null)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
var currentSectors = ataReport.ReadCapabilities.CHS.Cylinders *
ataReport.ReadCapabilities.CHS.Heads *
2019-11-02 01:40:41 +00:00
ataReport.ReadCapabilities.CHS.Sectors;
ataTwoValue.Add("Cylinders",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.CHS.Cylinders}");
ataTwoValue.Add("Heads", $"{ataReport.ReadCapabilities.CHS.Heads}");
ataTwoValue.Add("Sectors per track", $"{ataReport.ReadCapabilities.CHS.Sectors}");
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Sectors addressable in CHS mode", $"{currentSectors}");
ataTwoValue.Add("Device size in CHS mode",
2019-11-02 21:37:09 +00:00
$"{(ulong) currentSectors * logicalsectorsize} bytes, {(ulong) currentSectors * logicalsectorsize / 1000 / 1000} Mb, {(double) ((ulong) currentSectors * logicalsectorsize) / 1024 / 1024:F2} MiB");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.LBASectors != null)
2019-11-02 01:40:41 +00:00
{
ataTwoValue.Add("Sectors addressable in sectors in 28-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.LBASectors}");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if ((ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000000)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Device size in 28-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000 / 1000} Tb, {(double) ((ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if ((ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Device size in 28-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000} Gb, {(double) ((ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024:F2} GiB");
2019-11-02 01:40:41 +00:00
else
ataTwoValue.Add("Device size in 28-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000} Mb, {(double) ((ulong) ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024:F2} MiB");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.LBA48Sectors != null)
2019-11-02 01:40:41 +00:00
{
ataTwoValue.Add("Sectors addressable in sectors in 48-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.LBA48Sectors}");
2019-11-02 01:40:41 +00:00
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize / 1024 / 1024 > 1000000)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Device size in 48-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize / 1000 / 1000 / 1000 / 1000} Tb, {(double) (ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if (ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize / 1024 / 1024 > 1000)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Device size in 48-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize / 1000 / 1000 / 1000} Gb, {(double) (ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024:F2} GiB");
2019-11-02 01:40:41 +00:00
else
ataTwoValue.Add("Device size in 48-bit LBA mode",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize} bytes, {ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize / 1000 / 1000} Mb, {(double) (ataReport.ReadCapabilities.LBA48Sectors * logicalsectorsize) / 1024 / 1024:F2} MiB");
2019-11-02 01:40:41 +00:00
}
2019-11-02 21:37:09 +00:00
if (ata1 || cfa)
2019-11-02 01:40:41 +00:00
{
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.UnformattedBPT > 0)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Bytes per unformatted track",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.UnformattedBPT}");
if (ataReport.ReadCapabilities.UnformattedBPS > 0)
2019-11-02 01:40:41 +00:00
ataTwoValue.Add("Bytes per unformatted sector",
2019-11-02 21:37:09 +00:00
$"{ataReport.ReadCapabilities.UnformattedBPS}");
2019-11-02 01:40:41 +00:00
}
}
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadSectors == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ SECTOR(S) command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadRetry == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ SECTOR(S) RETRY command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadDma == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ DMA command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadDmaRetry == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ DMA RETRY command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLong == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ LONG command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLongRetry == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ LONG RETRY command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ SECTOR(S) command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadRetryLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ SECTOR(S) RETRY command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadDmaLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ DMA command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadDmaRetryLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ DMA RETRY command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLongLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ LONG command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLongRetryLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ LONG RETRY command in 28-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadLba48 == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ SECTOR(S) command in 48-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsReadDmaLba48 == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports READ DMA command in 48-bit LBA mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsSeek == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports SEEK command in CHS mode");
2019-11-02 21:37:09 +00:00
if (ataReport.ReadCapabilities.SupportsSeekLba == true)
2019-11-02 01:40:41 +00:00
ataOneValue.Add("Device supports SEEK command in 28-bit LBA mode");
}
2019-11-02 21:37:09 +00:00
else
{
testedMedia = ataReport.RemovableMedias;
}
2019-11-02 01:40:41 +00:00
}
}
}