mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add packets for SCSI, ATA and SDHCI commands.
This commit is contained in:
@@ -30,8 +30,11 @@
|
||||
// Copyright © 2011-2019 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DiscImageChef.Decoders.ATA
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaRegistersChs
|
||||
{
|
||||
public byte Feature;
|
||||
@@ -43,6 +46,7 @@ namespace DiscImageChef.Decoders.ATA
|
||||
public byte Command;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaRegistersLba28
|
||||
{
|
||||
public byte Feature;
|
||||
@@ -54,6 +58,7 @@ namespace DiscImageChef.Decoders.ATA
|
||||
public byte Command;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaRegistersLba48
|
||||
{
|
||||
public ushort Feature;
|
||||
@@ -65,6 +70,7 @@ namespace DiscImageChef.Decoders.ATA
|
||||
public byte Command;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaErrorRegistersChs
|
||||
{
|
||||
public byte Status;
|
||||
@@ -76,6 +82,7 @@ namespace DiscImageChef.Decoders.ATA
|
||||
public byte DeviceHead;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaErrorRegistersLba28
|
||||
{
|
||||
public byte Status;
|
||||
@@ -87,6 +94,7 @@ namespace DiscImageChef.Decoders.ATA
|
||||
public byte DeviceHead;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaErrorRegistersLba48
|
||||
{
|
||||
public byte Status;
|
||||
|
||||
@@ -6,7 +6,17 @@ namespace DiscImageChef.Devices.Remote
|
||||
Hello = 1,
|
||||
CommandListDevices = 2,
|
||||
ResponseListDevices = 3,
|
||||
CommandOpen = 4
|
||||
CommandOpen = 4,
|
||||
CommandScsi = 5,
|
||||
ResponseScsi = 6,
|
||||
CommandAtaChs = 7,
|
||||
ResponseAtaChs = 8,
|
||||
CommandAtaLba28 = 9,
|
||||
ResponseAtaLba28 = 10,
|
||||
CommandAtaLba48 = 11,
|
||||
ResponseAtaLba48 = 12,
|
||||
CommandSdhci = 13,
|
||||
ResponseSdhci = 14
|
||||
}
|
||||
|
||||
public enum DicNopReason : byte
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using DiscImageChef.Decoders.ATA;
|
||||
|
||||
namespace DiscImageChef.Devices.Remote
|
||||
{
|
||||
@@ -77,4 +78,127 @@ namespace DiscImageChef.Devices.Remote
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
|
||||
public string device_path;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketCmdScsi
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint cdb_len;
|
||||
public uint buf_len;
|
||||
public int direction;
|
||||
public uint timeout;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketResScsi
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint sense_len;
|
||||
public uint buf_len;
|
||||
public uint duration;
|
||||
public uint sense;
|
||||
public uint errno;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketCmdAtaChs
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaRegistersChs registers;
|
||||
public byte protocol;
|
||||
public byte transferRegister;
|
||||
public byte transferBlocks;
|
||||
public byte spare;
|
||||
public uint timeout;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketResAtaChs
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaErrorRegistersChs registers;
|
||||
public uint duration;
|
||||
public uint sense;
|
||||
public uint errno;
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketCmdAtaLba28
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaRegistersLba28 registers;
|
||||
public byte protocol;
|
||||
public byte transferRegister;
|
||||
public byte transferBlocks;
|
||||
public byte spare;
|
||||
public uint timeout;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketResAtaLba28
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaErrorRegistersLba28 registers;
|
||||
public uint duration;
|
||||
public uint sense;
|
||||
public uint errno;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketCmdAtaLba48
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaRegistersLba48 registers;
|
||||
public byte protocol;
|
||||
public byte transferRegister;
|
||||
public byte transferBlocks;
|
||||
public byte spare;
|
||||
public uint timeout;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketResAtaLba48
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
public AtaErrorRegistersLba48 registers;
|
||||
public uint duration;
|
||||
public uint sense;
|
||||
public uint errno;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketCmdSdhci
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public MmcCommands command;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool write;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool application;
|
||||
public MmcFlags flags;
|
||||
public uint argument;
|
||||
public uint block_size;
|
||||
public uint blocks;
|
||||
public uint buf_len;
|
||||
public uint timeout;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct DicPacketResSdhci
|
||||
{
|
||||
public DicPacketHeader hdr;
|
||||
public uint buf_len;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public uint[] response;
|
||||
|
||||
public uint duration;
|
||||
public uint sense;
|
||||
public uint errno;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user