[Aaru.Devices] Reformat and cleanup.

This commit is contained in:
2023-10-03 23:12:01 +01:00
parent f6c3799a9e
commit 546573dd30
55 changed files with 3060 additions and 2138 deletions

View File

@@ -54,8 +54,8 @@ public partial class Device
Command = (byte)AtaCommands.ReadBuffer
};
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
Error = LastError != 0;
@@ -80,8 +80,8 @@ public partial class Device
Command = (byte)AtaCommands.ReadBufferDma
};
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
Error = LastError != 0;
@@ -98,8 +98,8 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count,
uint timeout, out double duration) =>
public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count,
uint timeout, out double duration) =>
ReadDma(out buffer, out statusRegisters, true, lba, count, timeout, out duration);
/// <summary>Reads sectors using 48-bit addressing and DMA transfer</summary>
@@ -112,7 +112,7 @@ public partial class Device
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadDma(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count,
uint timeout, out double duration)
uint timeout, out double duration)
{
buffer = count == 0 ? new byte[512 * 256] : new byte[512 * count];
@@ -128,8 +128,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
Error = LastError != 0;
@@ -149,8 +149,8 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadMultiple(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count,
uint timeout, out double duration)
public bool ReadMultiple(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, byte count,
uint timeout, out double duration)
{
buffer = count == 0 ? new byte[512 * 256] : new byte[512 * count];
@@ -166,8 +166,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
Error = LastError != 0;
@@ -182,7 +182,7 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadNativeMaxAddress(out uint lba, out AtaErrorRegistersLba28 statusRegisters, uint timeout,
public bool ReadNativeMaxAddress(out uint lba, out AtaErrorRegistersLba28 statusRegisters, uint timeout,
out double duration)
{
lba = 0;
@@ -195,8 +195,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
Error = LastError != 0;
@@ -235,8 +235,8 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count,
uint timeout, out double duration)
public bool Read(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba, byte count,
uint timeout, out double duration)
{
buffer = count == 0 ? new byte[512 * 256] : new byte[512 * count];
@@ -252,8 +252,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
Error = LastError != 0;
@@ -270,8 +270,8 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, uint blockSize,
uint timeout, out double duration) =>
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, uint lba, uint blockSize,
uint timeout, out double duration) =>
ReadLong(out buffer, out statusRegisters, true, lba, blockSize, timeout, out duration);
/// <summary>Reads a long sector using 28-bit addressing and PIO transfer, retrying on error</summary>
@@ -283,8 +283,8 @@ public partial class Device
/// <param name="timeout">Timeout to wait for command execution</param>
/// <param name="duration">Time the device took to execute the command in milliseconds</param>
/// <returns><c>true</c> if the device set an error condition, <c>false</c> otherwise</returns>
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba,
uint blockSize, uint timeout, out double duration)
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersLba28 statusRegisters, bool retry, uint lba,
uint blockSize, uint timeout, out double duration)
{
buffer = new byte[blockSize];
@@ -300,8 +300,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
ref buffer, timeout, true, out duration, out bool sense);
Error = LastError != 0;
@@ -331,8 +331,8 @@ public partial class Device
registers.DeviceHead += 0x40;
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData, AtaTransferRegister.NoTransfer,
ref buffer, timeout, false, out duration, out bool sense);
Error = LastError != 0;