mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Code cleanup.
This commit is contained in:
@@ -44,7 +44,8 @@ namespace DiscImageChef.Decoders.MMC
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class ExtendedCSD
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] public byte[] Reserved0;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public byte[] Reserved0;
|
||||
public byte ExtendedSecurityCommandsError;
|
||||
public byte SupportedCommandSets;
|
||||
public byte HPIFeatures;
|
||||
@@ -62,144 +63,152 @@ namespace DiscImageChef.Decoders.MMC
|
||||
public byte OperationCodesTimeout;
|
||||
public uint FFUArgument;
|
||||
public byte BarrierSupport;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 177)] public byte[] Reserved1;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 177)]
|
||||
public byte[] Reserved1;
|
||||
public byte CMDQueuingSupport;
|
||||
public byte CMDQueuingDepth;
|
||||
public uint NumberofFWSectorsCorrectlyProgrammed;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] VendorHealthReport;
|
||||
public byte DeviceLifeEstimationTypeB;
|
||||
public byte DeviceLifeEstimationTypeA;
|
||||
public byte PreEOLInformation;
|
||||
public byte OptimalReadSize;
|
||||
public byte OptimalWriteSize;
|
||||
public byte OptimalTrimUnitSize;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public byte[] VendorHealthReport;
|
||||
public byte DeviceLifeEstimationTypeB;
|
||||
public byte DeviceLifeEstimationTypeA;
|
||||
public byte PreEOLInformation;
|
||||
public byte OptimalReadSize;
|
||||
public byte OptimalWriteSize;
|
||||
public byte OptimalTrimUnitSize;
|
||||
public ushort DeviceVersion;
|
||||
public ulong FirmwareVersion;
|
||||
public byte PowerClassDDR200;
|
||||
public uint CacheSize;
|
||||
public byte GenericCMD6Timeout;
|
||||
public byte PowerOffNotificationTimeout;
|
||||
public byte BackgroundOperationsStatus;
|
||||
public uint CorrectlyProgrammedSectors;
|
||||
public byte InitializationTimeAfterPartition;
|
||||
public byte CacheFlushingPolicy;
|
||||
public byte PowerClassDDR52;
|
||||
public byte PowerClassDDR52_195;
|
||||
public byte PowerClassDDR200_195;
|
||||
public byte PowerClassDDR200_130;
|
||||
public byte MinimumWritePerformanceDDR52;
|
||||
public byte MinimumReadPerformanceDDR52;
|
||||
public byte Reserved2;
|
||||
public byte TRIMMultiplier;
|
||||
public byte SecureFeatureSupport;
|
||||
public byte SecureEraseMultiplier;
|
||||
public byte SecureTRIMMultiplier;
|
||||
public byte BootInformation;
|
||||
public byte Reserved3;
|
||||
public byte BootPartitionSize;
|
||||
public byte AccessSize;
|
||||
public byte HighCapacityEraseUnitSize;
|
||||
public byte HighCapacityEraseTimeout;
|
||||
public byte ReliableWriteSectorCount;
|
||||
public byte HighCapacityWriteProtectGroupSize;
|
||||
public byte SleepCurrentVcc;
|
||||
public byte SleepCurrentVccq;
|
||||
public byte ProductionStateAwarenessTimeout;
|
||||
public byte SleepAwakeTimeout;
|
||||
public byte SleepNotificationTimeout;
|
||||
public uint SectorCount;
|
||||
public byte SecureWriteProtectInformation;
|
||||
public byte MinimumWritePerformance52;
|
||||
public byte MinimumReadPerformance52;
|
||||
public byte MinimumWritePerformance26;
|
||||
public byte MinimumReadPerformance26;
|
||||
public byte MinimumWritePerformance26_4;
|
||||
public byte MinimumReadPerformance26_4;
|
||||
public byte Reserved4;
|
||||
public byte PowerClass26;
|
||||
public byte PowerClass52;
|
||||
public byte PowerClass26_195;
|
||||
public byte PowerClass52_195;
|
||||
public byte PartitionSwitchingTime;
|
||||
public byte OutOfInterruptBusyTiming;
|
||||
public byte DriverStrength;
|
||||
public byte DeviceType;
|
||||
public byte Reserved5;
|
||||
public byte Structure;
|
||||
public byte Reserved6;
|
||||
public byte Revision;
|
||||
public byte CommandSet;
|
||||
public byte Reserved7;
|
||||
public byte CommandSetRevision;
|
||||
public byte Reserved8;
|
||||
public byte PowerClass;
|
||||
public byte Reserved9;
|
||||
public byte HighSpeedInterfaceTiming;
|
||||
public byte StrobeSupport;
|
||||
public byte BusWidth;
|
||||
public byte Reserved10;
|
||||
public byte ErasedMemoryContent;
|
||||
public byte Reserved11;
|
||||
public byte PartitionConfiguration;
|
||||
public byte BootConfigProtection;
|
||||
public byte BootBusConditions;
|
||||
public byte Reserved12;
|
||||
public byte HighDensityEraseGroupDefinition;
|
||||
public byte BootWriteProtectionStatus;
|
||||
public byte BootAreaWriteProtectionRegister;
|
||||
public byte Reserved13;
|
||||
public byte UserAreaWriteProtectionRegister;
|
||||
public byte Reserved14;
|
||||
public byte FirmwareConfiguration;
|
||||
public byte RPMBSize;
|
||||
public byte WriteReliabilitySettingRegister;
|
||||
public byte WriteReliabilityParameterRegister;
|
||||
public byte StartSanitizeOperation;
|
||||
public byte ManuallyStartBackgroundOperations;
|
||||
public byte EnableBackgroundOperationsHandshake;
|
||||
public byte HWResetFunction;
|
||||
public byte HPIManagement;
|
||||
public byte PartitioningSupport;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] MaxEnhancedAreaSize;
|
||||
public ulong FirmwareVersion;
|
||||
public byte PowerClassDDR200;
|
||||
public uint CacheSize;
|
||||
public byte GenericCMD6Timeout;
|
||||
public byte PowerOffNotificationTimeout;
|
||||
public byte BackgroundOperationsStatus;
|
||||
public uint CorrectlyProgrammedSectors;
|
||||
public byte InitializationTimeAfterPartition;
|
||||
public byte CacheFlushingPolicy;
|
||||
public byte PowerClassDDR52;
|
||||
public byte PowerClassDDR52_195;
|
||||
public byte PowerClassDDR200_195;
|
||||
public byte PowerClassDDR200_130;
|
||||
public byte MinimumWritePerformanceDDR52;
|
||||
public byte MinimumReadPerformanceDDR52;
|
||||
public byte Reserved2;
|
||||
public byte TRIMMultiplier;
|
||||
public byte SecureFeatureSupport;
|
||||
public byte SecureEraseMultiplier;
|
||||
public byte SecureTRIMMultiplier;
|
||||
public byte BootInformation;
|
||||
public byte Reserved3;
|
||||
public byte BootPartitionSize;
|
||||
public byte AccessSize;
|
||||
public byte HighCapacityEraseUnitSize;
|
||||
public byte HighCapacityEraseTimeout;
|
||||
public byte ReliableWriteSectorCount;
|
||||
public byte HighCapacityWriteProtectGroupSize;
|
||||
public byte SleepCurrentVcc;
|
||||
public byte SleepCurrentVccq;
|
||||
public byte ProductionStateAwarenessTimeout;
|
||||
public byte SleepAwakeTimeout;
|
||||
public byte SleepNotificationTimeout;
|
||||
public uint SectorCount;
|
||||
public byte SecureWriteProtectInformation;
|
||||
public byte MinimumWritePerformance52;
|
||||
public byte MinimumReadPerformance52;
|
||||
public byte MinimumWritePerformance26;
|
||||
public byte MinimumReadPerformance26;
|
||||
public byte MinimumWritePerformance26_4;
|
||||
public byte MinimumReadPerformance26_4;
|
||||
public byte Reserved4;
|
||||
public byte PowerClass26;
|
||||
public byte PowerClass52;
|
||||
public byte PowerClass26_195;
|
||||
public byte PowerClass52_195;
|
||||
public byte PartitionSwitchingTime;
|
||||
public byte OutOfInterruptBusyTiming;
|
||||
public byte DriverStrength;
|
||||
public byte DeviceType;
|
||||
public byte Reserved5;
|
||||
public byte Structure;
|
||||
public byte Reserved6;
|
||||
public byte Revision;
|
||||
public byte CommandSet;
|
||||
public byte Reserved7;
|
||||
public byte CommandSetRevision;
|
||||
public byte Reserved8;
|
||||
public byte PowerClass;
|
||||
public byte Reserved9;
|
||||
public byte HighSpeedInterfaceTiming;
|
||||
public byte StrobeSupport;
|
||||
public byte BusWidth;
|
||||
public byte Reserved10;
|
||||
public byte ErasedMemoryContent;
|
||||
public byte Reserved11;
|
||||
public byte PartitionConfiguration;
|
||||
public byte BootConfigProtection;
|
||||
public byte BootBusConditions;
|
||||
public byte Reserved12;
|
||||
public byte HighDensityEraseGroupDefinition;
|
||||
public byte BootWriteProtectionStatus;
|
||||
public byte BootAreaWriteProtectionRegister;
|
||||
public byte Reserved13;
|
||||
public byte UserAreaWriteProtectionRegister;
|
||||
public byte Reserved14;
|
||||
public byte FirmwareConfiguration;
|
||||
public byte RPMBSize;
|
||||
public byte WriteReliabilitySettingRegister;
|
||||
public byte WriteReliabilityParameterRegister;
|
||||
public byte StartSanitizeOperation;
|
||||
public byte ManuallyStartBackgroundOperations;
|
||||
public byte EnableBackgroundOperationsHandshake;
|
||||
public byte HWResetFunction;
|
||||
public byte HPIManagement;
|
||||
public byte PartitioningSupport;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public byte[] MaxEnhancedAreaSize;
|
||||
public byte PartitionsAttribute;
|
||||
public byte PartitioningSetting;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] public byte[] GeneralPurposePartitionSize;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] EnhancedUserDataAreaSize;
|
||||
public uint EnhancedUserDataStartAddress;
|
||||
public byte Reserved15;
|
||||
public byte BadBlockManagementMode;
|
||||
public byte ProductionStateAwareness;
|
||||
public byte PackageCaseTemperatureControl;
|
||||
public byte PeriodicWakeUp;
|
||||
public byte SupportsProgramCxDInDDR;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
|
||||
public byte[] GeneralPurposePartitionSize;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public byte[] EnhancedUserDataAreaSize;
|
||||
public uint EnhancedUserDataStartAddress;
|
||||
public byte Reserved15;
|
||||
public byte BadBlockManagementMode;
|
||||
public byte ProductionStateAwareness;
|
||||
public byte PackageCaseTemperatureControl;
|
||||
public byte PeriodicWakeUp;
|
||||
public byte SupportsProgramCxDInDDR;
|
||||
public ushort Reserved16;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public byte[] VendorSpecific;
|
||||
public byte NativeSectorSize;
|
||||
public byte SectorSizeEmulation;
|
||||
public byte SectorSize;
|
||||
public byte InitializationTimeout;
|
||||
public byte Class6CommandsControl;
|
||||
public byte AddressedGroupToBeReleased;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
|
||||
public byte[] VendorSpecific;
|
||||
public byte NativeSectorSize;
|
||||
public byte SectorSizeEmulation;
|
||||
public byte SectorSize;
|
||||
public byte InitializationTimeout;
|
||||
public byte Class6CommandsControl;
|
||||
public byte AddressedGroupToBeReleased;
|
||||
public ushort ExceptionEventsControl;
|
||||
public ushort ExceptionEventsStatus;
|
||||
public ushort ExtendedPartitionsAttribute;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] public byte[] ContextConfiguration;
|
||||
public byte PackedCommandStatus;
|
||||
public byte PackedCommandFailureIndex;
|
||||
public byte PowerOffNotification;
|
||||
public byte CacheControl;
|
||||
public byte CacheFlushing;
|
||||
public byte BarrierControl;
|
||||
public byte ModeConfig;
|
||||
public byte ModeOperationCodes;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
||||
public byte[] ContextConfiguration;
|
||||
public byte PackedCommandStatus;
|
||||
public byte PackedCommandFailureIndex;
|
||||
public byte PowerOffNotification;
|
||||
public byte CacheControl;
|
||||
public byte CacheFlushing;
|
||||
public byte BarrierControl;
|
||||
public byte ModeConfig;
|
||||
public byte ModeOperationCodes;
|
||||
public ushort Reserved17;
|
||||
public byte FFUStatus;
|
||||
public uint PreLoadingDataSize;
|
||||
public uint MaxPreLoadingDataSize;
|
||||
public byte ProductStateAwarenessEnablement;
|
||||
public byte SecureRemovalType;
|
||||
public byte CommandQueueModeEnable;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] public byte[] Reserved18;
|
||||
public byte FFUStatus;
|
||||
public uint PreLoadingDataSize;
|
||||
public uint MaxPreLoadingDataSize;
|
||||
public byte ProductStateAwarenessEnablement;
|
||||
public byte SecureRemovalType;
|
||||
public byte CommandQueueModeEnable;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
||||
public byte[] Reserved18;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
@@ -213,8 +222,8 @@ namespace DiscImageChef.Decoders.MMC
|
||||
|
||||
if(response.Length != 512) return null;
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(response, GCHandleType.Pinned);
|
||||
ExtendedCSD csd = (ExtendedCSD)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(ExtendedCSD));
|
||||
GCHandle handle = GCHandle.Alloc(response, GCHandleType.Pinned);
|
||||
ExtendedCSD csd = (ExtendedCSD)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(ExtendedCSD));
|
||||
handle.Free();
|
||||
|
||||
return csd;
|
||||
@@ -364,8 +373,8 @@ namespace DiscImageChef.Decoders.MMC
|
||||
|
||||
if(csd.PowerOffNotificationTimeout > 0)
|
||||
sb
|
||||
.AppendFormat("\tDevice takes a maximum of {0} by default to power off from a SWITCH command notification",
|
||||
csd.PowerOffNotificationTimeout * 10).AppendLine();
|
||||
.AppendFormat("\tDevice takes a maximum of {0} by default to power off from a SWITCH command notification",
|
||||
csd.PowerOffNotificationTimeout * 10).AppendLine();
|
||||
|
||||
switch(csd.BackgroundOperationsStatus & 0x03)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user