2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2015-11-23 04:26:53 +00:00
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Errors.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2015-11-23 04:26:53 +00:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Component : Device structures decoders.
|
2015-11-23 04:26:53 +00:00
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Decodes ATA error registers.
|
2015-11-23 04:26:53 +00:00
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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
|
2015-11-23 04:26:53 +00:00
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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.
|
2015-11-23 04:26:53 +00:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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/>.
|
2015-11-23 04:26:53 +00:00
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2020-01-03 17:51:28 +00:00
|
|
|
// Copyright © 2011-2020 Natalia Portillo
|
2015-11-23 04:26:53 +00:00
|
|
|
// ****************************************************************************/
|
2016-07-28 18:13:49 +01:00
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2020-02-27 00:33:24 +00:00
|
|
|
namespace Aaru.Decoders.ATA
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaRegistersChs
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2017-12-22 02:04:18 +00:00
|
|
|
public byte Feature;
|
|
|
|
|
public byte SectorCount;
|
|
|
|
|
public byte Sector;
|
|
|
|
|
public byte CylinderLow;
|
|
|
|
|
public byte CylinderHigh;
|
|
|
|
|
public byte DeviceHead;
|
|
|
|
|
public byte Command;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaRegistersLba28
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2017-12-22 02:04:18 +00:00
|
|
|
public byte Feature;
|
|
|
|
|
public byte SectorCount;
|
|
|
|
|
public byte LbaLow;
|
|
|
|
|
public byte LbaMid;
|
|
|
|
|
public byte LbaHigh;
|
|
|
|
|
public byte DeviceHead;
|
|
|
|
|
public byte Command;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaRegistersLba48
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2017-12-22 02:04:18 +00:00
|
|
|
public ushort Feature;
|
|
|
|
|
public ushort SectorCount;
|
|
|
|
|
public ushort LbaLow;
|
|
|
|
|
public ushort LbaMid;
|
|
|
|
|
public ushort LbaHigh;
|
2019-11-25 00:54:38 +00:00
|
|
|
public byte DeviceHead;
|
|
|
|
|
public byte Command;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaErrorRegistersChs
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2017-12-22 02:04:18 +00:00
|
|
|
public byte Status;
|
|
|
|
|
public byte Error;
|
|
|
|
|
public byte SectorCount;
|
|
|
|
|
public byte Sector;
|
|
|
|
|
public byte CylinderLow;
|
|
|
|
|
public byte CylinderHigh;
|
|
|
|
|
public byte DeviceHead;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaErrorRegistersLba28
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2017-12-22 02:04:18 +00:00
|
|
|
public byte Status;
|
|
|
|
|
public byte Error;
|
|
|
|
|
public byte SectorCount;
|
|
|
|
|
public byte LbaLow;
|
|
|
|
|
public byte LbaMid;
|
|
|
|
|
public byte LbaHigh;
|
|
|
|
|
public byte DeviceHead;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2019-10-14 00:42:13 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2017-12-22 02:04:18 +00:00
|
|
|
public struct AtaErrorRegistersLba48
|
2015-11-23 04:26:53 +00:00
|
|
|
{
|
2019-11-25 00:54:38 +00:00
|
|
|
public byte Status;
|
|
|
|
|
public byte Error;
|
2017-12-22 02:04:18 +00:00
|
|
|
public ushort SectorCount;
|
|
|
|
|
public ushort LbaLow;
|
|
|
|
|
public ushort LbaMid;
|
|
|
|
|
public ushort LbaHigh;
|
2019-11-25 00:54:38 +00:00
|
|
|
public byte DeviceHead;
|
2015-11-23 04:26:53 +00:00
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
}
|