diff --git a/DiscImageChef.Devices/ChangeLog b/DiscImageChef.Devices/ChangeLog index 942d03ba6..68add6c6c 100644 --- a/DiscImageChef.Devices/ChangeLog +++ b/DiscImageChef.Devices/ChangeLog @@ -1,3 +1,8 @@ +2015-10-06 Natalia Portillo + + * Enums.cs: + Added ATA/ATAPI commands. + 2015-10-06 Natalia Portillo * Enums.cs: diff --git a/DiscImageChef.Devices/Enums.cs b/DiscImageChef.Devices/Enums.cs index f505fe156..d85b1601d 100644 --- a/DiscImageChef.Devices/Enums.cs +++ b/DiscImageChef.Devices/Enums.cs @@ -4,6 +4,818 @@ namespace DiscImageChef.Devices { public static class Enums { + #region 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 + 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 + 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 + 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 + 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 + 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 + 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 + /// /// SASI commands /// Commands 0x00 to 0x1F are 6-byte