mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: All refactor in DiscImageChef.Decoders.
This commit is contained in:
@@ -681,13 +681,13 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
bool sense;
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
|
||||
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersCHS errorChs, false, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsRead =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorschs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -696,11 +696,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
|
||||
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -710,11 +710,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, TIMEOUT,
|
||||
out _);
|
||||
mediaTest.SupportsReadDma =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmachs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -723,11 +723,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadDmaRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmaretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -736,19 +736,19 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying SEEK in CHS mode...");
|
||||
sense = dev.Seek(out errorChs, 0, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsSeek =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
|
||||
errorChs.status, errorChs.error);
|
||||
errorChs.Status, errorChs.Error);
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLBA28 errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectors",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -757,11 +757,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -770,11 +770,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadDmaLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdma",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -783,11 +783,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadDmaRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmaretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -796,19 +796,19 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying SEEK in LBA mode...");
|
||||
sense = dev.Seek(out errorLba, 0, TIMEOUT, out _);
|
||||
mediaTest.SupportsSeekLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
|
||||
errorChs.status, errorChs.error);
|
||||
errorChs.Status, errorChs.Error);
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLBA48 errorLba48, 0, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLba48 =
|
||||
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
|
||||
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectors48",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -817,11 +817,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, TIMEOUT, out _);
|
||||
mediaTest.SupportsReadDmaLba48 =
|
||||
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 &&
|
||||
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
|
||||
readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdma48",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -831,11 +831,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLong =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongchs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -845,11 +845,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLongRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongretrychs",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -859,11 +859,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLongLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlong",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -873,11 +873,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
mediaTest.SupportsReadLongRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.status, errorChs.error, readBuf.Length);
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongretry",
|
||||
"_debug_" + mediaTest.MediumTypeName + ".bin", "read results",
|
||||
@@ -1048,12 +1048,12 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
bool sense;
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
|
||||
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersCHS errorChs, false, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsRead =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorschs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1061,10 +1061,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
|
||||
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1072,10 +1072,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadDma =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmachs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1083,10 +1083,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadDmaRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmaretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1094,17 +1094,17 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying SEEK in CHS mode...");
|
||||
sense = dev.Seek(out errorChs, 0, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsSeek =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0;
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
|
||||
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
|
||||
errorChs.status, errorChs.error);
|
||||
errorChs.Status, errorChs.Error);
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLBA28 errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectors", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1112,10 +1112,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
|
||||
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectorsretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1123,10 +1123,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadDmaLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdma", "_debug_" + report.ATA.Model + ".bin", "read results",
|
||||
readBuf);
|
||||
@@ -1134,10 +1134,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadDmaRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdmaretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1145,17 +1145,17 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying SEEK in LBA mode...");
|
||||
sense = dev.Seek(out errorLba, 0, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsSeekLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0;
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
|
||||
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense,
|
||||
errorLba.status, errorLba.error);
|
||||
errorLba.Status, errorLba.Error);
|
||||
|
||||
DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLBA48 errorLba48, 0, 1, TIMEOUT, out _);
|
||||
sense = dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLba48 =
|
||||
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba48.status, errorLba48.error, readBuf.Length);
|
||||
errorLba48.Status, errorLba48.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readsectors48", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1163,10 +1163,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
|
||||
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadDmaLba48 =
|
||||
!sense && (errorLba48.status & 0x01) != 0x01 && errorLba48.error == 0 && readBuf.Length > 0;
|
||||
!sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && readBuf.Length > 0;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba48.status, errorLba48.error, readBuf.Length);
|
||||
errorLba48.Status, errorLba48.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readdma48", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1175,11 +1175,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1,
|
||||
report.ATA.ReadCapabilities.LongBlockSize, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLong =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongchs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1188,11 +1188,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1,
|
||||
report.ATA.ReadCapabilities.LongBlockSize, TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLongRetry =
|
||||
!sense && (errorChs.status & 0x01) != 0x01 && errorChs.error == 0 && readBuf.Length > 0 &&
|
||||
!sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorChs.status, errorChs.error, readBuf.Length);
|
||||
errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongretrychs", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1201,11 +1201,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, report.ATA.ReadCapabilities.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLongLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlong", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
@@ -1214,11 +1214,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, report.ATA.ReadCapabilities.LongBlockSize,
|
||||
TIMEOUT, out _);
|
||||
report.ATA.ReadCapabilities.SupportsReadLongRetryLba =
|
||||
!sense && (errorLba.status & 0x01) != 0x01 && errorLba.error == 0 && readBuf.Length > 0 &&
|
||||
!sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
DicConsole.DebugWriteLine("ATA Report",
|
||||
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense,
|
||||
errorLba.status, errorLba.error, readBuf.Length);
|
||||
errorLba.Status, errorLba.Error, readBuf.Length);
|
||||
if(debug)
|
||||
DataFile.WriteTo("ATA Report", "readlongretry", "_debug_" + report.ATA.Model + ".bin",
|
||||
"read results", readBuf);
|
||||
|
||||
Reference in New Issue
Block a user