mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Final cleanup of DiscImageChef.Devices.
This commit is contained in:
@@ -43,7 +43,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.ReadBuffer};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -60,7 +59,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.ReadBufferDma};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.NoTransfer,
|
||||
ref buffer, timeout, false, out duration, out bool sense);
|
||||
Error = LastError != 0;
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace DiscImageChef.Devices
|
||||
AtaRegistersLba48 registers =
|
||||
new AtaRegistersLba48 {Command = (byte)AtaCommands.NativeMaxAddress, Feature = 0x0000};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace DiscImageChef.Devices
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters)
|
||||
@@ -49,9 +49,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -61,9 +61,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -73,9 +73,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// Sends the ATA IDENTIFY DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -86,7 +86,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersChs registers = new AtaRegistersChs {Command = (byte)AtaCommands.IdentifyDevice};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -117,7 +116,6 @@ namespace DiscImageChef.Devices
|
||||
Command = retry ? (byte)AtaCommands.ReadDmaRetry : (byte)AtaCommands.ReadDma
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.Dma, AtaTransferRegister.SectorCount,
|
||||
ref buffer, timeout, true, out duration, out bool sense);
|
||||
Error = LastError != 0;
|
||||
@@ -141,7 +139,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -172,7 +169,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -204,7 +200,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.SectorCount, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
@@ -228,7 +223,6 @@ namespace DiscImageChef.Devices
|
||||
Sector = sector
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, true, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace DiscImageChef.Devices
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersChs statusRegisters)
|
||||
@@ -49,9 +49,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device, using default device timeout
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="duration">Duration.</param>
|
||||
@@ -61,9 +61,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -73,9 +73,9 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// Sends the ATA IDENTIFY PACKET DEVICE command to the device
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters"/> contains the error registers.</returns>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="statusRegisters" /> contains the error registers.</returns>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
/// <param name="statusRegisters">Status registers.</param>
|
||||
/// <param name="timeout">Timeout.</param>
|
||||
@@ -86,7 +86,6 @@ namespace DiscImageChef.Devices
|
||||
buffer = new byte[512];
|
||||
AtaRegistersChs registers = new AtaRegistersChs {Command = (byte)AtaCommands.IdentifyPacketDevice};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace DiscImageChef.Devices
|
||||
DeviceHead = (byte)(head & 0x0F)
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -92,7 +91,6 @@ namespace DiscImageChef.Devices
|
||||
byte[] buffer = new byte[0];
|
||||
AtaRegistersLba28 registers = new AtaRegistersLba28 {Command = (byte)AtaCommands.RequestSense};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace DiscImageChef.Devices
|
||||
AtaRegistersChs registers =
|
||||
new AtaRegistersChs {Command = (byte)AtaCommands.CheckMediaCardType, Feature = feature};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -72,7 +71,6 @@ namespace DiscImageChef.Devices
|
||||
SectorCount = 0xF1
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -95,7 +93,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -117,7 +114,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -141,7 +137,6 @@ namespace DiscImageChef.Devices
|
||||
LbaLow = subcommand
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -164,7 +159,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -188,7 +182,6 @@ namespace DiscImageChef.Devices
|
||||
LbaLow = logAddress
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
@@ -210,7 +203,6 @@ namespace DiscImageChef.Devices
|
||||
LbaMid = 0x4F
|
||||
};
|
||||
|
||||
|
||||
LastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData,
|
||||
AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration,
|
||||
out bool sense);
|
||||
|
||||
Reference in New Issue
Block a user