mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Final cleanup of DiscImageChef.Server.
This commit is contained in:
@@ -40,7 +40,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class Ata
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to be
|
||||
/// sequenced by ASP.NET in the rendering
|
||||
/// </summary>
|
||||
/// <param name="ataReport">ATA part of a device report</param>
|
||||
/// <param name="cfa"><c>true</c> if compact flash device</param>
|
||||
@@ -435,7 +436,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataOneValue.Add("ATAPI Unknown or no device type");
|
||||
break;
|
||||
default:
|
||||
ataOneValue.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
|
||||
ataOneValue
|
||||
.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -452,7 +454,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataOneValue.Add("Device shall set DRQ within 50 µs of receiving PACKET");
|
||||
break;
|
||||
default:
|
||||
ataOneValue.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
|
||||
ataOneValue
|
||||
.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -466,7 +469,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataOneValue.Add("ATAPI device uses 16 byte command packet");
|
||||
break;
|
||||
default:
|
||||
ataOneValue.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
|
||||
ataOneValue
|
||||
.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -535,7 +539,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
|
||||
break;
|
||||
default:
|
||||
ataOneValue.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
|
||||
ataOneValue
|
||||
.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -545,16 +550,20 @@ namespace DiscImageChef.Server.App_Start
|
||||
switch(ataReport.BufferType)
|
||||
{
|
||||
case 1:
|
||||
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
|
||||
break;
|
||||
case 2:
|
||||
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
|
||||
break;
|
||||
case 3:
|
||||
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
|
||||
break;
|
||||
default:
|
||||
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -805,7 +814,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
if(ataReport.PacketBusRelease != 0)
|
||||
ataOneValue.Add($"{ataReport.PacketBusRelease} ns. typical to release bus from receipt of PACKET");
|
||||
if(ataReport.ServiceBusyClear != 0)
|
||||
ataOneValue.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
|
||||
}
|
||||
|
||||
if(ataReport.TransportMajorVersionSpecified && ((ataReport.TransportMajorVersion & 0xF000) >> 12 == 0x1 ||
|
||||
@@ -813,25 +823,28 @@ namespace DiscImageChef.Server.App_Start
|
||||
{
|
||||
if(!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear))
|
||||
{
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) ataOneValue.Add("SATA 1.5Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) ataOneValue.Add("SATA 3.0Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) ataOneValue.Add("SATA 6.0Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed))
|
||||
ataOneValue.Add("SATA 1.5Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed))
|
||||
ataOneValue.Add("SATA 3.0Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed))
|
||||
ataOneValue.Add("SATA 6.0Gb/s is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt))
|
||||
ataOneValue
|
||||
.Add("Receipt of host initiated power management requests is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) ataOneValue.Add("PHY Event counters are supported");
|
||||
ataOneValue.Add("Receipt of host initiated power management requests is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter))
|
||||
ataOneValue.Add("PHY Event counters are supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans))
|
||||
ataOneValue
|
||||
.Add("Supports host automatic partial to slumber transitions is supported");
|
||||
ataOneValue.Add("Supports host automatic partial to slumber transitions is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans))
|
||||
ataOneValue
|
||||
.Add("Supports device automatic partial to slumber transitions is supported");
|
||||
ataOneValue.Add("Supports device automatic partial to slumber transitions is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
|
||||
{
|
||||
ataOneValue.Add("NCQ is supported");
|
||||
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) ataOneValue.Add("NCQ priority is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) ataOneValue.Add("Unload is supported with outstanding NCQ commands");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority))
|
||||
ataOneValue.Add("NCQ priority is supported");
|
||||
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ))
|
||||
ataOneValue.Add("Unload is supported with outstanding NCQ commands");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -842,16 +855,18 @@ namespace DiscImageChef.Server.App_Start
|
||||
!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) &&
|
||||
ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
|
||||
{
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) ataOneValue.Add("NCQ queue management is supported");
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) ataOneValue.Add("NCQ streaming is supported");
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt))
|
||||
ataOneValue.Add("NCQ queue management is supported");
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream))
|
||||
ataOneValue.Add("NCQ streaming is supported");
|
||||
}
|
||||
|
||||
if(ataReport.SATACapabilities2Specified && atapi)
|
||||
{
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) ataOneValue.Add("ATAPI device supports host environment detection");
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect))
|
||||
ataOneValue.Add("ATAPI device supports host environment detection");
|
||||
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline))
|
||||
ataOneValue
|
||||
.Add("ATAPI device supports attention on slimline connected devices");
|
||||
ataOneValue.Add("ATAPI device supports attention on slimline connected devices");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -999,7 +1014,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataReport.EnabledCommandSet2Specified)
|
||||
ataOneValue.Add("Address Offset Reserved Area Boot is supported and enabled");
|
||||
else ataOneValue.Add("Address Offset Reserved Area Boot is supported");
|
||||
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired)) ataOneValue.Add("SET FEATURES is required before spin-up");
|
||||
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired))
|
||||
ataOneValue.Add("SET FEATURES is required before spin-up");
|
||||
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby))
|
||||
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby) &&
|
||||
ataReport.EnabledCommandSet2Specified)
|
||||
@@ -1059,8 +1075,10 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataReport.EnabledCommandSet3Specified)
|
||||
ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported and enabled");
|
||||
else ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WriteURG)) ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.ReadURG)) ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WriteURG))
|
||||
ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.ReadURG))
|
||||
ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WWN)) ataOneValue.Add("Device has a World Wide Name");
|
||||
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.FUAWriteQ))
|
||||
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWriteQ) &&
|
||||
@@ -1161,24 +1179,35 @@ namespace DiscImageChef.Server.App_Start
|
||||
|
||||
if(ataReport.CommandSet5Specified)
|
||||
{
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA)) ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA)) ataOneValue.Add("READ BUFFER DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA)) ataOneValue.Add("WRITE BUFFER DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA)) ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA)) ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Ata28)) ataOneValue.Add("Not all 28-bit commands are supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA))
|
||||
ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA))
|
||||
ataOneValue.Add("READ BUFFER DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA))
|
||||
ataOneValue.Add("WRITE BUFFER DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA))
|
||||
ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA))
|
||||
ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Ata28))
|
||||
ataOneValue.Add("Not all 28-bit commands are supported");
|
||||
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.CFast)) ataOneValue.Add("Device follows CFast specification");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.CFast))
|
||||
ataOneValue.Add("Device follows CFast specification");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.IEEE1667)) ataOneValue.Add("Device follows IEEE-1667");
|
||||
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeterministicTrim))
|
||||
{
|
||||
ataOneValue.Add("Read after TRIM is deterministic");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim)) ataOneValue.Add("Read after TRIM returns empty data");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim))
|
||||
ataOneValue.Add("Read after TRIM returns empty data");
|
||||
}
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError)) ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Encrypted)) ataOneValue.Add("Device encrypts all user data");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV)) ataOneValue.Add("Device's write cache is non-volatile");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError))
|
||||
ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Encrypted))
|
||||
ataOneValue.Add("Device encrypts all user data");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV))
|
||||
ataOneValue.Add("Device's write cache is non-volatile");
|
||||
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ZonedBit0) ||
|
||||
ataReport.CommandSet5.HasFlag(CommandSetBit5.ZonedBit1)) ataOneValue.Add("Device is zoned");
|
||||
}
|
||||
@@ -1255,13 +1284,17 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataReport.EnabledSATAFeaturesSpecified)
|
||||
ataOneValue.Add("Software Settings Preservation is supported");
|
||||
else ataOneValue.Add("Software Settings Preservation is supported");
|
||||
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense)) ataOneValue.Add("NCQ Autosense is supported");
|
||||
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber)) ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
|
||||
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense))
|
||||
ataOneValue.Add("NCQ Autosense is supported");
|
||||
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber))
|
||||
ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
|
||||
}
|
||||
}
|
||||
if((ataReport.RemovableStatusSet & 0x03) > 0) ataOneValue.Add("Removable Media Status Notification feature set is supported");
|
||||
if((ataReport.RemovableStatusSet & 0x03) > 0)
|
||||
ataOneValue.Add("Removable Media Status Notification feature set is supported");
|
||||
|
||||
if(ataReport.FreeFallSensitivity != 0x00 && ataReport.FreeFallSensitivity != 0xFF) ataOneValue.Add($"Free-fall sensitivity set to {ataReport.FreeFallSensitivity}");
|
||||
if(ataReport.FreeFallSensitivity != 0x00 && ataReport.FreeFallSensitivity != 0xFF)
|
||||
ataOneValue.Add($"Free-fall sensitivity set to {ataReport.FreeFallSensitivity}");
|
||||
|
||||
if(ataReport.DataSetMgmtSpecified && ataReport.DataSetMgmt.HasFlag(DataSetMgmtBit.Trim))
|
||||
ataOneValue.Add("TRIM is supported");
|
||||
@@ -1297,7 +1330,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
|
||||
ataOneValue.Add($"{ataReport.SecurityEraseTime * 2} minutes to complete secure erase");
|
||||
if(ataReport.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced))
|
||||
ataOneValue.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
|
||||
ataOneValue
|
||||
.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
|
||||
|
||||
ataOneValue.Add($"Master password revision code: {ataReport.MasterPasswordRevisionCode}");
|
||||
}
|
||||
@@ -1365,7 +1399,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
logicalsectorsize = ataReport.ReadCapabilities.BlockSize;
|
||||
}
|
||||
if(ataReport.ReadCapabilities.PhysicalBlockSizeSpecified)
|
||||
ataTwoValue.Add("Physical sector size", $"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
|
||||
ataTwoValue.Add("Physical sector size",
|
||||
$"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
|
||||
if(ataReport.ReadCapabilities.LongBlockSizeSpecified)
|
||||
ataTwoValue.Add("READ LONG sector size", $"{ataReport.ReadCapabilities.LongBlockSize} bytes");
|
||||
|
||||
@@ -1374,7 +1409,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
ataReport.ReadCapabilities.BlockSize != ataReport.ReadCapabilities.PhysicalBlockSize &&
|
||||
(ataReport.ReadCapabilities.LogicalAlignment & 0x8000) == 0x0000 &&
|
||||
(ataReport.ReadCapabilities.LogicalAlignment & 0x4000) == 0x4000)
|
||||
ataOneValue.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
|
||||
ataOneValue
|
||||
.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
|
||||
|
||||
if(ataReport.ReadCapabilities.CHS != null && ataReport.ReadCapabilities.CurrentCHS != null)
|
||||
{
|
||||
@@ -1413,8 +1449,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000000)
|
||||
ataTwoValue.Add("Device size in 28-bit LBA mode",
|
||||
$"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
else if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 >
|
||||
1000)
|
||||
else if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000)
|
||||
ataTwoValue.Add("Device size in 28-bit LBA mode",
|
||||
$"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000} Gb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
else
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class ScsiEvpd
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the SCSI EVPD part of a device report and prints it as a list key=value pairs to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the SCSI EVPD part of a device report and prints it as a list key=value pairs to be sequenced by ASP.NET in
|
||||
/// the rendering
|
||||
/// </summary>
|
||||
/// <param name="pages">EVPD pages</param>
|
||||
/// <param name="vendor">SCSI vendor string</param>
|
||||
@@ -65,16 +66,13 @@ namespace DiscImageChef.Server.App_Start
|
||||
decoded = EVPD.PrettifyPage_C0_Quantum(evpd.value);
|
||||
else if(evpd.page == 0xC0 && vendor.Trim() == "seagate")
|
||||
decoded = EVPD.PrettifyPage_C0_Seagate(evpd.value);
|
||||
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm")
|
||||
decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
|
||||
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm")
|
||||
decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
|
||||
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
|
||||
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
|
||||
else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance")
|
||||
decoded = EVPD.PrettifyPage_C0_C1_Certance(evpd.value);
|
||||
else if((evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5 ||
|
||||
evpd.page == 0xC6) &&
|
||||
vendor.Trim() == "certance")
|
||||
decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value);
|
||||
vendor.Trim() == "certance") decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value);
|
||||
else if((evpd.page == 0xC0 || evpd.page == 0xC1 || evpd.page == 0xC2 || evpd.page == 0xC3 ||
|
||||
evpd.page == 0xC4 || evpd.page == 0xC5) &&
|
||||
vendor.Trim() == "hp") decoded = EVPD.PrettifyPage_C0_to_C5_HP(evpd.value);
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
static class ScsiInquiry
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the SCSI INQUIRY part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the SCSI INQUIRY part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
|
||||
/// rendering
|
||||
/// </summary>
|
||||
/// <param name="inquiry">INQUIRY part of the report</param>
|
||||
/// <returns>List of values</returns>
|
||||
@@ -1026,8 +1027,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
scsiOneValue.Add("Device complies with SPI ANSI INCITS 253-1995");
|
||||
break;
|
||||
case 0x0ABB:
|
||||
scsiOneValue
|
||||
.Add("Device complies with SPI T10/0855-D revision 15a with SPI Amnd revision 3a");
|
||||
scsiOneValue.Add("Device complies with SPI T10/0855-D revision 15a with SPI Amnd revision 3a");
|
||||
break;
|
||||
case 0x0ABC:
|
||||
scsiOneValue
|
||||
@@ -1216,8 +1216,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
scsiOneValue.Add("Device complies with FC-AL-2 T11/1133-D revision 7.0");
|
||||
break;
|
||||
case 0x0D63:
|
||||
scsiOneValue
|
||||
.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006");
|
||||
scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006");
|
||||
break;
|
||||
case 0x0D64:
|
||||
scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with Amnd 2 AM2-2006");
|
||||
@@ -1620,8 +1619,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011");
|
||||
break;
|
||||
case 0x20A8:
|
||||
scsiOneValue
|
||||
.Add("Device complies with SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012");
|
||||
scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012");
|
||||
break;
|
||||
case 0x20AA:
|
||||
scsiOneValue.Add("Device complies with SPL ISO/IEC 14776-261:2012");
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class ScsiMmcFeatures
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the MMC FEATURES part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the MMC FEATURES part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
|
||||
/// rendering
|
||||
/// </summary>
|
||||
/// <param name="ftr">FEATURES part of the report</param>
|
||||
/// <param name="mmcOneValue">List to put the values on</param>
|
||||
@@ -125,8 +126,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
if(ftr.CanUpgradeFirmware) mmcOneValue.Add("Drive supports Microcode Upgrade");
|
||||
if(ftr.ErrorRecoveryPage) mmcOneValue.Add("Drive shall report Read/Write Error Recovery mode page");
|
||||
if(ftr.Locked) mmcOneValue.Add("Drive can lock media");
|
||||
if(ftr.LogicalBlockSize > 0)
|
||||
mmcOneValue.Add($"{ftr.LogicalBlockSize} bytes per logical block");
|
||||
if(ftr.LogicalBlockSize > 0) mmcOneValue.Add($"{ftr.LogicalBlockSize} bytes per logical block");
|
||||
if(ftr.MultiRead)
|
||||
mmcOneValue.Add("Drive claims capability to read all CD formats according to OSTA Multi-Read Specification");
|
||||
|
||||
@@ -233,8 +233,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
else if(ftr.SupportsCPRM) mmcOneValue.Add("Drive supports DVD CPRM");
|
||||
if(ftr.DBML) mmcOneValue.Add("Drive reports Device Busy Class events during medium loading/unloading");
|
||||
if(ftr.DVDMultiRead) mmcOneValue.Add("Drive conforms to DVD Multi Drive Read-only Specifications");
|
||||
if(ftr.FirmwareDateSpecified)
|
||||
mmcOneValue.Add($"Drive firmware is dated {ftr.FirmwareDate}");
|
||||
if(ftr.FirmwareDateSpecified) mmcOneValue.Add($"Drive firmware is dated {ftr.FirmwareDate}");
|
||||
if(ftr.SupportsC2) mmcOneValue.Add("Drive supports C2 Error Pointers");
|
||||
if(ftr.SupportsDAP) mmcOneValue.Add("Drive supports the DAP bit in the READ CD and READ CD MSF commands");
|
||||
if(ftr.SupportsDeviceBusyEvent) mmcOneValue.Add("Drive supports Device Busy events");
|
||||
@@ -271,8 +270,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
if(ftr.SupportsSecurDisc) mmcOneValue.Add("Drive supports SecurDisc");
|
||||
if(ftr.SupportsSeparateVolume) mmcOneValue.Add("Drive supports separate volume per channel");
|
||||
if(ftr.SupportsVCPS) mmcOneValue.Add("Drive supports VCPS");
|
||||
if(ftr.VolumeLevelsSpecified)
|
||||
mmcOneValue.Add($"Drive has {ftr.VolumeLevels + 1} volume levels");
|
||||
if(ftr.VolumeLevelsSpecified) mmcOneValue.Add($"Drive has {ftr.VolumeLevels + 1} volume levels");
|
||||
if(ftr.SupportsWriteProtectPAC)
|
||||
mmcOneValue.Add("Drive supports reading/writing the Disc Write Protect PAC on BD-R/-RE media");
|
||||
if(ftr.SupportsWriteInhibitDCB)
|
||||
|
||||
@@ -40,7 +40,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class ScsiMmcMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the MODE PAGE 2Ah part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the MODE PAGE 2Ah part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
|
||||
/// rendering
|
||||
/// </summary>
|
||||
/// <param name="mode">MODE PAGE 2Ah part of the report</param>
|
||||
/// <param name="mmcOneValue">List to put the values on</param>
|
||||
@@ -91,11 +92,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
: "Drive is not locked, media can be ejected and inserted");
|
||||
}
|
||||
else
|
||||
{
|
||||
mmcOneValue.Add(mode.LockStatus
|
||||
? "Drive is locked, media cannot be ejected, but if empty, can be inserted"
|
||||
: "Drive is not locked, media can be ejected and inserted");
|
||||
}
|
||||
if(mode.CanEject) mmcOneValue.Add("Drive can eject media");
|
||||
|
||||
if(mode.SeparateChannelMute) mmcOneValue.Add("Each channel can be muted independently");
|
||||
@@ -134,9 +133,11 @@ namespace DiscImageChef.Server.App_Start
|
||||
if(mode.CurrentWriteSpeedSelected > 0)
|
||||
{
|
||||
if(mode.RotationControlSelected == 0)
|
||||
mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
|
||||
mmcOneValue
|
||||
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
|
||||
else if(mode.RotationControlSelected == 1)
|
||||
mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
|
||||
mmcOneValue
|
||||
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -147,7 +148,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
}
|
||||
|
||||
if(mode.WriteSpeedPerformanceDescriptors != null)
|
||||
foreach(Modes.ModePage_2A_WriteDescriptor descriptor in mode.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0)) if(descriptor.RotationControl == 0)
|
||||
foreach(Modes.ModePage_2A_WriteDescriptor descriptor in
|
||||
mode.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0))
|
||||
if(descriptor.RotationControl == 0)
|
||||
mmcOneValue.Add($"Drive supports writing at {descriptor.WriteSpeed} Kbyte/sec. in CLV mode");
|
||||
else if(descriptor.RotationControl == 1)
|
||||
mmcOneValue
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class ScsiModeSense
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the MODE PAGEs part of a device report and prints it as a list of values and another list of key=value pairs to be sequenced by ASP.NET in the rendering
|
||||
/// Takes the MODE PAGEs part of a device report and prints it as a list of values and another list of key=value pairs
|
||||
/// to be sequenced by ASP.NET in the rendering
|
||||
/// </summary>
|
||||
/// <param name="modeSense">MODE PAGEs part of a device report</param>
|
||||
/// <param name="vendor">SCSI vendor string</param>
|
||||
@@ -49,13 +50,13 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static void Report(modeType modeSense, string vendor, PeripheralDeviceTypes deviceType,
|
||||
ref List<string> scsiOneValue, ref Dictionary<string, string> modePages)
|
||||
{
|
||||
if(modeSense.MediumTypeSpecified)
|
||||
scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h");
|
||||
if(modeSense.MediumTypeSpecified) scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h");
|
||||
if(modeSense.WriteProtected) scsiOneValue.Add("Device is write protected.");
|
||||
if(modeSense.BlockDescriptors != null)
|
||||
foreach(blockDescriptorType descriptor in modeSense.BlockDescriptors)
|
||||
if(descriptor.BlocksSpecified && descriptor.BlockLengthSpecified)
|
||||
scsiOneValue.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
|
||||
scsiOneValue
|
||||
.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
|
||||
else scsiOneValue.Add($"Density code {descriptor.Density:X2}h");
|
||||
|
||||
if(modeSense.DPOandFUA) scsiOneValue.Add("Drive supports DPO and FUA bits");
|
||||
@@ -85,14 +86,11 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x00:
|
||||
{
|
||||
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice && page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_00_SFF(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_00_SFF(page.value));
|
||||
else
|
||||
{
|
||||
modePages
|
||||
.Add(page.subpage != 0 ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" : $"MODE page {page.page:X2}h",
|
||||
"Unknown vendor mode page");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x01:
|
||||
@@ -109,8 +107,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x02:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_02(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_02(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -118,8 +115,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x03:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_03(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_03(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -127,8 +123,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x04:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_04(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_04(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -136,8 +131,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x05:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_05(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_05(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -145,8 +139,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x06:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_06(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_06(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -165,8 +158,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x08:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_08(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_08(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -174,11 +166,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x0A:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0A(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0A(page.value));
|
||||
else if(page.subpage == 1)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0A_S01(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0A_S01(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -186,8 +176,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x0B:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0B(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0B(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -195,8 +184,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x0D:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0D(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0D(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -204,8 +192,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x0E:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0E(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0E(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -213,8 +200,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x0F:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_0F(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0F(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -233,8 +219,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x11:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_11(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_11(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -244,8 +229,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x14:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_12_13_14(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_12_13_14(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -253,11 +237,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x1A:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_1A(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1A(page.value));
|
||||
else if(page.subpage == 1)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_1A_S01(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1A_S01(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -265,8 +247,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x1B:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_1B(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1B(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -279,8 +260,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
? Modes.PrettifyModePage_1C_SFF(page.value)
|
||||
: Modes.PrettifyModePage_1C(page.value));
|
||||
else if(page.subpage == 1)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_1C_S01(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1C_S01(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -288,8 +268,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x1D:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_1D(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1D(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -297,8 +276,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x21:
|
||||
{
|
||||
if(vendor == "CERTANCE")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyCertanceModePage_21(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_21(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -306,8 +284,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x22:
|
||||
{
|
||||
if(vendor == "CERTANCE")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyCertanceModePage_22(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_22(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -315,8 +292,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x24:
|
||||
{
|
||||
if(vendor == "IBM")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyIBMModePage_24(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_24(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -324,8 +300,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x2A:
|
||||
{
|
||||
if(page.subpage == 0)
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyModePage_2A(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_2A(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -333,8 +308,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x2F:
|
||||
{
|
||||
if(vendor == "IBM")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyIBMModePage_2F(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_2F(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -350,8 +324,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x3B:
|
||||
{
|
||||
if(vendor == "HP")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyHPModePage_3B(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3B(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -359,8 +332,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x3C:
|
||||
{
|
||||
if(vendor == "HP")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyHPModePage_3C(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3C(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -368,11 +340,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x3D:
|
||||
{
|
||||
if(vendor == "IBM")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyIBMModePage_3D(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_3D(page.value));
|
||||
else if(vendor == "HP")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyHPModePage_3D(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3D(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -380,11 +350,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
case 0x3E:
|
||||
{
|
||||
if(vendor == "FUJITSU")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyFujitsuModePage_3E(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyFujitsuModePage_3E(page.value));
|
||||
else if(vendor == "HP")
|
||||
modePages.Add($"MODE page {page.page:X2}h",
|
||||
Modes.PrettifyHPModePage_3E(page.value));
|
||||
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3E(page.value));
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class SscTestedMedia
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the tested media from SCSI Streaming devices of a device report and prints it as a list of values
|
||||
/// Takes the tested media from SCSI Streaming devices of a device report and prints it as a list of values
|
||||
/// </summary>
|
||||
/// <param name="mediaOneValue">List to put values on</param>
|
||||
/// <param name="testedMedia">List of tested media</param>
|
||||
@@ -49,8 +49,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
if(!string.IsNullOrWhiteSpace(media.MediumTypeName))
|
||||
{
|
||||
mediaOneValue.Add($"<i>Information for medium named \"{media.MediumTypeName}\"</i>");
|
||||
if(media.MediumTypeSpecified)
|
||||
mediaOneValue.Add($"Medium type code: {media.MediumType:X2}h");
|
||||
if(media.MediumTypeSpecified) mediaOneValue.Add($"Medium type code: {media.MediumType:X2}h");
|
||||
}
|
||||
else if(media.MediumTypeSpecified)
|
||||
mediaOneValue.Add($"<i>Information for medium type {media.MediumType:X2}h</i>");
|
||||
@@ -58,11 +57,9 @@ namespace DiscImageChef.Server.App_Start
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(media.Manufacturer))
|
||||
mediaOneValue.Add($"Medium manufactured by: {media.Manufacturer}");
|
||||
if(!string.IsNullOrWhiteSpace(media.Model))
|
||||
mediaOneValue.Add($"Medium model: {media.Model}");
|
||||
if(!string.IsNullOrWhiteSpace(media.Model)) mediaOneValue.Add($"Medium model: {media.Model}");
|
||||
|
||||
if(media.DensitySpecified)
|
||||
mediaOneValue.Add($"Medium has density code {media.Density:X2}h");
|
||||
if(media.DensitySpecified) mediaOneValue.Add($"Medium has density code {media.Density:X2}h");
|
||||
if(media.CanReadMediaSerial) mediaOneValue.Add("Drive can read medium serial number.");
|
||||
if(media.MediaIsRecognized) mediaOneValue.Add("DiscImageChef recognizes this medium.");
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
public static class TestedMedia
|
||||
{
|
||||
/// <summary>
|
||||
/// Takes the tested media from a device report and prints it as a list of values
|
||||
/// Takes the tested media from a device report and prints it as a list of values
|
||||
/// </summary>
|
||||
/// <param name="ata"><c>true</c> if device report is from an ATA device</param>
|
||||
/// <param name="mediaOneValue">List to put values on</param>
|
||||
@@ -65,8 +65,7 @@ namespace DiscImageChef.Server.App_Start
|
||||
mediaOneValue.Add($"Medium manufactured by: {testedMedia.Manufacturer}");
|
||||
if(!string.IsNullOrWhiteSpace(testedMedia.Model))
|
||||
mediaOneValue.Add($"Medium model: {testedMedia.Model}");
|
||||
if(testedMedia.DensitySpecified)
|
||||
mediaOneValue.Add($"Density code: {testedMedia.Density:X2}h");
|
||||
if(testedMedia.DensitySpecified) mediaOneValue.Add($"Density code: {testedMedia.Density:X2}h");
|
||||
|
||||
if(testedMedia.BlockSizeSpecified)
|
||||
mediaOneValue.Add($"Logical sector size: {testedMedia.BlockSize} bytes");
|
||||
@@ -80,22 +79,29 @@ namespace DiscImageChef.Server.App_Start
|
||||
mediaOneValue.Add($"Medium has {testedMedia.Blocks} blocks of {testedMedia.BlockSize} bytes each");
|
||||
|
||||
if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000000)
|
||||
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
else if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000)
|
||||
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
else
|
||||
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
}
|
||||
|
||||
if(testedMedia.CHS != null && testedMedia.CurrentCHS != null)
|
||||
{
|
||||
int currentSectors = testedMedia.CurrentCHS.Cylinders * testedMedia.CurrentCHS.Heads *
|
||||
testedMedia.CurrentCHS.Sectors;
|
||||
mediaOneValue.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
|
||||
mediaOneValue
|
||||
.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
|
||||
mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads} max., {testedMedia.CurrentCHS.Heads} current");
|
||||
mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
|
||||
mediaOneValue.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
|
||||
mediaOneValue.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
mediaOneValue
|
||||
.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
|
||||
mediaOneValue
|
||||
.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
}
|
||||
else if(testedMedia.CHS != null)
|
||||
{
|
||||
@@ -104,7 +110,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads}");
|
||||
mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors}");
|
||||
mediaOneValue.Add($"Sectors addressable in CHS mode: {currentSectors}");
|
||||
mediaOneValue.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
}
|
||||
|
||||
if(testedMedia.LBASectorsSpecified)
|
||||
@@ -112,11 +119,14 @@ namespace DiscImageChef.Server.App_Start
|
||||
mediaOneValue.Add($"Sectors addressable in sectors in 28-bit LBA mode: {testedMedia.LBASectors}");
|
||||
|
||||
if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
|
||||
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
else if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
|
||||
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
else
|
||||
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
}
|
||||
|
||||
if(testedMedia.LBA48SectorsSpecified)
|
||||
@@ -124,11 +134,14 @@ namespace DiscImageChef.Server.App_Start
|
||||
mediaOneValue.Add($"Sectors addressable in sectors in 48-bit LBA mode: {testedMedia.LBA48Sectors}");
|
||||
|
||||
if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
|
||||
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
|
||||
else if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
|
||||
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
|
||||
else
|
||||
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
mediaOneValue
|
||||
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
|
||||
}
|
||||
|
||||
if(testedMedia.NominalRotationRateSpecified && testedMedia.NominalRotationRate != 0x0000 &&
|
||||
@@ -141,7 +154,8 @@ namespace DiscImageChef.Server.App_Start
|
||||
testedMedia.BlockSize != testedMedia.PhysicalBlockSize &&
|
||||
(testedMedia.LogicalAlignment & 0x8000) == 0x0000 &&
|
||||
(testedMedia.LogicalAlignment & 0x4000) == 0x4000)
|
||||
mediaOneValue.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
|
||||
mediaOneValue
|
||||
.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
|
||||
|
||||
if(testedMedia.SupportsRead && ata)
|
||||
mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium");
|
||||
|
||||
Reference in New Issue
Block a user