diff --git a/DiscImageChef.Devices/ChangeLog b/DiscImageChef.Devices/ChangeLog index 7e822654..10b64735 100644 --- a/DiscImageChef.Devices/ChangeLog +++ b/DiscImageChef.Devices/ChangeLog @@ -1,3 +1,15 @@ +2015-10-19 Natalia Portillo + + * Enums.cs: + * Structs.cs: + * Command.cs: + * Linux/Command.cs: + * Device/Commands.cs: + * Device/AtaCommands.cs: + * Device/ScsiCommands.cs: + * Device/AtapiCommands.cs: + Moved devices enums and structs out of classes. + 2015-10-19 Natalia Portillo * Device/ScsiCommands.cs: diff --git a/DiscImageChef.Devices/Command.cs b/DiscImageChef.Devices/Command.cs index 9cb5637e..3ef6cce0 100644 --- a/DiscImageChef.Devices/Command.cs +++ b/DiscImageChef.Devices/Command.cs @@ -56,7 +56,7 @@ namespace DiscImageChef.Devices /// SCSI command transfer direction /// Time it took to execute the command in milliseconds /// True if SCSI error returned non-OK status and contains SCSI sense - public static int SendScsiCommand(object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, Enums.ScsiDirection direction, out double duration, out bool sense) + public static int SendScsiCommand(object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); @@ -76,7 +76,7 @@ namespace DiscImageChef.Devices /// SCSI command transfer direction /// Time it took to execute the command in milliseconds /// True if SCSI error returned non-OK status and contains SCSI sense - public static int SendScsiCommand(Interop.PlatformID ptID, object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, Enums.ScsiDirection direction, out double duration, out bool sense) + public static int SendScsiCommand(Interop.PlatformID ptID, object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { switch (ptID) { @@ -86,10 +86,10 @@ namespace DiscImageChef.Devices switch (direction) { - case Enums.ScsiDirection.In: + case ScsiDirection.In: dir = Windows.ScsiIoctlDirection.In; break; - case Enums.ScsiDirection.Out: + case ScsiDirection.Out: dir = Windows.ScsiIoctlDirection.Out; break; default: @@ -105,16 +105,16 @@ namespace DiscImageChef.Devices switch (direction) { - case Enums.ScsiDirection.In: + case ScsiDirection.In: dir = Linux.ScsiIoctlDirection.In; break; - case Enums.ScsiDirection.Out: + case ScsiDirection.Out: dir = Linux.ScsiIoctlDirection.Out; break; - case Enums.ScsiDirection.Bidirectional: + case ScsiDirection.Bidirectional: dir = Linux.ScsiIoctlDirection.Unspecified; break; - case Enums.ScsiDirection.None: + case ScsiDirection.None: dir = Linux.ScsiIoctlDirection.None; break; default: @@ -129,9 +129,9 @@ namespace DiscImageChef.Devices } } - public static int SendAtaCommand(object fd, Structs.AtaRegistersCHS registers, - out Structs.AtaErrorRegistersCHS errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(object fd, AtaRegistersCHS registers, + out AtaErrorRegistersCHS errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); @@ -140,9 +140,9 @@ namespace DiscImageChef.Devices transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - public static int SendAtaCommand(Interop.PlatformID ptID, object fd, Structs.AtaRegistersCHS registers, - out Structs.AtaErrorRegistersCHS errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(Interop.PlatformID ptID, object fd, AtaRegistersCHS registers, + out AtaErrorRegistersCHS errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch (ptID) @@ -161,9 +161,9 @@ namespace DiscImageChef.Devices } } - public static int SendAtaCommand(object fd, Structs.AtaRegistersLBA28 registers, - out Structs.AtaErrorRegistersLBA28 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(object fd, AtaRegistersLBA28 registers, + out AtaErrorRegistersLBA28 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); @@ -172,9 +172,9 @@ namespace DiscImageChef.Devices transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - public static int SendAtaCommand(Interop.PlatformID ptID, object fd, Structs.AtaRegistersLBA28 registers, - out Structs.AtaErrorRegistersLBA28 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(Interop.PlatformID ptID, object fd, AtaRegistersLBA28 registers, + out AtaErrorRegistersLBA28 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch (ptID) @@ -193,9 +193,9 @@ namespace DiscImageChef.Devices } } - public static int SendAtaCommand(object fd, Structs.AtaRegistersLBA48 registers, - out Structs.AtaErrorRegistersLBA48 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(object fd, AtaRegistersLBA48 registers, + out AtaErrorRegistersLBA48 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); @@ -204,9 +204,9 @@ namespace DiscImageChef.Devices transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - public static int SendAtaCommand(Interop.PlatformID ptID, object fd, Structs.AtaRegistersLBA48 registers, - out Structs.AtaErrorRegistersLBA48 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public static int SendAtaCommand(Interop.PlatformID ptID, object fd, AtaRegistersLBA48 registers, + out AtaErrorRegistersLBA48 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch (ptID) diff --git a/DiscImageChef.Devices/Device/AtaCommands.cs b/DiscImageChef.Devices/Device/AtaCommands.cs index 4566dee1..06891ae9 100644 --- a/DiscImageChef.Devices/Device/AtaCommands.cs +++ b/DiscImageChef.Devices/Device/AtaCommands.cs @@ -48,7 +48,7 @@ namespace DiscImageChef.Devices /// true if the command failed and contains the error registers. /// Buffer. /// Status registers. - public bool AtaIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters) + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters) { return AtaIdentify(out buffer, out statusRegisters, Timeout); } @@ -60,7 +60,7 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Duration. - public bool AtaIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, out double duration) + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, out double duration) { return AtaIdentify(out buffer, out statusRegisters, Timeout, out duration); } @@ -72,7 +72,7 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Timeout. - public bool AtaIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, uint timeout) + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, uint timeout) { double duration; return AtaIdentify(out buffer, out statusRegisters, timeout, out duration); @@ -86,15 +86,15 @@ namespace DiscImageChef.Devices /// Status registers. /// Timeout. /// Duration. - public bool AtaIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, uint timeout, out double duration) + public bool AtaIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, uint timeout, out double duration) { buffer = new byte[512]; - Structs.AtaRegistersCHS registers = new Structs.AtaRegistersCHS(); + AtaRegistersCHS registers = new AtaRegistersCHS(); bool sense; - registers.command = (byte)Enums.AtaCommands.IdentifyDevice; + registers.command = (byte)AtaCommands.IdentifyDevice; - lastError = SendAtaCommand(registers, out statusRegisters, Enums.AtaProtocol.PioIn, Enums.AtaTransferRegister.NoTransfer, + lastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration, out sense); error = lastError != 0; diff --git a/DiscImageChef.Devices/Device/AtapiCommands.cs b/DiscImageChef.Devices/Device/AtapiCommands.cs index a874237e..93366871 100644 --- a/DiscImageChef.Devices/Device/AtapiCommands.cs +++ b/DiscImageChef.Devices/Device/AtapiCommands.cs @@ -48,7 +48,7 @@ namespace DiscImageChef.Devices /// true if the command failed and contains the error registers. /// Buffer. /// Status registers. - public bool AtapiIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters) + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters) { return AtapiIdentify(out buffer, out statusRegisters, Timeout); } @@ -60,7 +60,7 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Duration. - public bool AtapiIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, out double duration) + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, out double duration) { return AtapiIdentify(out buffer, out statusRegisters, Timeout, out duration); } @@ -72,7 +72,7 @@ namespace DiscImageChef.Devices /// Buffer. /// Status registers. /// Timeout. - public bool AtapiIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, uint timeout) + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, uint timeout) { double duration; return AtapiIdentify(out buffer, out statusRegisters, timeout, out duration); @@ -86,15 +86,15 @@ namespace DiscImageChef.Devices /// Status registers. /// Timeout. /// Duration. - public bool AtapiIdentify(out byte[] buffer, out Structs.AtaErrorRegistersCHS statusRegisters, uint timeout, out double duration) + public bool AtapiIdentify(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, uint timeout, out double duration) { buffer = new byte[512]; - Structs.AtaRegistersCHS registers = new Structs.AtaRegistersCHS(); + AtaRegistersCHS registers = new AtaRegistersCHS(); bool sense; - registers.command = (byte)Enums.AtaCommands.IdentifyPacketDevice; + registers.command = (byte)AtaCommands.IdentifyPacketDevice; - lastError = SendAtaCommand(registers, out statusRegisters, Enums.AtaProtocol.PioIn, Enums.AtaTransferRegister.NoTransfer, + lastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.NoTransfer, ref buffer, timeout, false, out duration, out sense); error = lastError != 0; diff --git a/DiscImageChef.Devices/Device/Commands.cs b/DiscImageChef.Devices/Device/Commands.cs index 4a5441f4..7ece5d35 100644 --- a/DiscImageChef.Devices/Device/Commands.cs +++ b/DiscImageChef.Devices/Device/Commands.cs @@ -52,7 +52,7 @@ namespace DiscImageChef.Devices /// SCSI command transfer direction /// Time it took to execute the command in milliseconds /// True if SCSI command returned non-OK status and contains SCSI sense - public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, Enums.ScsiDirection direction, out double duration, out bool sense) + public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { return Command.SendScsiCommand(platformID, fd, cdb, ref buffer, out senseBuffer, timeout, direction, out duration, out sense); } @@ -70,8 +70,8 @@ namespace DiscImageChef.Devices /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in bytes. /// Time it took to execute the command in milliseconds /// True if ATA/ATAPI command returned non-OK status - public int SendAtaCommand(Structs.AtaRegistersCHS registers, out Structs.AtaErrorRegistersCHS errorRegisters, - Enums.AtaProtocol protocol, Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public int SendAtaCommand(AtaRegistersCHS registers, out AtaErrorRegistersCHS errorRegisters, + AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { return Command.SendAtaCommand(platformID, fd, registers, out errorRegisters, protocol, transferRegister, @@ -91,8 +91,8 @@ namespace DiscImageChef.Devices /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in bytes. /// Time it took to execute the command in milliseconds /// True if ATA/ATAPI command returned non-OK status - public int SendAtaCommand(Structs.AtaRegistersLBA28 registers, out Structs.AtaErrorRegistersLBA28 errorRegisters, - Enums.AtaProtocol protocol, Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public int SendAtaCommand(AtaRegistersLBA28 registers, out AtaErrorRegistersLBA28 errorRegisters, + AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { return Command.SendAtaCommand(platformID, fd, registers, out errorRegisters, protocol, transferRegister, @@ -112,8 +112,8 @@ namespace DiscImageChef.Devices /// If set to true, transfer is indicated in blocks, otherwise, it is indicated in bytes. /// Time it took to execute the command in milliseconds /// True if ATA/ATAPI command returned non-OK status - public int SendAtaCommand(Structs.AtaRegistersLBA48 registers, out Structs.AtaErrorRegistersLBA48 errorRegisters, - Enums.AtaProtocol protocol, Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + public int SendAtaCommand(AtaRegistersLBA48 registers, out AtaErrorRegistersLBA48 errorRegisters, + AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { return Command.SendAtaCommand(platformID, fd, registers, out errorRegisters, protocol, transferRegister, diff --git a/DiscImageChef.Devices/Device/ScsiCommands.cs b/DiscImageChef.Devices/Device/ScsiCommands.cs index fef69af5..d765fdd3 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands.cs @@ -90,10 +90,10 @@ namespace DiscImageChef.Devices { buffer = new byte[5]; senseBuffer = new byte[32]; - byte[] cdb = { (byte)Enums.ScsiCommands.Inquiry, 0, 0, 0, 5, 0 }; + byte[] cdb = { (byte)ScsiCommands.Inquiry, 0, 0, 0, 5, 0 }; bool sense; - lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense); + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); error = lastError != 0; if (sense) @@ -101,11 +101,11 @@ namespace DiscImageChef.Devices byte pagesLength = (byte)(buffer[4] + 5); - cdb = new byte[] { (byte)Enums.ScsiCommands.Inquiry, 0, 0, 0, pagesLength, 0 }; + cdb = new byte[] { (byte)ScsiCommands.Inquiry, 0, 0, 0, pagesLength, 0 }; buffer = new byte[pagesLength]; senseBuffer = new byte[32]; - lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense); + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); error = lastError != 0; DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration); @@ -165,10 +165,10 @@ namespace DiscImageChef.Devices { buffer = new byte[5]; senseBuffer = new byte[32]; - byte[] cdb = { (byte)Enums.ScsiCommands.Inquiry, 1, page, 0, 5, 0 }; + byte[] cdb = { (byte)ScsiCommands.Inquiry, 1, page, 0, 5, 0 }; bool sense; - lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense); + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); error = lastError != 0; if (sense) @@ -176,11 +176,11 @@ namespace DiscImageChef.Devices byte pagesLength = (byte)(buffer[3] + 4); - cdb = new byte[] { (byte)Enums.ScsiCommands.Inquiry, 1, page, 0, pagesLength, 0 }; + cdb = new byte[] { (byte)ScsiCommands.Inquiry, 1, page, 0, pagesLength, 0 }; buffer = new byte[pagesLength]; senseBuffer = new byte[32]; - lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense); + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); error = lastError != 0; DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration); diff --git a/DiscImageChef.Devices/Enums.cs b/DiscImageChef.Devices/Enums.cs index 7f5696c1..62dd41b9 100644 --- a/DiscImageChef.Devices/Enums.cs +++ b/DiscImageChef.Devices/Enums.cs @@ -40,2482 +40,2528 @@ using System; namespace DiscImageChef.Devices { - public static class Enums + #region ATA Commands + /// + /// All known ATA commands + /// + public enum AtaCommands : byte { - #region ATA Commands - /// - /// All known ATA commands - /// - public enum AtaCommands : byte - { - #region Commands defined on Western Digital WD1000 Winchester Disk Controller - /// - /// Formats a track - /// - FormatTrack = 0x50, - /// - /// Reads sectors - /// - ReadOld = 0x20, - /// - /// Reads sectors using DMA - /// - ReadDmaOld = 0x28, - /// - /// Calibrates the position of the heads - /// Includes all commands from 0x10 to 0x1F - /// - Restore = 0x10, - /// - /// Seeks to a certain cylinder - /// - Seek = 0x70, - /// - /// Writes sectors - /// - WriteOld = 0x30, - #endregion Commands defined on Western Digital WD1000 Winchester Disk Controller - - #region Commands defined on ATA rev. 4c - /// - /// Acknowledges media change - /// - AckMediaChange = 0xDB, - /// - /// Sends vendor-specific information that may be required in order to pass diagnostics - /// - PostBoot = 0xDC, - /// - /// Prepares a removable drive to respond to boot - /// - PreBoot = 0xDD, - /// - /// Checks drive power mode - /// - CheckPowerMode = 0xE5, - /// - /// Checks drive power mode - /// - CheckPowerModeAlternate = 0x98, - /// - /// Locks the door of the drive - /// - DoorLock = 0xDE, - /// - /// Unlocks the door of the drive - /// - DoorUnLock = 0xDF, - /// - /// Executes internal drive diagnostics - /// - ExecuteDriveDiagnostic = 0x90, - /// - /// Gets a sector containing drive identification and capabilities - /// - IdentifyDrive = 0xEC, - /// - /// Requests the drive to enter idle status - /// - Idle = 0xE3, - /// - /// Requests the drive to enter idle status - /// - IdleAlternate = 0x97, - /// - /// Requests the drive to enter idle status immediately - /// - IdleImmediate = 0xE1, - /// - /// Requests the drive to enter idle status immediately - /// - IdleImmediateAlternate = 0x95, - /// - /// Changes heads and sectors per cylinder for the drive - /// - InitializeDriveParameters = 0x91, - /// - /// Does nothing - /// - Nop = 0x00, - /// - /// Reads sectors using PIO transfer - /// - Read = 0x21, - /// - /// Reads the content of the drive's buffer - /// - ReadBuffer = 0xE4, - /// - /// Reads sectors using DMA transfer - /// - ReadDma = 0xC9, - /// - /// Reads sectors using DMA transfer, retrying on error - /// - ReadDmaRetry = 0xC8, - /// - /// Reads a sector including ECC bytes without checking them - /// - ReadLong = 0x23, - /// - /// Reads a sector including ECC bytes without checking them, retrying on error - /// - ReadLongRetry = 0x22, - /// - /// Reads multiple sectors generating interrupts at block transfers - /// - ReadMultiple = 0xC4, - /// - /// Reads sectors using PIO transfer, retrying on error - /// - ReadRetry = 0x20, - /// - /// Verifies sectors readability without transferring them - /// - ReadVerify = 0x41, - /// - /// Verifies sectors readability without transferring them, retrying on error - /// - ReadVerifyRetry = 0x40, - /// - /// Moves the heads to cylinder 0 - /// - Recalibrate = Restore, - /// - /// Sets drive parameters - /// - SetFeatures = 0xEF, - /// - /// Enables and and sets the block length for these commands - /// - SetMultipleMode = 0xC6, - /// - /// Causes the drive to stop and sleep until a hardware or software reset - /// - Sleep = 0xE6, - /// - /// Causes the drive to stop and sleep until a hardware or software reset - /// - SleepAlternate = 0x99, - /// - /// Sets the drive to enter Standby mode - /// - Standby = 0xE2, - /// - /// Sets the drive to enter Standby mode - /// - StandbyAlternate = 0x96, - /// - /// Sets the drive to enter Standby mode, immediately - /// - StandbyImmediate = 0xE0, - /// - /// Sets the drive to enter Standby mode, immediately - /// - StandbyImmediateAlternate = 0x94, - /// - /// Writes sectors using PIO transfer - /// - Write = 0x31, - /// - /// Writes data to the drive's sector buffer - /// - WriteBuffer = 0xE8, - /// - /// Writes sectors using DMA transfer - /// - WriteDma = 0xCB, - /// - /// Writes sectors using DMA transfer, retrying on error - /// - WriteDmaRetry = 0xCA, - /// - /// Writes sectors with custom ECC - /// - WriteLong = 0x33, - /// - /// Writes sectors with custom ECC, retrying on error - /// - WriteLongRetry = 0x32, - /// - /// Writes several sectors at once setting interrupts on end of block - /// - WriteMultiple = 0xC5, - /// - /// Writes the same data to several sector - /// - WriteSame = 0xE9, - /// - /// Writes sectors using PIO transfer, retrying on error - /// - WriteRetry = 0x30, - /// - /// Writes sectors verifying them immediately after write - /// - WriteVerify = 0x3C, - /// - /// Unknown vendor command - /// - Vendor_8x = 0x80, - /// - /// Unknown vendor command - /// - Vendor_9A = 0x9A, - /// - /// Unknown vendor command - /// - Vendor_C0 = 0xC0, - /// - /// Unknown vendor command - /// - Vendor_C1 = 0xC1, - /// - /// Unknown vendor command - /// - Vendor_C2 = 0xC2, - /// - /// Unknown vendor command - /// - Vendor_C3 = 0xC3, - /// - /// Unknown vendor command - /// - Vendor_F0 = 0xF0, - /// - /// Unknown vendor command - /// - Vendor_F1 = 0xF1, - /// - /// Unknown vendor command - /// - Vendor_F2 = 0xF2, - /// - /// Unknown vendor command - /// - Vendor_F3 = 0xF3, - /// - /// Unknown vendor command - /// - Vendor_F4 = 0xF4, - /// - /// Unknown vendor command - /// - Vendor_F5 = 0xF5, - /// - /// Unknown vendor command - /// - Vendor_F6 = 0xF6, - /// - /// Unknown vendor command - /// - Vendor_F7 = 0xF7, - /// - /// Unknown vendor command - /// - Vendor_F8 = 0xF8, - /// - /// Unknown vendor command - /// - Vendor_F9 = 0xF9, - /// - /// Unknown vendor command - /// - Vendor_FA = 0xFA, - /// - /// Unknown vendor command - /// - Vendor_FB = 0xFB, - /// - /// Unknown vendor command - /// - Vendor_FC = 0xFC, - /// - /// Unknown vendor command - /// - Vendor_FD = 0xFD, - /// - /// Unknown vendor command - /// - Vendor_FE = 0xFE, - /// - /// Unknown vendor command - /// - Vendor_FF = 0xFF, - #endregion Commands defined on ATA rev. 4c - - #region Commands defined on ATA-2 rev. 4c - /// - /// Alters the device microcode - /// - DownloadMicrocode = 0x92, - /// - /// Ejects the removable medium on the device - /// - MediaEject = 0xED, - #endregion Commands defined on ATA-2 rev. 4c - - #region Commands defined on ATA-3 rev. 7b - /// - /// Gets a sector containing drive identification and capabilities - /// - IdentifyDriveDma = 0xEE, - /// - /// Disables the security lock - /// - SecurityDisablePassword = 0xF6, - /// - /// Enables usage of command - /// - SecurityErasePrepare = 0xF3, - /// - /// Erases all user data and isables the security lock - /// - SecurityEraseUnit = 0xF4, - /// - /// Sets the security freeze lock preventing any security command from working until hardware reset - /// - SecurityFreezeLock = 0xF5, - /// - /// Sets the device user or master password - /// - SecuritySetPassword = 0xF1, - /// - /// Unlocks device - /// - SecurityUnlock = 0xF2, - /// - /// SMART operations - /// - Smart = 0xB0, - #endregion Commands defined on ATA-3 rev. 7b - - #region Commands defined on CompactFlash Specification - /// - /// Pre-erases and conditions data sectors - /// - EraseSectors = 0xC0, - /// - /// Requests extended error information - /// - RequestSense = 0x03, - /// - /// Provides a way to determine the exact number of times a sector has been erases and programmed - /// - TranslateSector = 0x87, - /// - /// For CompactFlash cards that do not support security mode, this commands is equal to - /// For those that do, this command is equal to - /// - WearLevel = 0xF5, - /// - /// Writes a block of sectors without erasing them previously - /// - WriteMultipleWithoutErase = 0xCD, - /// - /// Writes sectors without erasing them previously - /// - WriteWithoutErase = 0x38, - #endregion Commands defined on CompactFlash Specification - - #region Commands defined on ATA/ATAPI-4 rev. 18 - /// - /// Resets a device - /// - DeviceReset = 0x08, - /// - /// Requests the device to flush the write cache and write it to the media - /// - FlushCache = 0xE7, - /// - /// Gets media status - /// - GetMediaStatus = 0xDA, - /// - /// Gets a sector containing drive identification and capabilities, for ATA devices - /// - IdentifyDevice = IdentifyDrive, - /// - /// Gets a sector containing drive identification and capabilities, for ATAPI devices - /// - IdentifyPacketDevice = 0xA1, - /// - /// Locks the media on the device - /// - MediaLock = DoorLock, - /// - /// Unlocks the media on the device - /// - MediaUnLock = DoorUnLock, - /// - /// Sends a command packet - /// - Packet = 0xA0, - /// - /// Queues a read of sectors - /// - ReadDmaQueued = 0xC7, - /// - /// Returns the native maximum address in factory default condition - /// - ReadNativeMaxAddress = 0xF8, - /// - /// Used to provide data transfer and/or status of a previous command (queue or packet) - /// - Service = 0xA2, - /// - /// Redefines the maximum user-accessible address space - /// - SetMaxAddress = 0xF9, - /// - /// Queues a write of sectors - /// - WriteDmaQueued = 0xCC, - #endregion Commands defined on ATA/ATAPI-4 rev. 18 - - #region Commands defined on ATA/ATAPI-6 rev. 3b - /// - /// Determines if the device supports the Media Card Pass Through Command feature set - /// - CheckMediaCardType = 0xD1, - /// - /// Device Configuration Overlay feature set - /// - DevideConfiguration = 0xB1, - /// - /// Requests the device to flush the write cache and write it to the media (48-bit) - /// - FlushCacheExt = 0xEA, - /// - /// Reads sectors using DMA transfer, retrying on error (48-bit) - /// - ReadDmaExt = 0x25, - /// (48-bit) - /// Queues a read of sectors - /// - ReadDmaQueuedExt = 0x26, - /// - /// Reads sectors using PIO transfer, retrying on error (48-bit) - /// - ReadExt = 0x24, - /// - /// Returns the indicated log to the host (48-bit) - /// - ReadLogExt = 0x2F, - /// - /// Reads multiple sectors generating interrupts at block transfers (48-bit) - /// - ReadMultipleExt = 0x29, - /// - /// Returns the native maximum address in factory default condition (48-bit) - /// - ReadNativeMaxAddressExt = 0x27, - /// - /// Verifies sectors readability without transferring them, retrying on error (48-bit) - /// - ReadVerifyExt = 0x42, - /// - /// Sends a SET MAX subcommand, - /// - SetMaxCommands = 0xF9, - /// - /// Redefines the maximum user-accessible address space (48-bit) - /// - SetMaxAddressExt = 0x37, - /// - /// Writes sectors using DMA transfer, retrying on error (48-bit) - /// - WriteDmaExt = 0x35, - /// - /// Queues a write of sectors (48-bit) - /// - WriteDmaQueuedExt = 0x36, - /// - /// Writes sectors using PIO transfer, retrying on error (48-bit) - /// - WriteExt = 0x34, - /// - /// Writes data to the indicated log (48-bit) - /// - WriteLogExt = 0x3F, - /// - /// Writes several sectors at once setting interrupts on end of block (48-bit) - /// - WriteMultipleExt = 0x39, - #endregion Commands defined on ATA/ATAPI-6 rev. 3b - - #region Commands defined on ATA/ATAPI-7 rev. 4b - /// - /// Configurates the operating parameters for a stream - /// - ConfigureStream = 0x51, - /// - /// Reads data on an alloted time using DMA - /// - ReadStreamDmaExt = 0x2A, - /// - /// Reads data on an alloted time using PIO - /// - ReadStreamExt = 0x2B, - /// - /// Writes data on an alloted time using DMA - /// - WriteStreamDmaExt = 0x3A, - /// - /// Writes data on an alloted time using PIO - /// - WriteStreamExt = 0x3B, - #endregion Commands defined on ATA/ATAPI-7 rev. 4b - - #region Commands defined on ATA/ATAPI-8 rev. 3f - /// - /// Sends a Non Volatile Cache subcommand. - /// - NonVolatileCacheCommand = 0xB6, - /// - /// Retrieves security protocol information or the results from commands - /// - TrustedReceive = 0x5C, - /// - /// Retrieves security protocol information or the results from commands, using DMA transfers - /// - TrustedReceiveDma = 0x5D, - /// - /// Sends one or more Security Protocol commands - /// - TrustedSend = 0x5E, - /// - /// Sends one or more Security Protocol commands, using DMA transfers - /// - TrustedSendDma = 0x5F, - /// - /// Writes sectors using DMA transfer, retrying on error (48-bit), not returning until the operation is complete - /// - WriteDmaFuaExt = 0x3D, - /// - /// Queues a write of sectors (48-bit), not returning until the operation is complete - /// - WriteDmaQueuedFuaExt = 0x3E, - /// - /// Writes several sectors at once setting interrupts on end of block (48-bit), not returning until the operation is complete - /// - WriteMultipleFuaExt = 0xCE, - /// - /// Writes a sector that will give an uncorrectable error on any read operation - /// - WriteUncorrectableExt = 0x45, - #endregion Commands defined on ATA/ATAPI-8 rev. 3f - - #region Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 - /// - /// Provides information for device optimization - /// In SSDs, this contains trimming - /// - DataSetManagement = 0x06, - /// - /// Alters the device microcode, using DMA transfers - /// - DownloadMicrocodeDma = 0x93, - /// - /// Reads the content of the drive's buffer, using DMA transfers - /// - ReadBufferDma = 0xE9, - /// - /// Reads sectors using NCQ - /// - ReadFpDmaQueued = 0x60, - /// - /// Returns the indicated log to the host (48-bit) - /// - ReadLogDmaExt = 0x47, - /// - /// Requests SPC-4 style error data - /// - RequestSenseDataExt = 0x0B, - SanitizeCommands = 0xB4, - /// - /// Executes a Security Protocol command that does not require a transfer of data - /// - TrustedNonData = 0x5B, - /// - /// Writes data to the drive's sector buffer, using DMA transfers - /// - WriteBufferDma = 0xE8, - /// - /// Writes sectors using NCQ - /// - WriteFpDmaQueued = 0x61, - #endregion Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 - - #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - /// - /// Sends - /// - NCQQueueManagement = 0x63, - /// - /// Sets the device date and time - /// - SetDateAndTimeExt = 0x77 - #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - } - #endregion ATA Commands - - #region ATA SMART SubCommands - /// - /// All known ATA SMART sub-commands - /// - public enum AtaSmartSubCommands : byte - { - #region Commands defined on ATA-3 rev. 7b - /// - /// Disables all SMART capabilities - /// - Disable = 0xD9, - /// - /// Enables/disables SMART attribute autosaving - /// - EnableDisableAttributeAutosave = 0xD2, - /// - /// Enables all SMART capabilities - /// - Enable = 0xD8, - /// - /// Returns the device's SMART attributes thresholds - /// - ReadAttributeThresholds = 0xD1, - /// - /// Returns the device's SMART attributes values - /// - ReadAttributeValues = 0xD0, - /// - /// Communicates device reliability status - /// - ReturnStatus = 0xDA, - /// - /// Saves any attribute values immediately - /// - SaveAttributeValues = 0xD3, - #endregion Commands defined on ATA-3 rev. 7b - - #region Commands defined on ATA/ATAPI-4 rev. 18 - /// - /// Causes the device to immediately initiate a SMART data collection and saves it to the device - /// - ExecuteOfflineImmediate = 0xD4, - /// - /// Returns the device's SMART attributes values - /// - ReadData = ReadAttributeValues, - #endregion Commands defined on ATA/ATAPI-4 rev. 18 - - #region Commands defined on ATA/ATAPI-5 rev. 3 - /// - /// Returns the indicated log to the host - /// - ReadLog = 0xD5, - /// - /// Writes data to the indicated log - /// - WriteLog = 0xD6 - #endregion Commands defined on ATA/ATAPI-5 rev. 3 - } - #endregion ATA SMART SubCommands - - #region ATA Device Configuration Overlay SubCommands - /// - /// All known ATA DEVICE CONFIGURATION sub-commands - /// - public enum AtaDeviceConfigurationSubCommands : byte - { - #region Commands defined on ATA/ATAPI-6 rev. 3b - /// - /// Disables any change made by - /// - Restore = 0xC0, - /// - /// Prevents any from working until a power down cycle. - /// - FreezeLock = 0xC1, - /// - /// Indicates the selectable commands, modes, and feature sets the device supports - /// - Identify = 0xC2, - /// - /// Modifies the commands, modes and features sets the device will obey to - /// - Set = 0xC3 - #endregion Commands defined on ATA/ATAPI-6 rev. 3b - } - #endregion ATA Device Configuration Overlay SubCommands - - #region ATA SET MAX SubCommands - /// - /// All known ATA SET MAX sub-commands - /// - public enum AtaSetMaxSubCommands : byte - { - #region Commands defined on ATA/ATAPI-6 rev. 3b - /// - /// Redefines the maximum user-accessible address space - /// - Address = 0x00, - /// - /// Disables any other until power cycle - /// - FreezeLock = 0x04, - /// - /// Disables any other except and until power cycle - /// - Lock = 0x02, - /// - /// Sets the device password - /// - SetPassword = 0x01, - /// - /// Disables - /// - UnLock = 0x03, - #endregion Commands defined on ATA/ATAPI-6 rev. 3b - } - #endregion ATA SET MAX SubCommands - - #region ATA Non Volatile Cache SubCommands - /// - /// All known ATA NV CACHE sub-commands - /// - public enum AtaNonVolatileCacheSubCommands : byte - { - #region Commands defined on ATA/ATAPI-8 rev. 3f - /// - /// Adds the specified LBA to the Non Volatile Cache - /// - AddLbaToNvCache = 0x10, - /// - /// Ensures there is enough free space in the Non Volatile Cache - /// - FlushNvCache = 0x14, - /// - /// Requests a list of LBAs actually stored in the Non Volatile Cache - /// - QueryNvCachePinnedSet = 0x12, - /// - /// Requests a list of LBAs accessed but not in the Non Volatile Cache - /// - QueryNvCacheMisses = 0x13, - /// - /// Removes the specified LBA from the Non Volatile Cache Pinned Set - /// - RemoveLbaFromNvCache = 0x11, - /// - /// Disables the Non Volatile Cache Power Mode - /// - /// - ReturnFromNvCachePowerMode = 0x01, - /// - /// Enables the Non Volatile Cache Power Mode, so the device tries to serve all accesses from the Non Volatile Cache - /// - SetNvCachePowerMode = 0x00 - #endregion Commands defined on ATA/ATAPI-8 rev. 3f - } - #endregion ATA Non Volatile Cache SubCommands - - #region ATA Sanitize SubCommands - /// - /// All known ATA SANITIZE sub-commands - /// - public enum AtaSanitizeSubCommands : ushort - { - #region Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 - /// - /// Causes a block erase on all user data - /// - BlockEraseExt = 0x0012, - /// - /// Changes the internal encryption keys. Renders user data unusable - /// - CryptoScrambleExt = 0x0011, - /// - /// Fills user data with specified pattern - /// - OverwriteExt = 0x0014, - /// - /// Disables all except - /// - FreezeLockExt = 0x0020, - /// - /// Gets the status of the sanitizing - /// - Status = 0x0000, - #endregion Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 - - #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - /// - /// Disables the command - /// - AntiFreezeLockExt = 0x0040 - #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - } - #endregion ATA Sanitize SubCommands - - #region ATA NCQ Queue Management SubCommands - /// - /// All known ATA NCQ QUEUE MANAGEMENT sub-commands - /// - public enum AtaNCQQueueManagementSubcommands : byte - { - #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - /// - /// Aborts pending NCQ commands - /// - AbortNCQQueue = 0x00, - /// - /// Controls how NCQ Streaming commands are processed by the device - /// - DeadlineHandling = 0x01, - #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 - } - #endregion ATA NCQ Queue Management SubCommands + #region Commands defined on Western Digital WD1000 Winchester Disk Controller /// - /// All known SASI commands - /// Commands 0x00 to 0x1F are 6-byte - /// Commands 0x20 to 0x3F are 10-byte - /// Commands 0x40 to 0x5F are 8-byte + /// Formats a track /// - #region SASI Commands + FormatTrack = 0x50, + /// + /// Reads sectors + /// + ReadOld = 0x20, + /// + /// Reads sectors using DMA + /// + ReadDmaOld = 0x28, + /// + /// Calibrates the position of the heads + /// Includes all commands from 0x10 to 0x1F + /// + Restore = 0x10, + /// + /// Seeks to a certain cylinder + /// + Seek = 0x70, + /// + /// Writes sectors + /// + WriteOld = 0x30, + #endregion Commands defined on Western Digital WD1000 Winchester Disk Controller + + #region Commands defined on ATA rev. 4c + + /// + /// Acknowledges media change + /// + AckMediaChange = 0xDB, + /// + /// Sends vendor-specific information that may be required in order to pass diagnostics + /// + PostBoot = 0xDC, + /// + /// Prepares a removable drive to respond to boot + /// + PreBoot = 0xDD, + /// + /// Checks drive power mode + /// + CheckPowerMode = 0xE5, + /// + /// Checks drive power mode + /// + CheckPowerModeAlternate = 0x98, + /// + /// Locks the door of the drive + /// + DoorLock = 0xDE, + /// + /// Unlocks the door of the drive + /// + DoorUnLock = 0xDF, + /// + /// Executes internal drive diagnostics + /// + ExecuteDriveDiagnostic = 0x90, + /// + /// Gets a sector containing drive identification and capabilities + /// + IdentifyDrive = 0xEC, + /// + /// Requests the drive to enter idle status + /// + Idle = 0xE3, + /// + /// Requests the drive to enter idle status + /// + IdleAlternate = 0x97, + /// + /// Requests the drive to enter idle status immediately + /// + IdleImmediate = 0xE1, + /// + /// Requests the drive to enter idle status immediately + /// + IdleImmediateAlternate = 0x95, + /// + /// Changes heads and sectors per cylinder for the drive + /// + InitializeDriveParameters = 0x91, + /// + /// Does nothing + /// + Nop = 0x00, + /// + /// Reads sectors using PIO transfer + /// + Read = 0x21, + /// + /// Reads the content of the drive's buffer + /// + ReadBuffer = 0xE4, + /// + /// Reads sectors using DMA transfer + /// + ReadDma = 0xC9, + /// + /// Reads sectors using DMA transfer, retrying on error + /// + ReadDmaRetry = 0xC8, + /// + /// Reads a sector including ECC bytes without checking them + /// + ReadLong = 0x23, + /// + /// Reads a sector including ECC bytes without checking them, retrying on error + /// + ReadLongRetry = 0x22, + /// + /// Reads multiple sectors generating interrupts at block transfers + /// + ReadMultiple = 0xC4, + /// + /// Reads sectors using PIO transfer, retrying on error + /// + ReadRetry = 0x20, + /// + /// Verifies sectors readability without transferring them + /// + ReadVerify = 0x41, + /// + /// Verifies sectors readability without transferring them, retrying on error + /// + ReadVerifyRetry = 0x40, + /// + /// Moves the heads to cylinder 0 + /// + Recalibrate = Restore, + /// + /// Sets drive parameters + /// + SetFeatures = 0xEF, + /// + /// Enables and and sets the block length for these commands + /// + SetMultipleMode = 0xC6, + /// + /// Causes the drive to stop and sleep until a hardware or software reset + /// + Sleep = 0xE6, + /// + /// Causes the drive to stop and sleep until a hardware or software reset + /// + SleepAlternate = 0x99, + /// + /// Sets the drive to enter Standby mode + /// + Standby = 0xE2, + /// + /// Sets the drive to enter Standby mode + /// + StandbyAlternate = 0x96, + /// + /// Sets the drive to enter Standby mode, immediately + /// + StandbyImmediate = 0xE0, + /// + /// Sets the drive to enter Standby mode, immediately + /// + StandbyImmediateAlternate = 0x94, + /// + /// Writes sectors using PIO transfer + /// + Write = 0x31, + /// + /// Writes data to the drive's sector buffer + /// + WriteBuffer = 0xE8, + /// + /// Writes sectors using DMA transfer + /// + WriteDma = 0xCB, + /// + /// Writes sectors using DMA transfer, retrying on error + /// + WriteDmaRetry = 0xCA, + /// + /// Writes sectors with custom ECC + /// + WriteLong = 0x33, + /// + /// Writes sectors with custom ECC, retrying on error + /// + WriteLongRetry = 0x32, + /// + /// Writes several sectors at once setting interrupts on end of block + /// + WriteMultiple = 0xC5, + /// + /// Writes the same data to several sector + /// + WriteSame = 0xE9, + /// + /// Writes sectors using PIO transfer, retrying on error + /// + WriteRetry = 0x30, + /// + /// Writes sectors verifying them immediately after write + /// + WriteVerify = 0x3C, + /// + /// Unknown vendor command + /// + Vendor_8x = 0x80, + /// + /// Unknown vendor command + /// + Vendor_9A = 0x9A, + /// + /// Unknown vendor command + /// + Vendor_C0 = 0xC0, + /// + /// Unknown vendor command + /// + Vendor_C1 = 0xC1, + /// + /// Unknown vendor command + /// + Vendor_C2 = 0xC2, + /// + /// Unknown vendor command + /// + Vendor_C3 = 0xC3, + /// + /// Unknown vendor command + /// + Vendor_F0 = 0xF0, + /// + /// Unknown vendor command + /// + Vendor_F1 = 0xF1, + /// + /// Unknown vendor command + /// + Vendor_F2 = 0xF2, + /// + /// Unknown vendor command + /// + Vendor_F3 = 0xF3, + /// + /// Unknown vendor command + /// + Vendor_F4 = 0xF4, + /// + /// Unknown vendor command + /// + Vendor_F5 = 0xF5, + /// + /// Unknown vendor command + /// + Vendor_F6 = 0xF6, + /// + /// Unknown vendor command + /// + Vendor_F7 = 0xF7, + /// + /// Unknown vendor command + /// + Vendor_F8 = 0xF8, + /// + /// Unknown vendor command + /// + Vendor_F9 = 0xF9, + /// + /// Unknown vendor command + /// + Vendor_FA = 0xFA, + /// + /// Unknown vendor command + /// + Vendor_FB = 0xFB, + /// + /// Unknown vendor command + /// + Vendor_FC = 0xFC, + /// + /// Unknown vendor command + /// + Vendor_FD = 0xFD, + /// + /// Unknown vendor command + /// + Vendor_FE = 0xFE, + /// + /// Unknown vendor command + /// + Vendor_FF = 0xFF, + #endregion Commands defined on ATA rev. 4c + + #region Commands defined on ATA-2 rev. 4c + + /// + /// Alters the device microcode + /// + DownloadMicrocode = 0x92, + /// + /// Ejects the removable medium on the device + /// + MediaEject = 0xED, + #endregion Commands defined on ATA-2 rev. 4c + + #region Commands defined on ATA-3 rev. 7b + + /// + /// Gets a sector containing drive identification and capabilities + /// + IdentifyDriveDma = 0xEE, + /// + /// Disables the security lock + /// + SecurityDisablePassword = 0xF6, + /// + /// Enables usage of command + /// + SecurityErasePrepare = 0xF3, + /// + /// Erases all user data and isables the security lock + /// + SecurityEraseUnit = 0xF4, + /// + /// Sets the security freeze lock preventing any security command from working until hardware reset + /// + SecurityFreezeLock = 0xF5, + /// + /// Sets the device user or master password + /// + SecuritySetPassword = 0xF1, + /// + /// Unlocks device + /// + SecurityUnlock = 0xF2, + /// + /// SMART operations + /// + Smart = 0xB0, + #endregion Commands defined on ATA-3 rev. 7b + + #region Commands defined on CompactFlash Specification + + /// + /// Pre-erases and conditions data sectors + /// + EraseSectors = 0xC0, + /// + /// Requests extended error information + /// + RequestSense = 0x03, + /// + /// Provides a way to determine the exact number of times a sector has been erases and programmed + /// + TranslateSector = 0x87, + /// + /// For CompactFlash cards that do not support security mode, this commands is equal to + /// For those that do, this command is equal to + /// + WearLevel = 0xF5, + /// + /// Writes a block of sectors without erasing them previously + /// + WriteMultipleWithoutErase = 0xCD, + /// + /// Writes sectors without erasing them previously + /// + WriteWithoutErase = 0x38, + #endregion Commands defined on CompactFlash Specification + + #region Commands defined on ATA/ATAPI-4 rev. 18 + + /// + /// Resets a device + /// + DeviceReset = 0x08, + /// + /// Requests the device to flush the write cache and write it to the media + /// + FlushCache = 0xE7, + /// + /// Gets media status + /// + GetMediaStatus = 0xDA, + /// + /// Gets a sector containing drive identification and capabilities, for ATA devices + /// + IdentifyDevice = IdentifyDrive, + /// + /// Gets a sector containing drive identification and capabilities, for ATAPI devices + /// + IdentifyPacketDevice = 0xA1, + /// + /// Locks the media on the device + /// + MediaLock = DoorLock, + /// + /// Unlocks the media on the device + /// + MediaUnLock = DoorUnLock, + /// + /// Sends a command packet + /// + Packet = 0xA0, + /// + /// Queues a read of sectors + /// + ReadDmaQueued = 0xC7, + /// + /// Returns the native maximum address in factory default condition + /// + ReadNativeMaxAddress = 0xF8, + /// + /// Used to provide data transfer and/or status of a previous command (queue or packet) + /// + Service = 0xA2, + /// + /// Redefines the maximum user-accessible address space + /// + SetMaxAddress = 0xF9, + /// + /// Queues a write of sectors + /// + WriteDmaQueued = 0xCC, + #endregion Commands defined on ATA/ATAPI-4 rev. 18 + + #region Commands defined on ATA/ATAPI-6 rev. 3b + + /// + /// Determines if the device supports the Media Card Pass Through Command feature set + /// + CheckMediaCardType = 0xD1, + /// + /// Device Configuration Overlay feature set + /// + DevideConfiguration = 0xB1, + /// + /// Requests the device to flush the write cache and write it to the media (48-bit) + /// + FlushCacheExt = 0xEA, + /// + /// Reads sectors using DMA transfer, retrying on error (48-bit) + /// + ReadDmaExt = 0x25, + /// (48-bit) + /// Queues a read of sectors + /// + ReadDmaQueuedExt = 0x26, + /// + /// Reads sectors using PIO transfer, retrying on error (48-bit) + /// + ReadExt = 0x24, + /// + /// Returns the indicated log to the host (48-bit) + /// + ReadLogExt = 0x2F, + /// + /// Reads multiple sectors generating interrupts at block transfers (48-bit) + /// + ReadMultipleExt = 0x29, + /// + /// Returns the native maximum address in factory default condition (48-bit) + /// + ReadNativeMaxAddressExt = 0x27, + /// + /// Verifies sectors readability without transferring them, retrying on error (48-bit) + /// + ReadVerifyExt = 0x42, + /// + /// Sends a SET MAX subcommand, + /// + SetMaxCommands = 0xF9, + /// + /// Redefines the maximum user-accessible address space (48-bit) + /// + SetMaxAddressExt = 0x37, + /// + /// Writes sectors using DMA transfer, retrying on error (48-bit) + /// + WriteDmaExt = 0x35, + /// + /// Queues a write of sectors (48-bit) + /// + WriteDmaQueuedExt = 0x36, + /// + /// Writes sectors using PIO transfer, retrying on error (48-bit) + /// + WriteExt = 0x34, + /// + /// Writes data to the indicated log (48-bit) + /// + WriteLogExt = 0x3F, + /// + /// Writes several sectors at once setting interrupts on end of block (48-bit) + /// + WriteMultipleExt = 0x39, + #endregion Commands defined on ATA/ATAPI-6 rev. 3b + + #region Commands defined on ATA/ATAPI-7 rev. 4b + + /// + /// Configurates the operating parameters for a stream + /// + ConfigureStream = 0x51, + /// + /// Reads data on an alloted time using DMA + /// + ReadStreamDmaExt = 0x2A, + /// + /// Reads data on an alloted time using PIO + /// + ReadStreamExt = 0x2B, + /// + /// Writes data on an alloted time using DMA + /// + WriteStreamDmaExt = 0x3A, + /// + /// Writes data on an alloted time using PIO + /// + WriteStreamExt = 0x3B, + #endregion Commands defined on ATA/ATAPI-7 rev. 4b + + #region Commands defined on ATA/ATAPI-8 rev. 3f + + /// + /// Sends a Non Volatile Cache subcommand. + /// + NonVolatileCacheCommand = 0xB6, + /// + /// Retrieves security protocol information or the results from commands + /// + TrustedReceive = 0x5C, + /// + /// Retrieves security protocol information or the results from commands, using DMA transfers + /// + TrustedReceiveDma = 0x5D, + /// + /// Sends one or more Security Protocol commands + /// + TrustedSend = 0x5E, + /// + /// Sends one or more Security Protocol commands, using DMA transfers + /// + TrustedSendDma = 0x5F, + /// + /// Writes sectors using DMA transfer, retrying on error (48-bit), not returning until the operation is complete + /// + WriteDmaFuaExt = 0x3D, + /// + /// Queues a write of sectors (48-bit), not returning until the operation is complete + /// + WriteDmaQueuedFuaExt = 0x3E, + /// + /// Writes several sectors at once setting interrupts on end of block (48-bit), not returning until the operation is complete + /// + WriteMultipleFuaExt = 0xCE, + /// + /// Writes a sector that will give an uncorrectable error on any read operation + /// + WriteUncorrectableExt = 0x45, + #endregion Commands defined on ATA/ATAPI-8 rev. 3f + + #region Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 + + /// + /// Provides information for device optimization + /// In SSDs, this contains trimming + /// + DataSetManagement = 0x06, + /// + /// Alters the device microcode, using DMA transfers + /// + DownloadMicrocodeDma = 0x93, + /// + /// Reads the content of the drive's buffer, using DMA transfers + /// + ReadBufferDma = 0xE9, + /// + /// Reads sectors using NCQ + /// + ReadFpDmaQueued = 0x60, + /// + /// Returns the indicated log to the host (48-bit) + /// + ReadLogDmaExt = 0x47, + /// + /// Requests SPC-4 style error data + /// + RequestSenseDataExt = 0x0B, + SanitizeCommands = 0xB4, + /// + /// Executes a Security Protocol command that does not require a transfer of data + /// + TrustedNonData = 0x5B, + /// + /// Writes data to the drive's sector buffer, using DMA transfers + /// + WriteBufferDma = 0xE8, + /// + /// Writes sectors using NCQ + /// + WriteFpDmaQueued = 0x61, + #endregion Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 + + #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + + /// + /// Sends + /// + NCQQueueManagement = 0x63, + /// + /// Sets the device date and time + /// + SetDateAndTimeExt = 0x77 + + #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + } + #endregion ATA Commands + + #region ATA SMART SubCommands + /// + /// All known ATA SMART sub-commands + /// + public enum AtaSmartSubCommands : byte + { + #region Commands defined on ATA-3 rev. 7b + + /// + /// Disables all SMART capabilities + /// + Disable = 0xD9, + /// + /// Enables/disables SMART attribute autosaving + /// + EnableDisableAttributeAutosave = 0xD2, + /// + /// Enables all SMART capabilities + /// + Enable = 0xD8, + /// + /// Returns the device's SMART attributes thresholds + /// + ReadAttributeThresholds = 0xD1, + /// + /// Returns the device's SMART attributes values + /// + ReadAttributeValues = 0xD0, + /// + /// Communicates device reliability status + /// + ReturnStatus = 0xDA, + /// + /// Saves any attribute values immediately + /// + SaveAttributeValues = 0xD3, + #endregion Commands defined on ATA-3 rev. 7b + + #region Commands defined on ATA/ATAPI-4 rev. 18 + + /// + /// Causes the device to immediately initiate a SMART data collection and saves it to the device + /// + ExecuteOfflineImmediate = 0xD4, + /// + /// Returns the device's SMART attributes values + /// + ReadData = ReadAttributeValues, + #endregion Commands defined on ATA/ATAPI-4 rev. 18 + + #region Commands defined on ATA/ATAPI-5 rev. 3 + + /// + /// Returns the indicated log to the host + /// + ReadLog = 0xD5, + /// + /// Writes data to the indicated log + /// + WriteLog = 0xD6 + + #endregion Commands defined on ATA/ATAPI-5 rev. 3 + } + #endregion ATA SMART SubCommands + + #region ATA Device Configuration Overlay SubCommands + /// + /// All known ATA DEVICE CONFIGURATION sub-commands + /// + public enum AtaDeviceConfigurationSubCommands : byte + { + #region Commands defined on ATA/ATAPI-6 rev. 3b + + /// + /// Disables any change made by + /// + Restore = 0xC0, + /// + /// Prevents any from working until a power down cycle. + /// + FreezeLock = 0xC1, + /// + /// Indicates the selectable commands, modes, and feature sets the device supports + /// + Identify = 0xC2, + /// + /// Modifies the commands, modes and features sets the device will obey to + /// + Set = 0xC3 + + #endregion Commands defined on ATA/ATAPI-6 rev. 3b + } + #endregion ATA Device Configuration Overlay SubCommands + + #region ATA SET MAX SubCommands + /// + /// All known ATA SET MAX sub-commands + /// + public enum AtaSetMaxSubCommands : byte + { + #region Commands defined on ATA/ATAPI-6 rev. 3b + + /// + /// Redefines the maximum user-accessible address space + /// + Address = 0x00, + /// + /// Disables any other until power cycle + /// + FreezeLock = 0x04, + /// + /// Disables any other except and until power cycle + /// + Lock = 0x02, + /// + /// Sets the device password + /// + SetPassword = 0x01, + /// + /// Disables + /// + UnLock = 0x03, + #endregion Commands defined on ATA/ATAPI-6 rev. 3b + } + #endregion ATA SET MAX SubCommands + + #region ATA Non Volatile Cache SubCommands + /// + /// All known ATA NV CACHE sub-commands + /// + public enum AtaNonVolatileCacheSubCommands : byte + { + #region Commands defined on ATA/ATAPI-8 rev. 3f + + /// + /// Adds the specified LBA to the Non Volatile Cache + /// + AddLbaToNvCache = 0x10, + /// + /// Ensures there is enough free space in the Non Volatile Cache + /// + FlushNvCache = 0x14, + /// + /// Requests a list of LBAs actually stored in the Non Volatile Cache + /// + QueryNvCachePinnedSet = 0x12, + /// + /// Requests a list of LBAs accessed but not in the Non Volatile Cache + /// + QueryNvCacheMisses = 0x13, + /// + /// Removes the specified LBA from the Non Volatile Cache Pinned Set + /// + RemoveLbaFromNvCache = 0x11, + /// + /// Disables the Non Volatile Cache Power Mode + /// + /// + ReturnFromNvCachePowerMode = 0x01, + /// + /// Enables the Non Volatile Cache Power Mode, so the device tries to serve all accesses from the Non Volatile Cache + /// + SetNvCachePowerMode = 0x00 + + #endregion Commands defined on ATA/ATAPI-8 rev. 3f + } + #endregion ATA Non Volatile Cache SubCommands + + #region ATA Sanitize SubCommands + /// + /// All known ATA SANITIZE sub-commands + /// + public enum AtaSanitizeSubCommands : ushort + { + #region Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 + + /// + /// Causes a block erase on all user data + /// + BlockEraseExt = 0x0012, + /// + /// Changes the internal encryption keys. Renders user data unusable + /// + CryptoScrambleExt = 0x0011, + /// + /// Fills user data with specified pattern + /// + OverwriteExt = 0x0014, + /// + /// Disables all except + /// + FreezeLockExt = 0x0020, + /// + /// Gets the status of the sanitizing + /// + Status = 0x0000, + #endregion Commands defined on ATA/ATAPI Command Set 2 (ACS-2) rev. 2 + + #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + + /// + /// Disables the command + /// + AntiFreezeLockExt = 0x0040 + + #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + } + #endregion ATA Sanitize SubCommands + + #region ATA NCQ Queue Management SubCommands + /// + /// All known ATA NCQ QUEUE MANAGEMENT sub-commands + /// + public enum AtaNCQQueueManagementSubcommands : byte + { + #region Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + + /// + /// Aborts pending NCQ commands + /// + AbortNCQQueue = 0x00, + /// + /// Controls how NCQ Streaming commands are processed by the device + /// + DeadlineHandling = 0x01, + #endregion Commands defined on ATA/ATAPI Command Set 3 (ACS-3) rev. 5 + } + #endregion ATA NCQ Queue Management SubCommands + + /// + /// All known SASI commands + /// Commands 0x00 to 0x1F are 6-byte + /// Commands 0x20 to 0x3F are 10-byte + /// Commands 0x40 to 0x5F are 8-byte + /// + #region SASI Commands public enum SasiCommands : byte - { - #region SASI Class 0 commands - /// - /// Returns zero status if requested unit is on and ready. - /// SASI rev. 0a - /// - TestUnitReady = 0x00, - /// - /// Sets the unit to a specific known state. - /// SASI rev. 0a - /// - RezeroUnit = 0x01, - /// - /// Unknown - /// SASI rev. 0a - /// - RequestSyndrome = 0x02, - /// - /// Returns unit sense. - /// SASI rev. 0a - /// - RequestSense = 0x03, - /// - /// Formats the entire media. - /// SASI rev. 0a - /// - FormatUnit = 0x04, - /// - /// Unknown - /// SASI rev. 0a - /// - CheckTrackFormat = 0x05, - /// - /// Unknown - /// SASI rev. 0a - /// - FormatTrack = 0x06, - /// - /// Unknown - /// SASI rev. 0a - /// - FormatBadTrack = 0x06, - /// - /// Reads a block from the device. - /// SASI rev. 0a - /// - Read = 0x08, - /// - /// SASI rev. 0a - /// Unknown - /// - WriteProtectSector = 0x09, - /// - /// Writes a block to the device. - /// SASI rev. 0a - /// - Write = 0x0A, - /// - /// Moves the device reading mechanism to the specified block. - /// SASI rev. 0a - /// - Seek = 0x0B, - /// - /// Unknown - /// SASI rev. 0a - /// - VerifyRestore = 0x0D, - /// - /// Unknown - /// SASI rev. 0a - /// - AssignAlternateDiskTrack = 0x0E, - /// - /// Writes a File Mark on the device. - /// SASI rev. 0c - /// - WriteFileMark = 0x0F, - /// - /// Reserves the device for use by the iniator. - /// SASI rev. 0a - /// - ReserveUnit = 0x12, - /// - /// Release the device from the reservation. - /// SASI rev. 0a - /// - ReleaseUnit= 0x13, - /// - /// Unknown - /// SASI rev. 0a - /// - WriteProtectDrive = 0x14, - /// - /// Writes and verifies blocks to the device. - /// SASI rev. 0c - /// - WriteVerify = 0x14, - /// - /// Unknown - /// SASI rev. 0a - /// - ReleaseWriteProtect = 0x15, - /// - /// Verifies blocks. - /// SASI rev. 0c - /// - Verify = 0x15, - /// - /// Unknown - /// SASI rev. 0a - /// - ReadNoSeek = 0x16, - /// - /// Gets the number of blocks in device. - /// SASI rev. 0c - /// - ReadCapacity = 0x16, - /// - /// Searches data on blocks - /// SASI rev. 0a - /// - SearchDataEqual = 0x17, - /// - /// Searches data on blocks using major than or equal comparison - /// SASI rev. 0a - /// - SearchDataHigh = 0x18, - /// - /// Searches data on blocks using minor than or equal comparison - /// SASI rev. 0a - /// - SearchDataLow = 0x19, - /// - /// Reads analysis data from a device - /// SASI rev. 0a - /// - ReadDiagnostic = 0x1A, - /// - /// Unknown - /// SASI rev. 0a - /// - VerifyData = 0x1B, - /// - /// Requests a device to run a diagnostic - /// SASI rev. 0c - /// - WriteDiagnostic = 0x1B, - /// - /// Gets information about a device - /// SASI rev. 0c - /// - Inquiry = 0x1F, - #endregion SASI Class 0 commands - - #region SASI Class 1 commands - /// - /// SASI rev. 0a - /// Unknown - /// - Copy = 0x20, - /// - /// SASI rev. 0a - /// Unknown - /// - Restore = 0x21, - /// - /// SASI rev. 0a - /// Unknown - /// - Backup = 0x22, - /// - /// SASI rev. 0a - /// Unknown - /// - SetBlockLimitsOld = 0x26, - /// - /// Sets write or read limits from a specified block - /// SASI rev. 0c - /// - SetBlockLimits = 0x28, - #endregion SASI Class 1 commands - - #region SASI Class 2 commands - /// - /// Unknown - /// SASI rev. 0a - /// - Load = 0x40, - /// - /// Unknown - /// SASI rev. 0a - /// - Unload = 0x41, - /// - /// Unknown - /// SASI rev. 0a - /// - Rewind = 0x42, - /// - /// Unknown - /// SASI rev. 0a - /// - SpaceForward = 0x43, - /// - /// Unknown - /// SASI rev. 0a - /// - SpaceForwardFileMark = 0x44, - /// - /// Unknown - /// SASI rev. 0a - /// - SpaceReserve = 0x45, - /// - /// Unknown - /// SASI rev. 0a - /// - SpaceReserveFileMark = 0x46, - /// - /// Unknown - /// SASI rev. 0a - /// - TrackSelect = 0x47, - /// - /// Reads blocks from device - /// SASI rev. 0a - /// - Read10 = 0x48, - /// - /// Unknown - /// SASI rev. 0a - /// - ReadVerify = 0x49, - /// - /// Unknown - /// SASI rev. 0a - /// - ReadDiagnosticClass2 = 0x4A, - /// - /// Writes blocks to device - /// SASI rev. 0a - /// - Write10 = 0x4B, - /// - /// Unknown - /// SASI rev. 0a - /// - WriteFileMarkClass2 = 0x4C, - /// - /// Unknown - /// SASI rev. 0a - /// - WriteExtended = 0x4D, - /// - /// Unknown - /// SASI rev. 0a - /// - WriteExtendedFileMark = 0x4E, - /// - /// Unknown - /// SASI rev. 0a - /// - WriteErase = 0x4F, - #endregion SASI Class 2 commands - - #region SASI Class 3 commands - /// - /// SASI rev. 0a - /// - Skip = 0x60, - /// - /// SASI rev. 0a - /// - Space = 0x61, - /// - /// SASI rev. 0a - /// - Return = 0x62, - /// - /// SASI rev. 0a - /// - Tab = 0x63, - /// - /// SASI rev. 0a - /// - ReadControl = 0x64, - /// - /// SASI rev. 0a - /// - Write3 = 0x65, - /// - /// SASI rev. 0a - /// - WriteControl = 0x66, - #endregion SASI Class 3 commands - - #region SASI Class 6 commands - /// - /// SASI rev. 0a - /// - DefineFloppyDiskTracFormat = 0xC0, - /// - /// SASI rev. 0a - /// - FormatDriveErrorMap = 0xC4, - /// - /// SASI rev. 0a - /// - ReadErrorMap = 0xC5, - /// - /// SASI rev. 0a - /// - ReadDriveType = 0xC6, - #endregion SASI Class 6 commands - - #region SASI Class 7 commands - /// - /// SASI rev. 0a - /// - RamDiagnostic = 0xE0, - /// - /// SASI rev. 0a - /// - WriteECC = 0xE1, - /// - /// SASI rev. 0a - /// - ReadID = 0xE2, - /// - /// SASI rev. 0a - /// - DriveDiagnostic = 0xE3 - #endregion SASI Class 7 commands - } - #endregion SASI Commands - - #region SCSI Commands - /// - /// All known SCSI and ATAPI commands - /// - public enum ScsiCommands : byte - { - #region SCSI Primary Commands (SPC) - /// - /// Commands used to obtain information about the access controls that are active - /// SPC-4 rev. 16 - /// - AccessControlIn = 0x86, - /// - /// Commands used to limit or grant access to LUNs - /// SPC-4 rev. 16 - /// - AccessControlOut = 0x87, - /// - /// Modifies the operating definition of the device with respect to commmands. - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ChangeDefinition = 0x40, - /// - /// Compares data between two devices - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Compare = 0x39, - /// - /// Copies data between two devices - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Copy = 0x18, - /// - /// Copies data between two devices and verifies the copy is correct. - /// SCSI-2 X3T9.2/375R rev. 10l - /// - CopyAndVerify = 0x3A, - /// - /// Copies data between two devices - /// SPC-2 rev. 20 - /// - ExtendedCopy = 0x83, - /// - /// Requests information about the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Inquiry = 0x12, - /// - /// Manages device statistics - /// SCSI-2 X3T9.2/375R rev. 10l - /// - LogSelect = 0x4C, - /// - /// Gets device statistics - /// SCSI-2 X3T9.2/375R rev. 10l - /// - LogSense = 0x4D, - /// - /// Retrieves management protocol information - /// SPC-2 rev. 20 - /// - ManagementProtocolIn = 0xA3, - /// - /// Transfers management protocol information - /// SPC-2 rev. 20 - /// - ManagementProtocolOut = 0xA4, - /// - /// Sets device parameters - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ModeSelect = 0x15, - /// - /// Sets device parameters - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ModeSelect10 = 0x55, - /// - /// Gets device parameters - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ModeSense = 0x1A, - /// - /// Gets device parameters - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ModeSense10 = 0x5A, - /// - /// Obtains information about persistent reservations and reservation keys - /// SPC-1 rev. 10 - /// - PersistentReserveIn = 0x5E, - /// - /// Reserves a LUN or an extent within a LUN for exclusive or shared use - /// SPC-1 rev. 10 - /// - PersistentReserveOut = 0x5F, - /// - /// Requests the device to disable or enable the removal of the medium inside it - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PreventAllowMediumRemoval = 0x1E, - /// - /// Reads attribute values from medium auxiliary memory - /// SPC-3 rev. 21b - /// - ReadAttribute = 0x8C, - /// - /// Reads the device buffer - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadBuffer = 0x3C, - /// - /// Reads the media serial number - /// SPC-3 rev. 21b - /// - ReadSerialNumber = 0xAB, - /// - /// Receives information about a previous or current - /// SPC-2 rev. 20 - /// - ReceiveCopyResults = 0x84, - /// - /// Requests the data after completion of a - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReceiveDiagnostic = 0x1C, - /// - /// Releases a previously reserved LUN or extents - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Release = 0x17, - /// - /// Releases a previously reserved LUN or extents - /// SPC-1 rev. 10 - /// - Release10 = 0x57, - /// - /// Requests the LUNs that are present on the device - /// SPC-1 rev. 10 - /// - ReportLuns = 0xA0, - /// - /// Requests the device's sense - /// SCSI-2 X3T9.2/375R rev. 10l - /// - RequestSense = 0x03, - /// - /// Reserves a LUN or extent - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Reserve = 0x16, - /// - /// Reserves a LUN or extent - /// SPC-1 rev. 10 - /// - Reserve10 = 0x56, - /// - /// Retrieves security protocol information - /// SPC-4 rev. 16 - /// - SecurityProtocolIn = 0xA2, - /// - /// Transfers security protocol information - /// SPC-4 rev. 16 - /// - SecurityProtocolOut = 0xB5, - /// - /// Requests the device to perform diagnostics - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SendDiagnostic = 0x1D, - /// - /// Extended commands - /// SPC-4 - /// - ServiceActionIn = 0x9E, - /// - /// Extended commands - /// SPC-4 - /// - ServiceActionOut = 0x9F, - /// - /// Checks if a LUN is ready to access its medium - /// SCSI-2 X3T9.2/375R rev. 10l - /// - TestUnitReady = 0x00, - /// - /// Writes attribute values to medium auxiliary memory - /// SPC-3 rev. 21b - /// - WriteAttribute = 0x8C, - /// - /// Writes to the device's buffer - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteBuffer = 0x3B, - #endregion SCSI Primary Commands (SPC) - - #region SCSI Block Commands (SBC) - /// - /// Compares blocks with sent data, and if equal, writes those block to device, atomically - /// SBC-3 rev. 25 - /// - CompareAndWrite = 0x89, - /// - /// Formats the medium into addressable logical blocks - /// SCSI-2 X3T9.2/375R rev. 10l - /// - FormatUnit = 0x04, - /// - /// Locks blocks from eviction of device's cache - /// SCSI-2 X3T9.2/375R rev. 10l - /// - LockUnlockCache = 0x36, - /// - /// Locks blocks from eviction of device's cache - /// SBC-2 rev. 4 - /// - LockUnlockCache16 = 0x92, - /// - /// Requests the device to perform the following uninterrupted series of actions: - /// 1.- Read the specified blocks - /// 2.- Transfer blocks from the data out buffer - /// 3.- Perform an OR operation between the read blocks and the buffer - /// 4.- Write the buffer to the blocks - /// SBC-3 rev. 16 - /// - ORWrite = 0x8B, - /// - /// Transfers requested blocks to devices' cache - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PreFetch = 0x34, - /// - /// Transfers requested blocks to devices' cache - /// SBC-3 rev. 16 - /// - PreFetch16 = 0x90, - /// - /// Reads blocks from device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Read = 0x08, - /// - /// Reads blocks from device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Read10 = 0x28, - /// - /// Reads blocks from device - /// SBC-2 rev. 4 - /// - Read16 = 0x88, - /// - /// Gets device capacity - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadCapacity = 0x25, - /// - /// Gets device's defect data - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadDefectData = 0x37, - /// - /// Reads blocks from device in a vendor-specific way that should include the ECC alongside the data - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadLong = 0x3E, - /// - /// Requests the device to reassign the defective blocks to another area of the medium - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReassignBlocks = 0x07, - /// - /// Requests the target write to the medium the XOR data generated from the specified source devices - /// SBC-1 rev. 8c - /// - Rebuild = 0x81, - /// - /// Requests the target write to the buffer the XOR data from its own medium and the specified source devices - /// SBC-1 rev. 8c - /// - Regenerate = 0x82, - /// - /// Requests the device to set the LUN in a vendor specific state - /// SCSI-2 X3T9.2/375R rev. 10l - /// - RezeroUnit = 0x01, - /// - /// Searches data on blocks - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataEqual = 0x31, - /// - /// Searches data on blocks using major than or equal comparison - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataHigh = 0x30, - /// - /// Searches data on blocks using minor than or equal comparison - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataLow = 0x32, - /// - /// Requests the device to seek to a specified blocks - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Seek = 0x0B, - /// - /// Requests the device to seek to a specified blocks - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Seek10 = 0x2B, - /// - /// Defines the range within which subsequent linked commands may operate - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SetLimits = 0x33, - /// - /// Requests the device to enable or disable the LUN for media access operations - /// SCSI-2 X3T9.2/375R rev. 10l - /// - StartStopUnit = 0x1B, - /// - /// Ensures that the blocks in the cache are written to the medium - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SynchronizeCache = 0x35, - /// - /// Ensures that the blocks in the cache are written to the medium - /// SBC-2 rev. 4 - /// - SynchronizeCache16 = 0x91, - /// - /// Unmaps one or more LBAs - /// In SSDs, this is trimming - /// SBC-3 rev. 25 - /// - Unmap = 0x42, - /// - /// Verifies blocks on the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Verify10 = 0x2F, - /// - /// Verifies blocks on the device - /// SBC-2 rev. 4 - /// - Verify16 = 0x8F, - /// - /// Writes blocks to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Write = 0x0A, - /// - /// Writes blocks to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Write10 = 0x2A, - /// - /// Writes blocks to the device - /// SBC-2 rev. 4 - /// - Write16 = 0x8A, - /// - /// Writes blocks to the device and then verifies them - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteAndVerify = 0x2E, - /// - /// Writes blocks to the device and then verifies them - /// SBC-2 rev. 4 - /// - WriteAndVerify16 = 0x8E, - /// - /// Writes blocks to the device with a vendor specified format that shall include the ECC alongside the data - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteLong = 0x3F, - /// - /// Writes a single block several times - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteSame = 0x41, - /// - /// Writes a single block several times - /// SBC-2 rev. 4 - /// - WriteSame16 = 0x93, - /// - /// Requets XOR data generated by an or command - /// SBC-1 rev. 8c - /// - XDRead = 0x52, - /// - /// XORs the data sent with data on the medium and stores it until an is issued - /// SBC-1 rev. 8c - /// - XDWrite = 0x50, - /// - /// XORs the data sent with data on the medium and stores it until an is issued - /// SBC-1 rev. 8c - /// - XDWrite16 = 0x80, - /// - /// Requets the target to XOR the sent data with the data on the medium and return the results - /// - XDWriteRead = 0x53, - /// - /// Requests the target to XOR the data transferred with the data on the medium and writes it to the medium - /// SBC-1 rev. 8c - /// - XPWrite = 0x51, - #endregion SCSI Block Commands (SBC) - - #region SCSI Streaming Commands (SSC) - /// - /// Prepares the medium for use by the LUN - /// SSC-1 rev. 22 - /// - FormatMedium = 0x04, - /// - /// Erases part of all of the medium from the current position - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Erase = 0x19, - /// - /// Enables or disables the LUN for further operations - /// SCSI-2 X3T9.2/375R rev. 10l - /// - LoadUnload = 0x1B, - /// - /// Positions the LUN to a specified block in a specified partition - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Locate = 0x2B, - /// - /// Positions the LUN to a specified block in a specified partition - /// SSC-2 rev. 09 - /// - Locate16 = 0x92, - /// - /// Requests the block length limits capability - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadBlockLimits = 0x05, - /// - /// Reads the current position - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadPosition = 0x34, - /// - /// Reads blocks from the device, in reverse order - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadReverse = 0x0F, - /// - /// Retrieves data from the device buffer that has not been successfully written to the medium (or printed) - /// SCSI-2 X3T9.2/375R rev. 10l - /// - RecoverBufferedData = 0x14, - /// - /// Requests information regarding the supported densities for the logical unit - /// SSC-1 rev. 22 - /// - ReportDensitySupport = 0x44, - /// - /// Seeks the medium to the beginning of partition in current partition - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Rewind = 0x01, - /// - /// A variety of positioning functions - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Space = 0x11, - /// - /// A variety of positioning functions - /// SSC-2 rev. 09 - /// - Space16 = 0x91, - /// - /// Verifies one or more blocks from the next one - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Verify = 0x13, - /// - /// Writes the specified number of filemarks or setmarks in the current position - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteFileMarks=0x10, - #endregion SCSI Streaming Commands (SSC) - - #region SCSI Streaming Commands for Printers (SSC) - /// - /// Specifies forms or fronts - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Format = 0x04, - /// - /// Transfers data to be printed - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Print = 0x0A, - /// - /// Transfers data to be printed with a slew value - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SlewAndPrint = 0x0B, - /// - /// Halts printing - /// SCSI-2 X3T9.2/375R rev. 10l - /// - StopPrint = 0x1B, - /// - /// Assures that the data in the buffer has been printed, or, for other devices, written to media - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SynchronizeBuffer = 0x10, - #endregion SCSI Streaming Commands for Printers (SSC) - - #region SCSI Processor Commands - /// - /// Transfers data from the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Receive = 0x08, - /// - /// Sends data to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Send = 0x0A, - #endregion SCSI Processor Commands - - #region SCSI Multimedia Commands (MMC) - /// - /// Erases any part of a CD-RW - /// MMC-1 rev. 9 - /// - Blank = 0xA1, - /// - /// Closes a track or session - /// MMC-1 rev. 9 - /// - CloseTrackSession = 0x5B, - /// - /// Gets information about the overall capabilities of the device and the current capabilities of the device - /// MMC-2 rev. 11a - /// - GetConfiguration = 0x46, - /// - /// Requests the LUN to report events and statuses - /// MMC-2 rev. 11a - /// - GetEventStatusNotification = 0x4A, - /// - /// Provides a mehotd to profile the performance of the drive - /// MMC-2 rev. 11a - /// - GetPerformance = 0xAC, - /// - /// Requests the device changer to load or unload a disc - /// MMC-1 rev. 9 - /// - LoadUnloadCd = 0xA6, - /// - /// Requests the device changer to load or unload a disc - /// MMC-2 rev. 11a - /// - LoadUnloadMedium = 0xA6, - /// - /// Requests information about the current status of the CD device, including any changer mechanism - /// MMC-1 rev. 9 - /// - MechanicalStatus = 0xBD, - /// - /// Requests the device to start or stop an audio play operation - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PauseResume = 0x4B, - /// - /// Begins an audio playback - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayAudio = 0x45, - /// - /// Begins an audio playback - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayAudio12 = 0xA5, - /// - /// Begins an audio playback using MSF addressing - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayAudioMsf = 0x47, - /// - /// Begins an audio playback from the specified index of the specified track - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayAudioTrackIndex = 0x48, - /// - /// Begins an audio playback from the position relative of a track - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayTrackRelative = 0x49, - /// - /// Begins an audio playback from the position relative of a track - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PlayTrackRelative12 = 0xA9, - /// - /// Reports the total and blank area of the device buffer - /// MMC-1 rev. 9 - /// - ReadBufferCapacity = 0x5C, - /// - /// Reads a block from a CD with any of the requested CD data streams - /// MMC-1 rev. 9 - /// - ReadCd = 0xBE, - /// - /// Reads a block from a CD with any of the requested CD data streams using MSF addressing - /// MMC-1 rev. 9 - /// - ReadCdMsf = 0xB9, - /// - /// Returns the recorded size of the CD - /// MMC-1 rev. 9 - /// - ReadCdRecordedCapacity = 0x25, - /// - /// Gets informationn about all discs: CD-ROM, CD-R and CD-RW - /// MMC-1 rev. 9 - /// - ReadDiscInformation = 0x51, - /// - /// Reads areas from the DVD or BD media - /// MMC-5 rev. 2c - /// - ReadDiscStructure = 0xAD, - /// - /// Reads areas from the DVD media - /// MMC-2 rev. 11a - /// - ReadDvdStructure = 0xAD, - /// - /// Requests a list of the possible format capacities for an installed random-writable media - /// MMC-2 rev. 11a - /// - ReadFormatCapacities = 0x23, - /// - /// Reads the data block header of the specified CD-ROM block - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadHeader = 0x44, - /// - /// Reads the mastering information from a Master CD. - /// MMC-1 rev. 9 - /// - ReadMasterCue = 0x59, - /// - /// Requests the Q subchannel and the current audio playback status - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadSubChannel = 0x42, - /// - /// Requests the medium TOC, PMA or ATIP from the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadTocPmaAtip = 0x43, - /// - /// Gets information about a track regardless of its status - /// MMC-1 rev. 9 - /// - ReadTrackInformation = 0x52, - /// - /// Repairs an incomplete ECC block at the end of an RZone - /// Mt. Fuji ver. 7 rev. 1.21 - /// - RepairRZone = 0x58, - /// - /// Repairs an incomplete packet at the end of a packet writing track - /// MMC-1 rev. 9 - /// - RepairTrack = 0x58, - /// - /// Requests the start of the authentication process and provides data necessary for authentication and for generating a Bus Key - /// MMC-2 rev. 11a - /// - ReportKey = 0xA4, - /// - /// Reserves disc space for a track - /// MMC-1 rev. 9 - /// - ReserveTrack = 0x53, - /// - /// Fast-forwards or fast-reverses the audio playback to the specified block. Stops if it encounters a data track - /// MMC-1 rev. 9 - /// - ScanMmc = 0xBA, - /// - /// Sends a cue sheet for session-at-once recording - /// MMC-1 rev. 9 - /// - SendCueSheet = 0x5D, - /// - /// Transfer a DVD or BD structure for media writing - /// MMC-5 rev. 2c - /// - SendDiscStructure = 0xAD, - /// - /// Transfer a DVD structure for media writing - /// MMC-2 rev. 11a - /// - SendDvdStructure = 0xAD, - /// - /// Requests the LUN to process an event - /// MMC-2 rev. 11a - /// - SendEvent = 0xA2, - /// - /// Provides data necessary for authentication and for generating a Bus Key - /// MMC-2 rev. 11a - /// - SendKey = 0xA3, - /// - /// Restores the Optimum Power Calibration values to the drive for a specific disc - /// MMC-1 rev. 9 - /// - SendOpcInformation = 0x54, - /// - /// Sets the spindle speed to be used while reading/writing data to a CD - /// MMC-1 rev. 9 - /// - SetCdRomSpeed = 0xBB, - /// - /// Requests the LUN to perform read ahead caching operations from the specified block - /// MMC-2 rev. 11a - /// - SetReadAhead = 0xA7, - /// - /// Indicates the LUN to try to achieve a specified performance - /// MMC-2 rev. 11a - /// - SetStreaming = 0xB6, - /// - /// Stops a scan and continues audio playback from current scanning position - /// MMC-1 rev. 9 - /// - StopPlayScan = 0x4E, - #endregion SCSI Multimedia Commands (MMC) - - #region SCSI Scanner Commands - /// - /// Gets information about the data buffer - /// SCSI-2 X3T9.2/375R rev. 10l - /// - GetDataBufferStatus = 0x34, - /// - /// Gets information about previously defined windows - /// SCSI-2 X3T9.2/375R rev. 10l - /// - GetWindow = 0x25, - /// - /// Provides positioning functions - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ObjectPosition = 0x31, - /// - /// Begins a scan operation - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Scan = 0x1B, - /// - /// Specifies one or more windows within the device's scanning range - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SetWindow = 0x24, - /// - /// Sends data to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Send10 = 0x2A, - #endregion SCSI Scanner Commands - - #region SCSI Block Commands for Optical Media (SBC) - /// - /// Erases the specified number of blocks - /// - Erase10 = 0x2C, - /// - /// Erases the specified number of blocks - /// - Erase12 = 0xAC, - /// - /// Searches the medium for a contiguos set of written or blank blocks - /// - MediumScan = 0x38, - /// - /// Reads blocks from device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Read12 = 0xA8, - /// - /// Gets medium's defect data - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadDefectData12 = 0xB7, - /// - /// Gets the maxium generation address for the specified block - /// - ReadGeneration = 0x29, - /// - /// Reads a specified generation of a specified block - /// - ReadUpdatedBlock = 0x2D, - /// - /// Searches data on blocks - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataEqual12 = 0xB1, - /// - /// Searches data on blocks using major than or equal comparison - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataHigh12 = 0xB0, - /// - /// Searches data on blocks using minor than or equal comparison - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SearchDataLow12 = 0xB2, - /// - /// Defines the range within which subsequent linked commands may operate - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SetLimits12 = 0xB3, - /// - /// Replaces a block with data - /// - UpdateBlock = 0x3D, - /// - /// Verifies blocks on the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Verify12 = 0xAF, - /// - /// Writes blocks to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - Write12 = 0xAA, - /// - /// Writes blocks to the device and then verifies them - /// SCSI-2 X3T9.2/375R rev. 10l - /// - WriteAndVerify12 = 0xAE, - #endregion SCSI Block Commands for Optical Media (SBC) - - #region SCSI Medium Changer Commands (SMC) - /// - /// Provides a means to exchange the medium in the source element with the medium at destination element - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ExchangeMedium = 0xA6, - /// - /// Checks all elements for medium and any other relevant status - /// SCSI-2 X3T9.2/375R rev. 10l - /// - InitializeElementStatus = 0x07, - /// - /// Checks all elements for medium and any other relevant status in the specified range of elements - /// SMC-2 rev. 7 - /// - InitializeElementStatusWithRange = 0x37, - /// - /// Moves a medium from an element to another - /// SCSI-2 X3T9.2/375R rev. 10l - /// - MoveMedium = 0xA5, - /// - /// Moves a medium that's currently attached to another element - /// SPC-1 rev. 10 - /// - MoveMediumAttached = 0xA7, - /// - /// Provides a method to change the open/closed state of the specified import/export element - /// SMC-3 rev. 12 - /// - OpenCloseImportExportElement = 0x1B, - /// - /// Positions the transport element in front of the destination element - /// SCSI-2 X3T9.2/375R rev. 10l - /// - PositionToElement = 0x2B, - /// - /// Requests the status of the elements - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReadElementStatus = 0xB8, - /// - /// Requests the status of the attached element - /// SPC-1 rev. 10 - /// - ReadElementStatusAttached = 0xB4, - /// - /// Releases a reserved LUN - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReleaseElement = 0x17, - /// - /// Releases a reserved LUN - /// SMC-1 rev. 10a - /// - ReleaseElement10 = 0x57, - /// - /// Requests information regarding the supported volume types for the device - /// SMC-3 rev. 12 - /// - ReportVolumeTypesSupported = 0x44, - /// - /// Gets the results of - /// SCSI-2 X3T9.2/375R rev. 10l - /// - RequestVolumeElementAddress = 0xB5, - /// - /// Reserves a LUN - /// SCSI-2 X3T9.2/375R rev. 10l - /// - ReserveElement = 0x16, - /// - /// Reserves a LUN - /// SMC-1 rev. 10a - /// - ReserveElement10 = 0x56, - /// - /// Transfers a volume tag template to be searched or new volume tag information for one or more elements - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SendVolumeTag = 0xB6, - #endregion SCSI Medium Changer Commands (SMC) - - #region SCSI Communication Commands - /// - /// Gets data from the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - GetMessage = 0x08, - /// - /// Gets data from the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - GetMessage10 = 0x28, - /// - /// Gets data from the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - GetMessage12 = 0xA8, - /// - /// Sends data to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SendMessage = 0x0A, - /// - /// Sends data to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SendMessage10 = 0x2A, - /// - /// Sends data to the device - /// SCSI-2 X3T9.2/375R rev. 10l - /// - SendMessage12 = 0xAA, - #endregion SCSI Communication Commands - - #region SCSI Controller Commands - /// - /// Commands that get information about redundancy groups - /// SCC-2 rev. 4 - /// - RedundancyGroupIn = 0xBA, - /// - /// Commands that set information about redundancy groups - /// SCC-2 rev. 4 - /// - RedundancyGroupOut = 0xBB, - /// - /// Commands that get information about volume sets - /// SCC-2 rev. 4 - /// - VolumeSetIn = 0xBE, - /// - /// Commands that set information about volume sets - /// SCC-2 rev. 4 - /// - VolumeSetOut = 0xBF, - #endregion SCSI Controller Commands - - #region Pioneer CD-ROM SCSI-2 Command Set - /// - /// Scans for a block playing a block on each track cross - /// - AudioScan = 0xCD, - /// - /// Requests the drive the status from the previous WriteCDP command. - /// - ReadCDP = 0xE4, - /// - /// Requests status from the drive - /// - ReadDriveStatus = 0xE0, - /// - /// Reads CD-DA data and/or subcode data - /// - ReadCdDa = 0xD8, - /// - /// Reads CD-DA data and/or subcode data using MSF addressing - /// - ReadCdDaMsf = 0xD9, - /// - /// Reads CD-XA data - /// - ReadCdXa = 0xDB, - /// - /// Reads all subcode data - /// - ReadAllSubCode = 0xDF, - /// - /// Sets the spindle speed to be used while reading/writing data to a CD - /// - SetCdSpeed = 0xDA, - #endregion - - #region ATA Command Pass-Through - /// - /// Sends a 24-bit ATA command to the device - /// Clashes with - /// ATA CPT rev. 8a - /// - AtaPassThrough = 0xA1, - /// - /// Sends a 48-bit ATA command to the device - /// ATA CPT rev. 8a - /// - AtaPassThrough16 = 0x85, - #endregion ATA Command Pass-Through - - #region 6-byte CDB aliases - ModeSelect6 = ModeSelect, - ModeSense6 = ModeSense, - Read6 = Read, - Seek6 = Seek, - Write6 = Write, - #endregion 6-byte CDB aliases - - #region SCSI Zoned Block Commands - /// - /// ZBC commands with host->device information - /// - ZbcOut = 0x94, - /// - /// ZBC commands with device->host information - /// - ZbcIn = 0x95, - #endregion - - #region SCSI Commands with unknown meaning, mostly vendor specific - SetCdSpeedUnk = 0xB8, - WriteCdMsf = 0xA2, - WriteCd = 0xAA, - ReadDefectTag = 0xB7, - PlayCd = 0xBC, - SpareIn = 0xBC, - SpareOut = 0xBD, - WriteStream16 = 0x9A, - WriteAtomic = 0x9C, - ServiceActionBidirectional = 0x9D, - WriteLong2 = 0xEA, - UnknownCdCommand = 0xD4, - UnknownCdCommand2 = 0xD5, - #endregion SCSI Commands with unknown meaning, mostly vendor specific - - #region SEGA Packet Interface (all are 12-byte CDB) - /// - /// Verifies that the device can be accessed - /// Sega SPI ver. 1.30 - /// - Sega_TestUnit = TestUnitReady, - /// - /// Gets current CD status - /// Sega SPI ver. 1.30 - /// - Sega_RequestStatus = 0x10, - /// - /// Gets CD block mode info - /// Sega SPI ver. 1.30 - /// - Sega_RequestMode = 0x11, - /// - /// Sets CD block mode - /// Sega SPI ver. 1.30 - /// - Sega_SetMode = 0x12, - /// - /// Requests device error info - /// Sega SPI ver. 1.30 - /// - Sega_RequestError = 0x13, - /// - /// Gets disc TOC - /// Sega SPI ver. 1.30 - /// - Sega_GetToc = 0x14, - /// - /// Gets specified session data - /// Sega SPI ver. 1.30 - /// - Sega_RequestSession = 0x15, - /// - /// Stops the drive and opens the drive tray, or, on manual trays, stays busy until it is opened - /// Sega SPI ver. 1.30 - /// - Sega_OpenTray = 0x16, - /// - /// Starts audio playback - /// Sega SPI ver. 1.30 - /// - Sega_PlayCd = 0x20, - /// - /// Moves drive pickup to specified block - /// Sega SPI ver. 1.30 - /// - Sega_Seek = 0x21, - /// - /// Fast-forwards or fast-reverses until Lead-In or Lead-Out arrive, or until another command is issued - /// Sega SPI ver. 1.30 - /// - Sega_Scan = 0x22, - /// - /// Reads blocks from the disc - /// Sega SPI ver. 1.30 - /// - Sega_Read = 0x30, - /// - /// Reads blocks from the disc seeking to another position at end - /// Sega SPI ver. 1.30 - /// - Sega_Read2 = 0x31, - /// - /// Reads disc subcode - /// Sega SPI ver. 1.30 - /// - Sega_GetSubcode = 0x40, - #endregion SEGA Packet Interface (all are 12-byte CDB) - - /// - /// Variable sized Command Description Block - /// SPC-4 rev. 16 - /// - VariableSizedCDB = 0x7F - } - #endregion SCSI Commands + { + #region SASI Class 0 commands /// - /// SCSI command transfer direction + /// Returns zero status if requested unit is on and ready. + /// SASI rev. 0a /// - public enum ScsiDirection - { - /// - /// No data transfer happens - /// - None, - /// - /// From host to device - /// - Out, - /// - /// From device to host - /// - In, - /// - /// Bidirectional device/host - /// - Bidirectional, - /// - /// Unspecified - /// - Unspecified - } + TestUnitReady = 0x00, + /// + /// Sets the unit to a specific known state. + /// SASI rev. 0a + /// + RezeroUnit = 0x01, + /// + /// Unknown + /// SASI rev. 0a + /// + RequestSyndrome = 0x02, + /// + /// Returns unit sense. + /// SASI rev. 0a + /// + RequestSense = 0x03, + /// + /// Formats the entire media. + /// SASI rev. 0a + /// + FormatUnit = 0x04, + /// + /// Unknown + /// SASI rev. 0a + /// + CheckTrackFormat = 0x05, + /// + /// Unknown + /// SASI rev. 0a + /// + FormatTrack = 0x06, + /// + /// Unknown + /// SASI rev. 0a + /// + FormatBadTrack = 0x06, + /// + /// Reads a block from the device. + /// SASI rev. 0a + /// + Read = 0x08, + /// + /// SASI rev. 0a + /// Unknown + /// + WriteProtectSector = 0x09, + /// + /// Writes a block to the device. + /// SASI rev. 0a + /// + Write = 0x0A, + /// + /// Moves the device reading mechanism to the specified block. + /// SASI rev. 0a + /// + Seek = 0x0B, + /// + /// Unknown + /// SASI rev. 0a + /// + VerifyRestore = 0x0D, + /// + /// Unknown + /// SASI rev. 0a + /// + AssignAlternateDiskTrack = 0x0E, + /// + /// Writes a File Mark on the device. + /// SASI rev. 0c + /// + WriteFileMark = 0x0F, + /// + /// Reserves the device for use by the iniator. + /// SASI rev. 0a + /// + ReserveUnit = 0x12, + /// + /// Release the device from the reservation. + /// SASI rev. 0a + /// + ReleaseUnit = 0x13, + /// + /// Unknown + /// SASI rev. 0a + /// + WriteProtectDrive = 0x14, + /// + /// Writes and verifies blocks to the device. + /// SASI rev. 0c + /// + WriteVerify = 0x14, + /// + /// Unknown + /// SASI rev. 0a + /// + ReleaseWriteProtect = 0x15, + /// + /// Verifies blocks. + /// SASI rev. 0c + /// + Verify = 0x15, + /// + /// Unknown + /// SASI rev. 0a + /// + ReadNoSeek = 0x16, + /// + /// Gets the number of blocks in device. + /// SASI rev. 0c + /// + ReadCapacity = 0x16, + /// + /// Searches data on blocks + /// SASI rev. 0a + /// + SearchDataEqual = 0x17, + /// + /// Searches data on blocks using major than or equal comparison + /// SASI rev. 0a + /// + SearchDataHigh = 0x18, + /// + /// Searches data on blocks using minor than or equal comparison + /// SASI rev. 0a + /// + SearchDataLow = 0x19, + /// + /// Reads analysis data from a device + /// SASI rev. 0a + /// + ReadDiagnostic = 0x1A, + /// + /// Unknown + /// SASI rev. 0a + /// + VerifyData = 0x1B, + /// + /// Requests a device to run a diagnostic + /// SASI rev. 0c + /// + WriteDiagnostic = 0x1B, + /// + /// Gets information about a device + /// SASI rev. 0c + /// + Inquiry = 0x1F, + #endregion SASI Class 0 commands - #region SCSI's ATA Command Pass-Through - public enum AtaProtocol : byte - { - /// - /// Requests a device hard reset (pin 1) - /// - HardReset = 0, - /// - /// Requests a device soft reset (COMRESET issue) - /// - SoftReset = 1, - /// - /// No data is to be transfered - /// - NonData = 3, - /// - /// Requests a device->host transfer using PIO - /// - PioIn = 4, - /// - /// Requests a host->device transfer using PIO - /// - PioOut = 5, - /// - /// Requests a DMA transfer - /// - Dma = 6, - /// - /// Requests to queue a DMA transfer - /// - DmaQueued = 7, - /// - /// Requests device diagnostics - /// - DeviceDiagnostic = 8, - /// - /// Requets device reset - /// - DeviceReset = 9, - /// - /// Requests a device->host transfer using UltraDMA - /// - UDmaIn = 10, - /// - /// Requests a host->device transfer using UltraDMA - /// - UDmaOut = 11, - /// - /// Unknown Serial ATA - /// - FPDma = 12, - /// - /// Requests the Extended ATA Status Return Descriptor - /// - ReturnResponse = 15 - } + #region SASI Class 1 commands /// - /// Indicates the STL which ATA register contains the length of data to - /// be transfered + /// SASI rev. 0a + /// Unknown /// - public enum AtaTransferRegister : byte - { - /// - /// There is no transfer - /// - NoTransfer = 0, - /// - /// FEATURE register contains the data length - /// - Feature = 1, - /// - /// SECTOR_COUNT register contains the data length - /// - SectorCount = 2, - /// - /// The STPSIU contains the data length - /// - SPTSIU = 3 - } - #endregion SCSI's ATA Command Pass-Through + Copy = 0x20, + /// + /// SASI rev. 0a + /// Unknown + /// + Restore = 0x21, + /// + /// SASI rev. 0a + /// Unknown + /// + Backup = 0x22, + /// + /// SASI rev. 0a + /// Unknown + /// + SetBlockLimitsOld = 0x26, + /// + /// Sets write or read limits from a specified block + /// SASI rev. 0c + /// + SetBlockLimits = 0x28, + #endregion SASI Class 1 commands + + #region SASI Class 2 commands /// - /// ZBC sub-commands, mask 0x1F + /// Unknown + /// SASI rev. 0a /// - public enum ZBCSubCommands : byte - { - /// - /// Returns list with zones of specified types - /// - ReportZones = 0x00, - /// - /// Closes a zone - /// - CloseZone = 0x01, - /// - /// Finishes a zone - /// - FinishZone = 0x02, - /// - /// Opens a zone - /// - OpenZone = 0x03, - /// - /// Resets zone's write pointer to zone start - /// - ResetWritePointer = 0x04 - } + Load = 0x40, + /// + /// Unknown + /// SASI rev. 0a + /// + Unload = 0x41, + /// + /// Unknown + /// SASI rev. 0a + /// + Rewind = 0x42, + /// + /// Unknown + /// SASI rev. 0a + /// + SpaceForward = 0x43, + /// + /// Unknown + /// SASI rev. 0a + /// + SpaceForwardFileMark = 0x44, + /// + /// Unknown + /// SASI rev. 0a + /// + SpaceReserve = 0x45, + /// + /// Unknown + /// SASI rev. 0a + /// + SpaceReserveFileMark = 0x46, + /// + /// Unknown + /// SASI rev. 0a + /// + TrackSelect = 0x47, + /// + /// Reads blocks from device + /// SASI rev. 0a + /// + Read10 = 0x48, + /// + /// Unknown + /// SASI rev. 0a + /// + ReadVerify = 0x49, + /// + /// Unknown + /// SASI rev. 0a + /// + ReadDiagnosticClass2 = 0x4A, + /// + /// Writes blocks to device + /// SASI rev. 0a + /// + Write10 = 0x4B, + /// + /// Unknown + /// SASI rev. 0a + /// + WriteFileMarkClass2 = 0x4C, + /// + /// Unknown + /// SASI rev. 0a + /// + WriteExtended = 0x4D, + /// + /// Unknown + /// SASI rev. 0a + /// + WriteExtendedFileMark = 0x4E, + /// + /// Unknown + /// SASI rev. 0a + /// + WriteErase = 0x4F, + #endregion SASI Class 2 commands + + #region SASI Class 3 commands + + /// + /// SASI rev. 0a + /// + Skip = 0x60, + /// + /// SASI rev. 0a + /// + Space = 0x61, + /// + /// SASI rev. 0a + /// + Return = 0x62, + /// + /// SASI rev. 0a + /// + Tab = 0x63, + /// + /// SASI rev. 0a + /// + ReadControl = 0x64, + /// + /// SASI rev. 0a + /// + Write3 = 0x65, + /// + /// SASI rev. 0a + /// + WriteControl = 0x66, + #endregion SASI Class 3 commands + + #region SASI Class 6 commands + + /// + /// SASI rev. 0a + /// + DefineFloppyDiskTracFormat = 0xC0, + /// + /// SASI rev. 0a + /// + FormatDriveErrorMap = 0xC4, + /// + /// SASI rev. 0a + /// + ReadErrorMap = 0xC5, + /// + /// SASI rev. 0a + /// + ReadDriveType = 0xC6, + #endregion SASI Class 6 commands + + #region SASI Class 7 commands + + /// + /// SASI rev. 0a + /// + RamDiagnostic = 0xE0, + /// + /// SASI rev. 0a + /// + WriteECC = 0xE1, + /// + /// SASI rev. 0a + /// + ReadID = 0xE2, + /// + /// SASI rev. 0a + /// + DriveDiagnostic = 0xE3 + + #endregion SASI Class 7 commands + } + #endregion SASI Commands + + #region SCSI Commands + /// + /// All known SCSI and ATAPI commands + /// + public enum ScsiCommands : byte + { + #region SCSI Primary Commands (SPC) + + /// + /// Commands used to obtain information about the access controls that are active + /// SPC-4 rev. 16 + /// + AccessControlIn = 0x86, + /// + /// Commands used to limit or grant access to LUNs + /// SPC-4 rev. 16 + /// + AccessControlOut = 0x87, + /// + /// Modifies the operating definition of the device with respect to commmands. + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ChangeDefinition = 0x40, + /// + /// Compares data between two devices + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Compare = 0x39, + /// + /// Copies data between two devices + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Copy = 0x18, + /// + /// Copies data between two devices and verifies the copy is correct. + /// SCSI-2 X3T9.2/375R rev. 10l + /// + CopyAndVerify = 0x3A, + /// + /// Copies data between two devices + /// SPC-2 rev. 20 + /// + ExtendedCopy = 0x83, + /// + /// Requests information about the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Inquiry = 0x12, + /// + /// Manages device statistics + /// SCSI-2 X3T9.2/375R rev. 10l + /// + LogSelect = 0x4C, + /// + /// Gets device statistics + /// SCSI-2 X3T9.2/375R rev. 10l + /// + LogSense = 0x4D, + /// + /// Retrieves management protocol information + /// SPC-2 rev. 20 + /// + ManagementProtocolIn = 0xA3, + /// + /// Transfers management protocol information + /// SPC-2 rev. 20 + /// + ManagementProtocolOut = 0xA4, + /// + /// Sets device parameters + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ModeSelect = 0x15, + /// + /// Sets device parameters + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ModeSelect10 = 0x55, + /// + /// Gets device parameters + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ModeSense = 0x1A, + /// + /// Gets device parameters + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ModeSense10 = 0x5A, + /// + /// Obtains information about persistent reservations and reservation keys + /// SPC-1 rev. 10 + /// + PersistentReserveIn = 0x5E, + /// + /// Reserves a LUN or an extent within a LUN for exclusive or shared use + /// SPC-1 rev. 10 + /// + PersistentReserveOut = 0x5F, + /// + /// Requests the device to disable or enable the removal of the medium inside it + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PreventAllowMediumRemoval = 0x1E, + /// + /// Reads attribute values from medium auxiliary memory + /// SPC-3 rev. 21b + /// + ReadAttribute = 0x8C, + /// + /// Reads the device buffer + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadBuffer = 0x3C, + /// + /// Reads the media serial number + /// SPC-3 rev. 21b + /// + ReadSerialNumber = 0xAB, + /// + /// Receives information about a previous or current + /// SPC-2 rev. 20 + /// + ReceiveCopyResults = 0x84, + /// + /// Requests the data after completion of a + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReceiveDiagnostic = 0x1C, + /// + /// Releases a previously reserved LUN or extents + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Release = 0x17, + /// + /// Releases a previously reserved LUN or extents + /// SPC-1 rev. 10 + /// + Release10 = 0x57, + /// + /// Requests the LUNs that are present on the device + /// SPC-1 rev. 10 + /// + ReportLuns = 0xA0, + /// + /// Requests the device's sense + /// SCSI-2 X3T9.2/375R rev. 10l + /// + RequestSense = 0x03, + /// + /// Reserves a LUN or extent + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Reserve = 0x16, + /// + /// Reserves a LUN or extent + /// SPC-1 rev. 10 + /// + Reserve10 = 0x56, + /// + /// Retrieves security protocol information + /// SPC-4 rev. 16 + /// + SecurityProtocolIn = 0xA2, + /// + /// Transfers security protocol information + /// SPC-4 rev. 16 + /// + SecurityProtocolOut = 0xB5, + /// + /// Requests the device to perform diagnostics + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SendDiagnostic = 0x1D, + /// + /// Extended commands + /// SPC-4 + /// + ServiceActionIn = 0x9E, + /// + /// Extended commands + /// SPC-4 + /// + ServiceActionOut = 0x9F, + /// + /// Checks if a LUN is ready to access its medium + /// SCSI-2 X3T9.2/375R rev. 10l + /// + TestUnitReady = 0x00, + /// + /// Writes attribute values to medium auxiliary memory + /// SPC-3 rev. 21b + /// + WriteAttribute = 0x8C, + /// + /// Writes to the device's buffer + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteBuffer = 0x3B, + #endregion SCSI Primary Commands (SPC) + + #region SCSI Block Commands (SBC) + + /// + /// Compares blocks with sent data, and if equal, writes those block to device, atomically + /// SBC-3 rev. 25 + /// + CompareAndWrite = 0x89, + /// + /// Formats the medium into addressable logical blocks + /// SCSI-2 X3T9.2/375R rev. 10l + /// + FormatUnit = 0x04, + /// + /// Locks blocks from eviction of device's cache + /// SCSI-2 X3T9.2/375R rev. 10l + /// + LockUnlockCache = 0x36, + /// + /// Locks blocks from eviction of device's cache + /// SBC-2 rev. 4 + /// + LockUnlockCache16 = 0x92, + /// + /// Requests the device to perform the following uninterrupted series of actions: + /// 1.- Read the specified blocks + /// 2.- Transfer blocks from the data out buffer + /// 3.- Perform an OR operation between the read blocks and the buffer + /// 4.- Write the buffer to the blocks + /// SBC-3 rev. 16 + /// + ORWrite = 0x8B, + /// + /// Transfers requested blocks to devices' cache + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PreFetch = 0x34, + /// + /// Transfers requested blocks to devices' cache + /// SBC-3 rev. 16 + /// + PreFetch16 = 0x90, + /// + /// Reads blocks from device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Read = 0x08, + /// + /// Reads blocks from device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Read10 = 0x28, + /// + /// Reads blocks from device + /// SBC-2 rev. 4 + /// + Read16 = 0x88, + /// + /// Gets device capacity + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadCapacity = 0x25, + /// + /// Gets device's defect data + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadDefectData = 0x37, + /// + /// Reads blocks from device in a vendor-specific way that should include the ECC alongside the data + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadLong = 0x3E, + /// + /// Requests the device to reassign the defective blocks to another area of the medium + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReassignBlocks = 0x07, + /// + /// Requests the target write to the medium the XOR data generated from the specified source devices + /// SBC-1 rev. 8c + /// + Rebuild = 0x81, + /// + /// Requests the target write to the buffer the XOR data from its own medium and the specified source devices + /// SBC-1 rev. 8c + /// + Regenerate = 0x82, + /// + /// Requests the device to set the LUN in a vendor specific state + /// SCSI-2 X3T9.2/375R rev. 10l + /// + RezeroUnit = 0x01, + /// + /// Searches data on blocks + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataEqual = 0x31, + /// + /// Searches data on blocks using major than or equal comparison + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataHigh = 0x30, + /// + /// Searches data on blocks using minor than or equal comparison + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataLow = 0x32, + /// + /// Requests the device to seek to a specified blocks + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Seek = 0x0B, + /// + /// Requests the device to seek to a specified blocks + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Seek10 = 0x2B, + /// + /// Defines the range within which subsequent linked commands may operate + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SetLimits = 0x33, + /// + /// Requests the device to enable or disable the LUN for media access operations + /// SCSI-2 X3T9.2/375R rev. 10l + /// + StartStopUnit = 0x1B, + /// + /// Ensures that the blocks in the cache are written to the medium + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SynchronizeCache = 0x35, + /// + /// Ensures that the blocks in the cache are written to the medium + /// SBC-2 rev. 4 + /// + SynchronizeCache16 = 0x91, + /// + /// Unmaps one or more LBAs + /// In SSDs, this is trimming + /// SBC-3 rev. 25 + /// + Unmap = 0x42, + /// + /// Verifies blocks on the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Verify10 = 0x2F, + /// + /// Verifies blocks on the device + /// SBC-2 rev. 4 + /// + Verify16 = 0x8F, + /// + /// Writes blocks to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Write = 0x0A, + /// + /// Writes blocks to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Write10 = 0x2A, + /// + /// Writes blocks to the device + /// SBC-2 rev. 4 + /// + Write16 = 0x8A, + /// + /// Writes blocks to the device and then verifies them + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteAndVerify = 0x2E, + /// + /// Writes blocks to the device and then verifies them + /// SBC-2 rev. 4 + /// + WriteAndVerify16 = 0x8E, + /// + /// Writes blocks to the device with a vendor specified format that shall include the ECC alongside the data + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteLong = 0x3F, + /// + /// Writes a single block several times + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteSame = 0x41, + /// + /// Writes a single block several times + /// SBC-2 rev. 4 + /// + WriteSame16 = 0x93, + /// + /// Requets XOR data generated by an or command + /// SBC-1 rev. 8c + /// + XDRead = 0x52, + /// + /// XORs the data sent with data on the medium and stores it until an is issued + /// SBC-1 rev. 8c + /// + XDWrite = 0x50, + /// + /// XORs the data sent with data on the medium and stores it until an is issued + /// SBC-1 rev. 8c + /// + XDWrite16 = 0x80, + /// + /// Requets the target to XOR the sent data with the data on the medium and return the results + /// + XDWriteRead = 0x53, + /// + /// Requests the target to XOR the data transferred with the data on the medium and writes it to the medium + /// SBC-1 rev. 8c + /// + XPWrite = 0x51, + #endregion SCSI Block Commands (SBC) + + #region SCSI Streaming Commands (SSC) + + /// + /// Prepares the medium for use by the LUN + /// SSC-1 rev. 22 + /// + FormatMedium = 0x04, + /// + /// Erases part of all of the medium from the current position + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Erase = 0x19, + /// + /// Enables or disables the LUN for further operations + /// SCSI-2 X3T9.2/375R rev. 10l + /// + LoadUnload = 0x1B, + /// + /// Positions the LUN to a specified block in a specified partition + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Locate = 0x2B, + /// + /// Positions the LUN to a specified block in a specified partition + /// SSC-2 rev. 09 + /// + Locate16 = 0x92, + /// + /// Requests the block length limits capability + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadBlockLimits = 0x05, + /// + /// Reads the current position + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadPosition = 0x34, + /// + /// Reads blocks from the device, in reverse order + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadReverse = 0x0F, + /// + /// Retrieves data from the device buffer that has not been successfully written to the medium (or printed) + /// SCSI-2 X3T9.2/375R rev. 10l + /// + RecoverBufferedData = 0x14, + /// + /// Requests information regarding the supported densities for the logical unit + /// SSC-1 rev. 22 + /// + ReportDensitySupport = 0x44, + /// + /// Seeks the medium to the beginning of partition in current partition + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Rewind = 0x01, + /// + /// A variety of positioning functions + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Space = 0x11, + /// + /// A variety of positioning functions + /// SSC-2 rev. 09 + /// + Space16 = 0x91, + /// + /// Verifies one or more blocks from the next one + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Verify = 0x13, + /// + /// Writes the specified number of filemarks or setmarks in the current position + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteFileMarks = 0x10, + #endregion SCSI Streaming Commands (SSC) + + #region SCSI Streaming Commands for Printers (SSC) + + /// + /// Specifies forms or fronts + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Format = 0x04, + /// + /// Transfers data to be printed + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Print = 0x0A, + /// + /// Transfers data to be printed with a slew value + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SlewAndPrint = 0x0B, + /// + /// Halts printing + /// SCSI-2 X3T9.2/375R rev. 10l + /// + StopPrint = 0x1B, + /// + /// Assures that the data in the buffer has been printed, or, for other devices, written to media + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SynchronizeBuffer = 0x10, + #endregion SCSI Streaming Commands for Printers (SSC) + + #region SCSI Processor Commands + + /// + /// Transfers data from the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Receive = 0x08, + /// + /// Sends data to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Send = 0x0A, + #endregion SCSI Processor Commands + + #region SCSI Multimedia Commands (MMC) + + /// + /// Erases any part of a CD-RW + /// MMC-1 rev. 9 + /// + Blank = 0xA1, + /// + /// Closes a track or session + /// MMC-1 rev. 9 + /// + CloseTrackSession = 0x5B, + /// + /// Gets information about the overall capabilities of the device and the current capabilities of the device + /// MMC-2 rev. 11a + /// + GetConfiguration = 0x46, + /// + /// Requests the LUN to report events and statuses + /// MMC-2 rev. 11a + /// + GetEventStatusNotification = 0x4A, + /// + /// Provides a mehotd to profile the performance of the drive + /// MMC-2 rev. 11a + /// + GetPerformance = 0xAC, + /// + /// Requests the device changer to load or unload a disc + /// MMC-1 rev. 9 + /// + LoadUnloadCd = 0xA6, + /// + /// Requests the device changer to load or unload a disc + /// MMC-2 rev. 11a + /// + LoadUnloadMedium = 0xA6, + /// + /// Requests information about the current status of the CD device, including any changer mechanism + /// MMC-1 rev. 9 + /// + MechanicalStatus = 0xBD, + /// + /// Requests the device to start or stop an audio play operation + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PauseResume = 0x4B, + /// + /// Begins an audio playback + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayAudio = 0x45, + /// + /// Begins an audio playback + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayAudio12 = 0xA5, + /// + /// Begins an audio playback using MSF addressing + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayAudioMsf = 0x47, + /// + /// Begins an audio playback from the specified index of the specified track + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayAudioTrackIndex = 0x48, + /// + /// Begins an audio playback from the position relative of a track + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayTrackRelative = 0x49, + /// + /// Begins an audio playback from the position relative of a track + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PlayTrackRelative12 = 0xA9, + /// + /// Reports the total and blank area of the device buffer + /// MMC-1 rev. 9 + /// + ReadBufferCapacity = 0x5C, + /// + /// Reads a block from a CD with any of the requested CD data streams + /// MMC-1 rev. 9 + /// + ReadCd = 0xBE, + /// + /// Reads a block from a CD with any of the requested CD data streams using MSF addressing + /// MMC-1 rev. 9 + /// + ReadCdMsf = 0xB9, + /// + /// Returns the recorded size of the CD + /// MMC-1 rev. 9 + /// + ReadCdRecordedCapacity = 0x25, + /// + /// Gets informationn about all discs: CD-ROM, CD-R and CD-RW + /// MMC-1 rev. 9 + /// + ReadDiscInformation = 0x51, + /// + /// Reads areas from the DVD or BD media + /// MMC-5 rev. 2c + /// + ReadDiscStructure = 0xAD, + /// + /// Reads areas from the DVD media + /// MMC-2 rev. 11a + /// + ReadDvdStructure = 0xAD, + /// + /// Requests a list of the possible format capacities for an installed random-writable media + /// MMC-2 rev. 11a + /// + ReadFormatCapacities = 0x23, + /// + /// Reads the data block header of the specified CD-ROM block + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadHeader = 0x44, + /// + /// Reads the mastering information from a Master CD. + /// MMC-1 rev. 9 + /// + ReadMasterCue = 0x59, + /// + /// Requests the Q subchannel and the current audio playback status + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadSubChannel = 0x42, + /// + /// Requests the medium TOC, PMA or ATIP from the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadTocPmaAtip = 0x43, + /// + /// Gets information about a track regardless of its status + /// MMC-1 rev. 9 + /// + ReadTrackInformation = 0x52, + /// + /// Repairs an incomplete ECC block at the end of an RZone + /// Mt. Fuji ver. 7 rev. 1.21 + /// + RepairRZone = 0x58, + /// + /// Repairs an incomplete packet at the end of a packet writing track + /// MMC-1 rev. 9 + /// + RepairTrack = 0x58, + /// + /// Requests the start of the authentication process and provides data necessary for authentication and for generating a Bus Key + /// MMC-2 rev. 11a + /// + ReportKey = 0xA4, + /// + /// Reserves disc space for a track + /// MMC-1 rev. 9 + /// + ReserveTrack = 0x53, + /// + /// Fast-forwards or fast-reverses the audio playback to the specified block. Stops if it encounters a data track + /// MMC-1 rev. 9 + /// + ScanMmc = 0xBA, + /// + /// Sends a cue sheet for session-at-once recording + /// MMC-1 rev. 9 + /// + SendCueSheet = 0x5D, + /// + /// Transfer a DVD or BD structure for media writing + /// MMC-5 rev. 2c + /// + SendDiscStructure = 0xAD, + /// + /// Transfer a DVD structure for media writing + /// MMC-2 rev. 11a + /// + SendDvdStructure = 0xAD, + /// + /// Requests the LUN to process an event + /// MMC-2 rev. 11a + /// + SendEvent = 0xA2, + /// + /// Provides data necessary for authentication and for generating a Bus Key + /// MMC-2 rev. 11a + /// + SendKey = 0xA3, + /// + /// Restores the Optimum Power Calibration values to the drive for a specific disc + /// MMC-1 rev. 9 + /// + SendOpcInformation = 0x54, + /// + /// Sets the spindle speed to be used while reading/writing data to a CD + /// MMC-1 rev. 9 + /// + SetCdRomSpeed = 0xBB, + /// + /// Requests the LUN to perform read ahead caching operations from the specified block + /// MMC-2 rev. 11a + /// + SetReadAhead = 0xA7, + /// + /// Indicates the LUN to try to achieve a specified performance + /// MMC-2 rev. 11a + /// + SetStreaming = 0xB6, + /// + /// Stops a scan and continues audio playback from current scanning position + /// MMC-1 rev. 9 + /// + StopPlayScan = 0x4E, + #endregion SCSI Multimedia Commands (MMC) + + #region SCSI Scanner Commands + + /// + /// Gets information about the data buffer + /// SCSI-2 X3T9.2/375R rev. 10l + /// + GetDataBufferStatus = 0x34, + /// + /// Gets information about previously defined windows + /// SCSI-2 X3T9.2/375R rev. 10l + /// + GetWindow = 0x25, + /// + /// Provides positioning functions + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ObjectPosition = 0x31, + /// + /// Begins a scan operation + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Scan = 0x1B, + /// + /// Specifies one or more windows within the device's scanning range + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SetWindow = 0x24, + /// + /// Sends data to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Send10 = 0x2A, + #endregion SCSI Scanner Commands + + #region SCSI Block Commands for Optical Media (SBC) + + /// + /// Erases the specified number of blocks + /// + Erase10 = 0x2C, + /// + /// Erases the specified number of blocks + /// + Erase12 = 0xAC, + /// + /// Searches the medium for a contiguos set of written or blank blocks + /// + MediumScan = 0x38, + /// + /// Reads blocks from device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Read12 = 0xA8, + /// + /// Gets medium's defect data + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadDefectData12 = 0xB7, + /// + /// Gets the maxium generation address for the specified block + /// + ReadGeneration = 0x29, + /// + /// Reads a specified generation of a specified block + /// + ReadUpdatedBlock = 0x2D, + /// + /// Searches data on blocks + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataEqual12 = 0xB1, + /// + /// Searches data on blocks using major than or equal comparison + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataHigh12 = 0xB0, + /// + /// Searches data on blocks using minor than or equal comparison + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SearchDataLow12 = 0xB2, + /// + /// Defines the range within which subsequent linked commands may operate + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SetLimits12 = 0xB3, + /// + /// Replaces a block with data + /// + UpdateBlock = 0x3D, + /// + /// Verifies blocks on the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Verify12 = 0xAF, + /// + /// Writes blocks to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + Write12 = 0xAA, + /// + /// Writes blocks to the device and then verifies them + /// SCSI-2 X3T9.2/375R rev. 10l + /// + WriteAndVerify12 = 0xAE, + #endregion SCSI Block Commands for Optical Media (SBC) + + #region SCSI Medium Changer Commands (SMC) + + /// + /// Provides a means to exchange the medium in the source element with the medium at destination element + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ExchangeMedium = 0xA6, + /// + /// Checks all elements for medium and any other relevant status + /// SCSI-2 X3T9.2/375R rev. 10l + /// + InitializeElementStatus = 0x07, + /// + /// Checks all elements for medium and any other relevant status in the specified range of elements + /// SMC-2 rev. 7 + /// + InitializeElementStatusWithRange = 0x37, + /// + /// Moves a medium from an element to another + /// SCSI-2 X3T9.2/375R rev. 10l + /// + MoveMedium = 0xA5, + /// + /// Moves a medium that's currently attached to another element + /// SPC-1 rev. 10 + /// + MoveMediumAttached = 0xA7, + /// + /// Provides a method to change the open/closed state of the specified import/export element + /// SMC-3 rev. 12 + /// + OpenCloseImportExportElement = 0x1B, + /// + /// Positions the transport element in front of the destination element + /// SCSI-2 X3T9.2/375R rev. 10l + /// + PositionToElement = 0x2B, + /// + /// Requests the status of the elements + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReadElementStatus = 0xB8, + /// + /// Requests the status of the attached element + /// SPC-1 rev. 10 + /// + ReadElementStatusAttached = 0xB4, + /// + /// Releases a reserved LUN + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReleaseElement = 0x17, + /// + /// Releases a reserved LUN + /// SMC-1 rev. 10a + /// + ReleaseElement10 = 0x57, + /// + /// Requests information regarding the supported volume types for the device + /// SMC-3 rev. 12 + /// + ReportVolumeTypesSupported = 0x44, + /// + /// Gets the results of + /// SCSI-2 X3T9.2/375R rev. 10l + /// + RequestVolumeElementAddress = 0xB5, + /// + /// Reserves a LUN + /// SCSI-2 X3T9.2/375R rev. 10l + /// + ReserveElement = 0x16, + /// + /// Reserves a LUN + /// SMC-1 rev. 10a + /// + ReserveElement10 = 0x56, + /// + /// Transfers a volume tag template to be searched or new volume tag information for one or more elements + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SendVolumeTag = 0xB6, + #endregion SCSI Medium Changer Commands (SMC) + + #region SCSI Communication Commands + + /// + /// Gets data from the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + GetMessage = 0x08, + /// + /// Gets data from the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + GetMessage10 = 0x28, + /// + /// Gets data from the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + GetMessage12 = 0xA8, + /// + /// Sends data to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SendMessage = 0x0A, + /// + /// Sends data to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SendMessage10 = 0x2A, + /// + /// Sends data to the device + /// SCSI-2 X3T9.2/375R rev. 10l + /// + SendMessage12 = 0xAA, + #endregion SCSI Communication Commands + + #region SCSI Controller Commands + + /// + /// Commands that get information about redundancy groups + /// SCC-2 rev. 4 + /// + RedundancyGroupIn = 0xBA, + /// + /// Commands that set information about redundancy groups + /// SCC-2 rev. 4 + /// + RedundancyGroupOut = 0xBB, + /// + /// Commands that get information about volume sets + /// SCC-2 rev. 4 + /// + VolumeSetIn = 0xBE, + /// + /// Commands that set information about volume sets + /// SCC-2 rev. 4 + /// + VolumeSetOut = 0xBF, + #endregion SCSI Controller Commands + + #region Pioneer CD-ROM SCSI-2 Command Set + + /// + /// Scans for a block playing a block on each track cross + /// + AudioScan = 0xCD, + /// + /// Requests the drive the status from the previous WriteCDP command. + /// + ReadCDP = 0xE4, + /// + /// Requests status from the drive + /// + ReadDriveStatus = 0xE0, + /// + /// Reads CD-DA data and/or subcode data + /// + ReadCdDa = 0xD8, + /// + /// Reads CD-DA data and/or subcode data using MSF addressing + /// + ReadCdDaMsf = 0xD9, + /// + /// Reads CD-XA data + /// + ReadCdXa = 0xDB, + /// + /// Reads all subcode data + /// + ReadAllSubCode = 0xDF, + /// + /// Sets the spindle speed to be used while reading/writing data to a CD + /// + SetCdSpeed = 0xDA, + #endregion + + #region ATA Command Pass-Through + + /// + /// Sends a 24-bit ATA command to the device + /// Clashes with + /// ATA CPT rev. 8a + /// + AtaPassThrough = 0xA1, + /// + /// Sends a 48-bit ATA command to the device + /// ATA CPT rev. 8a + /// + AtaPassThrough16 = 0x85, + #endregion ATA Command Pass-Through + + #region 6-byte CDB aliases + + ModeSelect6 = ModeSelect, + ModeSense6 = ModeSense, + Read6 = Read, + Seek6 = Seek, + Write6 = Write, + #endregion 6-byte CDB aliases + + #region SCSI Zoned Block Commands + + /// + /// ZBC commands with host->device information + /// + ZbcOut = 0x94, + /// + /// ZBC commands with device->host information + /// + ZbcIn = 0x95, + #endregion + + #region SCSI Commands with unknown meaning, mostly vendor specific + + SetCdSpeedUnk = 0xB8, + WriteCdMsf = 0xA2, + WriteCd = 0xAA, + ReadDefectTag = 0xB7, + PlayCd = 0xBC, + SpareIn = 0xBC, + SpareOut = 0xBD, + WriteStream16 = 0x9A, + WriteAtomic = 0x9C, + ServiceActionBidirectional = 0x9D, + WriteLong2 = 0xEA, + UnknownCdCommand = 0xD4, + UnknownCdCommand2 = 0xD5, + #endregion SCSI Commands with unknown meaning, mostly vendor specific + + #region SEGA Packet Interface (all are 12-byte CDB) + + /// + /// Verifies that the device can be accessed + /// Sega SPI ver. 1.30 + /// + Sega_TestUnit = TestUnitReady, + /// + /// Gets current CD status + /// Sega SPI ver. 1.30 + /// + Sega_RequestStatus = 0x10, + /// + /// Gets CD block mode info + /// Sega SPI ver. 1.30 + /// + Sega_RequestMode = 0x11, + /// + /// Sets CD block mode + /// Sega SPI ver. 1.30 + /// + Sega_SetMode = 0x12, + /// + /// Requests device error info + /// Sega SPI ver. 1.30 + /// + Sega_RequestError = 0x13, + /// + /// Gets disc TOC + /// Sega SPI ver. 1.30 + /// + Sega_GetToc = 0x14, + /// + /// Gets specified session data + /// Sega SPI ver. 1.30 + /// + Sega_RequestSession = 0x15, + /// + /// Stops the drive and opens the drive tray, or, on manual trays, stays busy until it is opened + /// Sega SPI ver. 1.30 + /// + Sega_OpenTray = 0x16, + /// + /// Starts audio playback + /// Sega SPI ver. 1.30 + /// + Sega_PlayCd = 0x20, + /// + /// Moves drive pickup to specified block + /// Sega SPI ver. 1.30 + /// + Sega_Seek = 0x21, + /// + /// Fast-forwards or fast-reverses until Lead-In or Lead-Out arrive, or until another command is issued + /// Sega SPI ver. 1.30 + /// + Sega_Scan = 0x22, + /// + /// Reads blocks from the disc + /// Sega SPI ver. 1.30 + /// + Sega_Read = 0x30, + /// + /// Reads blocks from the disc seeking to another position at end + /// Sega SPI ver. 1.30 + /// + Sega_Read2 = 0x31, + /// + /// Reads disc subcode + /// Sega SPI ver. 1.30 + /// + Sega_GetSubcode = 0x40, + #endregion SEGA Packet Interface (all are 12-byte CDB) + + /// + /// Variable sized Command Description Block + /// SPC-4 rev. 16 + /// + VariableSizedCDB = 0x7F + } + #endregion SCSI Commands + + /// + /// SCSI command transfer direction + /// + public enum ScsiDirection + { + /// + /// No data transfer happens + /// + None, + /// + /// From host to device + /// + Out, + /// + /// From device to host + /// + In, + /// + /// Bidirectional device/host + /// + Bidirectional, + /// + /// Unspecified + /// + Unspecified + } + + #region SCSI's ATA Command Pass-Through + public enum AtaProtocol : byte + { + /// + /// Requests a device hard reset (pin 1) + /// + HardReset = 0, + /// + /// Requests a device soft reset (COMRESET issue) + /// + SoftReset = 1, + /// + /// No data is to be transfered + /// + NonData = 3, + /// + /// Requests a device->host transfer using PIO + /// + PioIn = 4, + /// + /// Requests a host->device transfer using PIO + /// + PioOut = 5, + /// + /// Requests a DMA transfer + /// + Dma = 6, + /// + /// Requests to queue a DMA transfer + /// + DmaQueued = 7, + /// + /// Requests device diagnostics + /// + DeviceDiagnostic = 8, + /// + /// Requets device reset + /// + DeviceReset = 9, + /// + /// Requests a device->host transfer using UltraDMA + /// + UDmaIn = 10, + /// + /// Requests a host->device transfer using UltraDMA + /// + UDmaOut = 11, + /// + /// Unknown Serial ATA + /// + FPDma = 12, + /// + /// Requests the Extended ATA Status Return Descriptor + /// + ReturnResponse = 15 + } + + /// + /// Indicates the STL which ATA register contains the length of data to + /// be transfered + /// + public enum AtaTransferRegister : byte + { + /// + /// There is no transfer + /// + NoTransfer = 0, + /// + /// FEATURE register contains the data length + /// + Feature = 1, + /// + /// SECTOR_COUNT register contains the data length + /// + SectorCount = 2, + /// + /// The STPSIU contains the data length + /// + SPTSIU = 3 + } + #endregion SCSI's ATA Command Pass-Through + + /// + /// ZBC sub-commands, mask 0x1F + /// + public enum ZBCSubCommands : byte + { + /// + /// Returns list with zones of specified types + /// + ReportZones = 0x00, + /// + /// Closes a zone + /// + CloseZone = 0x01, + /// + /// Finishes a zone + /// + FinishZone = 0x02, + /// + /// Opens a zone + /// + OpenZone = 0x03, + /// + /// Resets zone's write pointer to zone start + /// + ResetWritePointer = 0x04 } } diff --git a/DiscImageChef.Devices/Linux/Command.cs b/DiscImageChef.Devices/Linux/Command.cs index 3b3aabaa..11f23b79 100644 --- a/DiscImageChef.Devices/Linux/Command.cs +++ b/DiscImageChef.Devices/Linux/Command.cs @@ -99,50 +99,50 @@ namespace DiscImageChef.Devices.Linux return error; } - static ScsiIoctlDirection AtaProtocolToScsiDirection(Enums.AtaProtocol protocol) + static ScsiIoctlDirection AtaProtocolToScsiDirection(AtaProtocol protocol) { switch (protocol) { - case Enums.AtaProtocol.DeviceDiagnostic: - case Enums.AtaProtocol.DeviceReset: - case Enums.AtaProtocol.HardReset: - case Enums.AtaProtocol.NonData: - case Enums.AtaProtocol.SoftReset: - case Enums.AtaProtocol.ReturnResponse: + case AtaProtocol.DeviceDiagnostic: + case AtaProtocol.DeviceReset: + case AtaProtocol.HardReset: + case AtaProtocol.NonData: + case AtaProtocol.SoftReset: + case AtaProtocol.ReturnResponse: return ScsiIoctlDirection.None; - case Enums.AtaProtocol.PioIn: - case Enums.AtaProtocol.UDmaIn: + case AtaProtocol.PioIn: + case AtaProtocol.UDmaIn: return ScsiIoctlDirection.In; - case Enums.AtaProtocol.PioOut: - case Enums.AtaProtocol.UDmaOut: + case AtaProtocol.PioOut: + case AtaProtocol.UDmaOut: return ScsiIoctlDirection.Out; default: return ScsiIoctlDirection.Unspecified; } } - internal static int SendAtaCommand(int fd, Structs.AtaRegistersCHS registers, - out Structs.AtaErrorRegistersCHS errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + internal static int SendAtaCommand(int fd, AtaRegistersCHS registers, + out AtaErrorRegistersCHS errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { duration = 0; sense = false; - errorRegisters = new Structs.AtaErrorRegistersCHS(); + errorRegisters = new AtaErrorRegistersCHS(); if (buffer == null) return -1; byte[] cdb = new byte[16]; - cdb[0] = (byte)Enums.ScsiCommands.AtaPassThrough16; + cdb[0] = (byte)ScsiCommands.AtaPassThrough16; cdb[1] = (byte)(((byte)protocol << 1) & 0x1E); - if (transferRegister != Enums.AtaTransferRegister.NoTransfer && - protocol != Enums.AtaProtocol.NonData) + if (transferRegister != AtaTransferRegister.NoTransfer && + protocol != AtaProtocol.NonData) { switch (protocol) { - case Enums.AtaProtocol.PioIn: - case Enums.AtaProtocol.UDmaIn: + case AtaProtocol.PioIn: + case AtaProtocol.UDmaIn: cdb[2] = 0x08; break; default: @@ -186,28 +186,28 @@ namespace DiscImageChef.Devices.Linux return error; } - internal static int SendAtaCommand(int fd, Structs.AtaRegistersLBA28 registers, - out Structs.AtaErrorRegistersLBA28 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + internal static int SendAtaCommand(int fd, AtaRegistersLBA28 registers, + out AtaErrorRegistersLBA28 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { duration = 0; sense = false; - errorRegisters = new Structs.AtaErrorRegistersLBA28(); + errorRegisters = new AtaErrorRegistersLBA28(); if (buffer == null) return -1; byte[] cdb = new byte[16]; - cdb[0] = (byte)Enums.ScsiCommands.AtaPassThrough16; + cdb[0] = (byte)ScsiCommands.AtaPassThrough16; cdb[1] = (byte)(((byte)protocol << 1) & 0x1E); - if (transferRegister != Enums.AtaTransferRegister.NoTransfer && - protocol != Enums.AtaProtocol.NonData) + if (transferRegister != AtaTransferRegister.NoTransfer && + protocol != AtaProtocol.NonData) { switch (protocol) { - case Enums.AtaProtocol.PioIn: - case Enums.AtaProtocol.UDmaIn: + case AtaProtocol.PioIn: + case AtaProtocol.UDmaIn: cdb[2] = 0x08; break; default: @@ -251,29 +251,29 @@ namespace DiscImageChef.Devices.Linux return error; } - internal static int SendAtaCommand(int fd, Structs.AtaRegistersLBA48 registers, - out Structs.AtaErrorRegistersLBA48 errorRegisters, Enums.AtaProtocol protocol, - Enums.AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, + internal static int SendAtaCommand(int fd, AtaRegistersLBA48 registers, + out AtaErrorRegistersLBA48 errorRegisters, AtaProtocol protocol, + AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { duration = 0; sense = false; - errorRegisters = new Structs.AtaErrorRegistersLBA48(); + errorRegisters = new AtaErrorRegistersLBA48(); if (buffer == null) return -1; byte[] cdb = new byte[16]; - cdb[0] = (byte)Enums.ScsiCommands.AtaPassThrough16; + cdb[0] = (byte)ScsiCommands.AtaPassThrough16; cdb[1] |= 0x01; cdb[1] = (byte)(((byte)protocol << 1) & 0x1E); - if (transferRegister != Enums.AtaTransferRegister.NoTransfer && - protocol != Enums.AtaProtocol.NonData) + if (transferRegister != AtaTransferRegister.NoTransfer && + protocol != AtaProtocol.NonData) { switch (protocol) { - case Enums.AtaProtocol.PioIn: - case Enums.AtaProtocol.UDmaIn: + case AtaProtocol.PioIn: + case AtaProtocol.UDmaIn: cdb[2] = 0x08; break; default: diff --git a/DiscImageChef.Devices/Structs.cs b/DiscImageChef.Devices/Structs.cs index 5a3dcb6f..c78e0595 100644 --- a/DiscImageChef.Devices/Structs.cs +++ b/DiscImageChef.Devices/Structs.cs @@ -39,76 +39,73 @@ using System; namespace DiscImageChef.Devices { - public static class Structs + public struct AtaRegistersCHS { - public struct AtaRegistersCHS - { - public byte feature; - public byte sectorCount; - public byte sector; - public byte cylinderLow; - public byte cylinderHigh; - public byte deviceHead; - public byte command; - } + public byte feature; + public byte sectorCount; + public byte sector; + public byte cylinderLow; + public byte cylinderHigh; + public byte deviceHead; + public byte command; + } - public struct AtaRegistersLBA28 - { - public byte feature; - public byte sectorCount; - public byte lbaLow; - public byte lbaMid; - public byte lbaHigh; - public byte deviceHead; - public byte command; - } + public struct AtaRegistersLBA28 + { + public byte feature; + public byte sectorCount; + public byte lbaLow; + public byte lbaMid; + public byte lbaHigh; + public byte deviceHead; + public byte command; + } - public struct AtaRegistersLBA48 - { - public ushort feature; - public ushort sectorCount; - public ushort lbaLow; - public ushort lbaMid; - public ushort lbaHigh; - public byte deviceHead; - public byte command; - } + public struct AtaRegistersLBA48 + { + public ushort feature; + public ushort sectorCount; + public ushort lbaLow; + public ushort lbaMid; + public ushort lbaHigh; + public byte deviceHead; + public byte command; + } - public struct AtaErrorRegistersCHS - { - public byte status; - public byte error; - public byte sectorCount; - public byte sector; - public byte cylinderLow; - public byte cylinderHigh; - public byte deviceHead; - public byte command; - } + public struct AtaErrorRegistersCHS + { + public byte status; + public byte error; + public byte sectorCount; + public byte sector; + public byte cylinderLow; + public byte cylinderHigh; + public byte deviceHead; + public byte command; + } - public struct AtaErrorRegistersLBA28 - { - public byte status; - public byte error; - public byte sectorCount; - public byte lbaLow; - public byte lbaMid; - public byte lbaHigh; - public byte deviceHead; - public byte command; - } + public struct AtaErrorRegistersLBA28 + { + public byte status; + public byte error; + public byte sectorCount; + public byte lbaLow; + public byte lbaMid; + public byte lbaHigh; + public byte deviceHead; + public byte command; + } - public struct AtaErrorRegistersLBA48 - { - public byte status; - public byte error; - public ushort sectorCount; - public ushort lbaLow; - public ushort lbaMid; - public ushort lbaHigh; - public byte deviceHead; - public byte command; - } + public struct AtaErrorRegistersLBA48 + { + public byte status; + public byte error; + public ushort sectorCount; + public ushort lbaLow; + public ushort lbaMid; + public ushort lbaHigh; + public byte deviceHead; + public byte command; } } diff --git a/DiscImageChef/ChangeLog b/DiscImageChef/ChangeLog index 060754fb..c17bb92d 100644 --- a/DiscImageChef/ChangeLog +++ b/DiscImageChef/ChangeLog @@ -1,3 +1,8 @@ +2015-10-19 Natalia Portillo + + * Commands/DeviceInfo.cs: + Moved devices enums and structs out of classes. + 2015-10-19 Natalia Portillo * Commands/DeviceInfo.cs: diff --git a/DiscImageChef/Commands/DeviceInfo.cs b/DiscImageChef/Commands/DeviceInfo.cs index a410d45a..91c7b8a9 100644 --- a/DiscImageChef/Commands/DeviceInfo.cs +++ b/DiscImageChef/Commands/DeviceInfo.cs @@ -77,7 +77,7 @@ namespace DiscImageChef.Commands StringBuilder sb = null; - Structs.AtaErrorRegistersCHS errorRegisters; + AtaErrorRegistersCHS errorRegisters; byte[] ataBuf; bool sense = dev.AtaIdentify(out ataBuf, out errorRegisters);