Save data on device report when not in debug mode.

This commit is contained in:
2019-12-27 17:48:23 +00:00
parent 8862d8b9b4
commit 482c646f71
11 changed files with 511 additions and 522 deletions

View File

@@ -3,8 +3,10 @@
<component name="ContentModelStore"> <component name="ContentModelStore">
<e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" /> <e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" />
<e p="$APPLICATION_PLUGINS_DIR$/puppet/lib/stubs" t="IncludeRecursive" /> <e p="$APPLICATION_PLUGINS_DIR$/puppet/lib/stubs" t="IncludeRecursive" />
<e p="$APPLICATION_CONFIG_DIR$/scratches" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/extResources" t="IncludeRecursive" /> <e p="$USER_HOME$/.Rider2019.3/system/extResources" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/resharper-host/local/Transient/ReSharperHost/v193/SolutionCaches/_DiscImageChef.-1491758497.00" t="ExcludeRecursive" /> <e p="$USER_HOME$/.Rider2019.3/system/resharper-host/local/Transient/ReSharperHost/v193/SolutionCaches/_DiscImageChef.-1491758497.00" t="ExcludeRecursive" />
<e p="$USER_HOME$/.config/git/ignore" t="IncludeRecursive" />
<e p="$USER_HOME$/.nuget/packages/sqlitepclraw.lib.e_sqlite3.linux/1.1.12/runtimes/linux-x64/native/libe_sqlite3.so" t="Include" /> <e p="$USER_HOME$/.nuget/packages/sqlitepclraw.lib.e_sqlite3.linux/1.1.12/runtimes/linux-x64/native/libe_sqlite3.so" t="Include" />
<e p="$PROJECT_DIR$" t="IncludeFlat"> <e p="$PROJECT_DIR$" t="IncludeFlat">
<e p=".git/info/exclude" t="IncludeRecursive" /> <e p=".git/info/exclude" t="IncludeRecursive" />

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Core.Devices.Report
mediaTest.MediaIsRecognized = true; mediaTest.MediaIsRecognized = true;
DicConsole.WriteLine("Querying ATA IDENTIFY..."); DicConsole.WriteLine("Querying ATA IDENTIFY...");
dev.AtaIdentify(out byte[] buffer, out _, dev.Timeout, out _); _dev.AtaIdentify(out byte[] buffer, out _, _dev.Timeout, out _);
mediaTest.IdentifyData = ClearIdentify(buffer); mediaTest.IdentifyData = ClearIdentify(buffer);
mediaTest.IdentifyDevice = Identify.Decode(buffer); mediaTest.IdentifyDevice = Identify.Decode(buffer);
@@ -157,114 +157,114 @@ namespace DiscImageChef.Core.Devices.Report
bool sense; bool sense;
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, dev.Timeout, sense = _dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, _dev.Timeout,
out _); out _);
mediaTest.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadSectorsData = readBuf; mediaTest.ReadSectorsData = readBuf;
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
mediaTest.SupportsReadRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadSectorsRetryData = readBuf; mediaTest.ReadSectorsRetryData = readBuf;
DicConsole.WriteLine("Trying READ DMA in CHS mode..."); DicConsole.WriteLine("Trying READ DMA in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
mediaTest.SupportsReadDma = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadDma = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadDmaData = readBuf; mediaTest.ReadDmaData = readBuf;
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
mediaTest.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadDmaRetryData = readBuf; mediaTest.ReadDmaRetryData = readBuf;
DicConsole.WriteLine("Trying SEEK in CHS mode..."); DicConsole.WriteLine("Trying SEEK in CHS mode...");
sense = dev.Seek(out errorChs, 0, 0, 1, dev.Timeout, out _); sense = _dev.Seek(out errorChs, 0, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0; mediaTest.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense, 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..."); DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
sense = dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && mediaTest.SupportsReadLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLbaData = readBuf; mediaTest.ReadLbaData = readBuf;
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && mediaTest.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadRetryLbaData = readBuf; mediaTest.ReadRetryLbaData = readBuf;
DicConsole.WriteLine("Trying READ DMA in LBA mode..."); DicConsole.WriteLine("Trying READ DMA in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && mediaTest.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadDmaLbaData = readBuf; mediaTest.ReadDmaLbaData = readBuf;
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadDmaRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && mediaTest.SupportsReadDmaRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadDmaRetryLbaData = readBuf; mediaTest.ReadDmaRetryLbaData = readBuf;
DicConsole.WriteLine("Trying SEEK in LBA mode..."); DicConsole.WriteLine("Trying SEEK in LBA mode...");
sense = dev.Seek(out errorLba, 0, dev.Timeout, out _); sense = _dev.Seek(out errorLba, 0, _dev.Timeout, out _);
mediaTest.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0; mediaTest.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense, 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..."); DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
sense = dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && mediaTest.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLba48Data = readBuf; mediaTest.ReadLba48Data = readBuf;
DicConsole.WriteLine("Trying READ DMA in LBA48 mode..."); DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
mediaTest.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && mediaTest.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 &&
errorLba48.Error == 0 && readBuf.Length > 0; errorLba48.Error == 0 && readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadDmaLba48Data = readBuf; mediaTest.ReadDmaLba48Data = readBuf;
// Send SET FEATURES before sending READ LONG commands, retrieve IDENTIFY again and // Send SET FEATURES before sending READ LONG commands, retrieve IDENTIFY again and
// check if ECC size changed. Sector is set to 1 because without it most drives just return // check if ECC size changed. Sector is set to 1 because without it most drives just return
// CORRECTABLE ERROR for this command. // CORRECTABLE ERROR for this command.
dev.SetFeatures(out _, AtaFeatures.EnableReadLongVendorLength, 0, 0, 1, 0, dev.Timeout, out _); _dev.SetFeatures(out _, AtaFeatures.EnableReadLongVendorLength, 0, 0, 1, 0, _dev.Timeout, out _);
dev.AtaIdentify(out buffer, out _, dev.Timeout, out _); _dev.AtaIdentify(out buffer, out _, _dev.Timeout, out _);
if(Identify.Decode(buffer).HasValue) if(Identify.Decode(buffer).HasValue)
{ {
ataId = Identify.Decode(buffer).Value; ataId = Identify.Decode(buffer).Value;
@@ -277,19 +277,19 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying READ LONG in CHS mode..."); DicConsole.WriteLine("Trying READ LONG in CHS mode...");
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize ?? 0, sense = _dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize ?? 0,
dev.Timeout, out _); _dev.Timeout, out _);
mediaTest.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead; BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLongData = readBuf; mediaTest.ReadLongData = readBuf;
DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode...");
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize ?? 0, sense = _dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize ?? 0,
dev.Timeout, out _); _dev.Timeout, out _);
mediaTest.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && mediaTest.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != BitConverter.ToUInt64(readBuf, 0) !=
@@ -297,10 +297,10 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLongRetryData = readBuf; mediaTest.ReadLongRetryData = readBuf;
DicConsole.WriteLine("Trying READ LONG in LBA mode..."); DicConsole.WriteLine("Trying READ LONG in LBA mode...");
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize ?? 0, dev.Timeout, sense = _dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize ?? 0, _dev.Timeout,
out _); out _);
mediaTest.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && mediaTest.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
@@ -308,10 +308,10 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLongLbaData = readBuf; mediaTest.ReadLongLbaData = readBuf;
DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode...");
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize ?? 0, dev.Timeout, sense = _dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize ?? 0, _dev.Timeout,
out _); out _);
mediaTest.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && mediaTest.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 &&
errorLba.Error == 0 && readBuf.Length > 0 && errorLba.Error == 0 && readBuf.Length > 0 &&
@@ -319,7 +319,7 @@ namespace DiscImageChef.Core.Devices.Report
DicConsole.DebugWriteLine("ATA Report", DicConsole.DebugWriteLine("ATA Report",
"Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, "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) mediaTest.ReadLongRetryLbaData = readBuf; mediaTest.ReadLongRetryLbaData = readBuf;
} }
else mediaTest.MediaIsRecognized = false; else mediaTest.MediaIsRecognized = false;
@@ -429,104 +429,104 @@ namespace DiscImageChef.Core.Devices.Report
bool sense; bool sense;
DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) in CHS mode...");
sense = dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, dev.Timeout, sense = _dev.Read(out byte[] readBuf, out AtaErrorRegistersChs errorChs, false, 0, 0, 1, 1, _dev.Timeout,
out _); out _);
capabilities.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && capabilities.SupportsReadSectors = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", 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) capabilities.ReadSectorsData = readBuf; capabilities.ReadSectorsData = readBuf;
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode...");
sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
capabilities.SupportsReadRetry = capabilities.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}", 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) capabilities.ReadSectorsRetryData = readBuf; capabilities.ReadSectorsRetryData = readBuf;
DicConsole.WriteLine("Trying READ DMA in CHS mode..."); DicConsole.WriteLine("Trying READ DMA in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, _dev.Timeout, out _);
capabilities.SupportsReadDma = capabilities.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}", 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) capabilities.ReadDmaData = readBuf; capabilities.ReadDmaData = readBuf;
DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode...");
sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, _dev.Timeout, out _);
capabilities.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && capabilities.SupportsReadDmaRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", 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) capabilities.ReadDmaRetryData = readBuf; capabilities.ReadDmaRetryData = readBuf;
DicConsole.WriteLine("Trying SEEK in CHS mode..."); DicConsole.WriteLine("Trying SEEK in CHS mode...");
sense = dev.Seek(out errorChs, 0, 0, 1, dev.Timeout, out _); sense = _dev.Seek(out errorChs, 0, 0, 1, _dev.Timeout, out _);
capabilities.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0; capabilities.SupportsSeek = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense, 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..."); DicConsole.WriteLine("Trying READ SECTOR(S) in LBA mode...");
sense = dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out AtaErrorRegistersLba28 errorLba, false, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadLba = capabilities.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}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadLbaData = readBuf; capabilities.ReadLbaData = readBuf;
DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode...");
sense = dev.Read(out readBuf, out errorLba, true, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && capabilities.SupportsReadRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadRetryLbaData = readBuf; capabilities.ReadRetryLbaData = readBuf;
DicConsole.WriteLine("Trying READ DMA in LBA mode..."); DicConsole.WriteLine("Trying READ DMA in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba, false, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && capabilities.SupportsReadDmaLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadDmaLbaData = readBuf; capabilities.ReadDmaLbaData = readBuf;
DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode...");
sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba, true, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadDmaRetryLba = capabilities.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}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadDmaRetryLbaData = readBuf; capabilities.ReadDmaRetryLbaData = readBuf;
DicConsole.WriteLine("Trying SEEK in LBA mode..."); DicConsole.WriteLine("Trying SEEK in LBA mode...");
sense = dev.Seek(out errorLba, 0, dev.Timeout, out _); sense = _dev.Seek(out errorLba, 0, _dev.Timeout, out _);
capabilities.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0; capabilities.SupportsSeekLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}", sense, 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..."); DicConsole.WriteLine("Trying READ SECTOR(S) in LBA48 mode...");
sense = dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, dev.Timeout, out _); sense = _dev.Read(out readBuf, out AtaErrorRegistersLba48 errorLba48, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && capabilities.SupportsReadLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba48.Status, errorLba48.Error, readBuf.Length); sense, errorLba48.Status, errorLba48.Error, readBuf.Length);
if(debug) capabilities.ReadLba48Data = readBuf; capabilities.ReadLba48Data = readBuf;
DicConsole.WriteLine("Trying READ DMA in LBA48 mode..."); DicConsole.WriteLine("Trying READ DMA in LBA48 mode...");
sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, dev.Timeout, out _); sense = _dev.ReadDma(out readBuf, out errorLba48, 0, 1, _dev.Timeout, out _);
capabilities.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 && capabilities.SupportsReadDmaLba48 = !sense && (errorLba48.Status & 0x01) != 0x01 && errorLba48.Error == 0 &&
readBuf.Length > 0; readBuf.Length > 0;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba48.Status, errorLba48.Error, readBuf.Length); sense, errorLba48.Status, errorLba48.Error, readBuf.Length);
if(debug) capabilities.ReadDmaLba48Data = readBuf; capabilities.ReadDmaLba48Data = readBuf;
// Send SET FEATURES before sending READ LONG commands, retrieve IDENTIFY again and // Send SET FEATURES before sending READ LONG commands, retrieve IDENTIFY again and
// check if ECC size changed. Sector is set to 1 because without it most drives just return // check if ECC size changed. Sector is set to 1 because without it most drives just return
// CORRECTABLE ERROR for this command. // CORRECTABLE ERROR for this command.
dev.SetFeatures(out _, AtaFeatures.EnableReadLongVendorLength, 0, 0, 1, 0, dev.Timeout, out _); _dev.SetFeatures(out _, AtaFeatures.EnableReadLongVendorLength, 0, 0, 1, 0, _dev.Timeout, out _);
dev.AtaIdentify(out byte[] buffer, out _, dev.Timeout, out _); _dev.AtaIdentify(out byte[] buffer, out _, _dev.Timeout, out _);
if(Identify.Decode(buffer).HasValue) if(Identify.Decode(buffer).HasValue)
{ {
ataId = Identify.Decode(buffer).Value; ataId = Identify.Decode(buffer).Value;
@@ -539,18 +539,18 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying READ LONG in CHS mode..."); DicConsole.WriteLine("Trying READ LONG in CHS mode...");
sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, capabilities.LongBlockSize ?? 0, sense = _dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, capabilities.LongBlockSize ?? 0,
dev.Timeout, out _); _dev.Timeout, out _);
capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 &&
errorChs.Error == 0 && errorChs.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead; BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", 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) capabilities.ReadLongData = readBuf; capabilities.ReadLongData = readBuf;
DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode..."); DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode...");
sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, capabilities.LongBlockSize ?? 0, dev.Timeout, sense = _dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, capabilities.LongBlockSize ?? 0, _dev.Timeout,
out _); out _);
capabilities.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 && capabilities.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
@@ -558,20 +558,20 @@ namespace DiscImageChef.Core.Devices.Report
checkCorrectRead; checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", 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) capabilities.ReadLongRetryData = readBuf; capabilities.ReadLongRetryData = readBuf;
DicConsole.WriteLine("Trying READ LONG in LBA mode..."); DicConsole.WriteLine("Trying READ LONG in LBA mode...");
sense = dev.ReadLong(out readBuf, out errorLba, false, 0, capabilities.LongBlockSize ?? 0, dev.Timeout, sense = _dev.ReadLong(out readBuf, out errorLba, false, 0, capabilities.LongBlockSize ?? 0, _dev.Timeout,
out _); out _);
capabilities.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && capabilities.SupportsReadLongLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead; BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadLongLbaData = readBuf; capabilities.ReadLongLbaData = readBuf;
DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode..."); DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode...");
sense = dev.ReadLong(out readBuf, out errorLba, true, 0, capabilities.LongBlockSize ?? 0, dev.Timeout, sense = _dev.ReadLong(out readBuf, out errorLba, true, 0, capabilities.LongBlockSize ?? 0, _dev.Timeout,
out _); out _);
capabilities.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 && capabilities.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
readBuf.Length > 0 && readBuf.Length > 0 &&
@@ -579,7 +579,7 @@ namespace DiscImageChef.Core.Devices.Report
checkCorrectRead; checkCorrectRead;
DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", DicConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
sense, errorLba.Status, errorLba.Error, readBuf.Length); sense, errorLba.Status, errorLba.Error, readBuf.Length);
if(debug) capabilities.ReadLongRetryLbaData = readBuf; capabilities.ReadLongRetryLbaData = readBuf;
return capabilities; return capabilities;
} }

View File

@@ -36,13 +36,11 @@ namespace DiscImageChef.Core.Devices.Report
{ {
public partial class DeviceReport public partial class DeviceReport
{ {
bool debug; Device _dev;
Device dev;
public DeviceReport(Device device, bool debug) public DeviceReport(Device device)
{ {
dev = device; _dev = device;
this.debug = debug;
} }
} }
} }

View File

@@ -45,10 +45,10 @@ namespace DiscImageChef.Core.Devices.Report
public FireWire FireWireReport() => public FireWire FireWireReport() =>
new FireWire new FireWire
{ {
Manufacturer = dev.FireWireVendorName, Manufacturer = _dev.FireWireVendorName,
Product = dev.FireWireModelName, Product = _dev.FireWireModelName,
ProductID = dev.FireWireModel, ProductID = _dev.FireWireModel,
VendorID = dev.FireWireVendor VendorID = _dev.FireWireVendor
}; };
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -45,8 +45,8 @@ namespace DiscImageChef.Core.Devices.Report
/// </summary> /// </summary>
public Pcmcia PcmciaReport() public Pcmcia PcmciaReport()
{ {
Pcmcia pcmciaReport = new Pcmcia {CIS = dev.Cis}; Pcmcia pcmciaReport = new Pcmcia {CIS = _dev.Cis};
Tuple[] tuples = CIS.GetTuples(dev.Cis); Tuple[] tuples = CIS.GetTuples(_dev.Cis);
if(tuples == null) return pcmciaReport; if(tuples == null) return pcmciaReport;
foreach(Tuple tuple in tuples) foreach(Tuple tuple in tuples)

View File

@@ -45,7 +45,7 @@ namespace DiscImageChef.Core.Devices.Report
{ {
Ssc report = new Ssc(); Ssc report = new Ssc();
DicConsole.WriteLine("Querying SCSI READ BLOCK LIMITS..."); DicConsole.WriteLine("Querying SCSI READ BLOCK LIMITS...");
bool sense = dev.ReadBlockLimits(out byte[] buffer, out byte[] _, dev.Timeout, out _); bool sense = _dev.ReadBlockLimits(out byte[] buffer, out byte[] _, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
BlockLimits.BlockLimitsData? decBl = BlockLimits.Decode(buffer); BlockLimits.BlockLimitsData? decBl = BlockLimits.Decode(buffer);
@@ -60,7 +60,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT..."); DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT...");
sense = dev.ReportDensitySupport(out buffer, out byte[] _, false, false, dev.Timeout, out _); sense = _dev.ReportDensitySupport(out buffer, out byte[] _, false, false, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
DensitySupport.DensitySupportHeader? dsh = DensitySupport.DecodeDensity(buffer); DensitySupport.DensitySupportHeader? dsh = DensitySupport.DecodeDensity(buffer);
@@ -89,7 +89,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for medium types..."); DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for medium types...");
sense = dev.ReportDensitySupport(out buffer, out byte[] _, true, false, dev.Timeout, out _); sense = _dev.ReportDensitySupport(out buffer, out byte[] _, true, false, _dev.Timeout, out _);
if(sense) return report; if(sense) return report;
DensitySupport.MediaTypeSupportHeader? mtsh = DensitySupport.DecodeMediumType(buffer); DensitySupport.MediaTypeSupportHeader? mtsh = DensitySupport.DecodeMediumType(buffer);
@@ -127,20 +127,20 @@ namespace DiscImageChef.Core.Devices.Report
Modes.DecodedMode? decMode = null; Modes.DecodedMode? decMode = null;
DicConsole.WriteLine("Querying SCSI MODE SENSE (10)..."); DicConsole.WriteLine("Querying SCSI MODE SENSE (10)...");
bool sense = dev.ModeSense10(out byte[] buffer, out byte[] _, false, true, ScsiModeSensePageControl.Current, bool sense = _dev.ModeSense10(out byte[] buffer, out byte[] _, false, true, ScsiModeSensePageControl.Current,
0x3F, 0x00, dev.Timeout, out _); 0x3F, 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
decMode = Modes.DecodeMode10(buffer, dev.ScsiType); decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
if(debug) seqTest.ModeSense10Data = buffer; seqTest.ModeSense10Data = buffer;
} }
DicConsole.WriteLine("Querying SCSI MODE SENSE..."); DicConsole.WriteLine("Querying SCSI MODE SENSE...");
sense = dev.ModeSense(out buffer, out byte[] _, dev.Timeout, out _); sense = _dev.ModeSense(out buffer, out byte[] _, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, _dev.ScsiType);
if(debug) seqTest.ModeSense6Data = buffer; seqTest.ModeSense6Data = buffer;
} }
if(decMode.HasValue) if(decMode.HasValue)
@@ -151,7 +151,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for current media..."); DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for current media...");
sense = dev.ReportDensitySupport(out buffer, out byte[] _, false, true, dev.Timeout, out _); sense = _dev.ReportDensitySupport(out buffer, out byte[] _, false, true, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
DensitySupport.DensitySupportHeader? dsh = DensitySupport.DecodeDensity(buffer); DensitySupport.DensitySupportHeader? dsh = DensitySupport.DecodeDensity(buffer);
@@ -180,7 +180,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for medium types for current media..."); DicConsole.WriteLine("Querying SCSI REPORT DENSITY SUPPORT for medium types for current media...");
sense = dev.ReportDensitySupport(out buffer, out byte[] _, true, true, dev.Timeout, out _); sense = _dev.ReportDensitySupport(out buffer, out byte[] _, true, true, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
DensitySupport.MediaTypeSupportHeader? mtsh = DensitySupport.DecodeMediumType(buffer); DensitySupport.MediaTypeSupportHeader? mtsh = DensitySupport.DecodeMediumType(buffer);
@@ -211,7 +211,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying SCSI READ MEDIA SERIAL NUMBER..."); DicConsole.WriteLine("Trying SCSI READ MEDIA SERIAL NUMBER...");
seqTest.CanReadMediaSerial = !dev.ReadMediaSerialNumber(out buffer, out byte[] _, dev.Timeout, out _); seqTest.CanReadMediaSerial = !_dev.ReadMediaSerialNumber(out buffer, out byte[] _, _dev.Timeout, out _);
return seqTest; return seqTest;
} }

View File

@@ -45,7 +45,7 @@ namespace DiscImageChef.Core.Devices.Report
public Scsi ReportScsiInquiry() public Scsi ReportScsiInquiry()
{ {
DicConsole.WriteLine("Querying SCSI INQUIRY..."); DicConsole.WriteLine("Querying SCSI INQUIRY...");
bool sense = dev.ScsiInquiry(out byte[] buffer, out byte[] senseBuffer); bool sense = _dev.ScsiInquiry(out byte[] buffer, out byte[] senseBuffer);
Scsi report = new Scsi(); Scsi report = new Scsi();
@@ -71,7 +71,7 @@ namespace DiscImageChef.Core.Devices.Report
public List<ScsiPage> ReportEvpdPages(string vendor) public List<ScsiPage> ReportEvpdPages(string vendor)
{ {
DicConsole.WriteLine("Querying list of SCSI EVPDs..."); DicConsole.WriteLine("Querying list of SCSI EVPDs...");
bool sense = dev.ScsiInquiry(out byte[] buffer, out _, 0x00); bool sense = _dev.ScsiInquiry(out byte[] buffer, out _, 0x00);
if(sense) return null; if(sense) return null;
@@ -82,7 +82,7 @@ namespace DiscImageChef.Core.Devices.Report
foreach(byte page in evpdPages.Where(page => page != 0x80)) foreach(byte page in evpdPages.Where(page => page != 0x80))
{ {
DicConsole.WriteLine("Querying SCSI EVPD {0:X2}h...", page); DicConsole.WriteLine("Querying SCSI EVPD {0:X2}h...", page);
sense = dev.ScsiInquiry(out buffer, out _, page); sense = _dev.ScsiInquiry(out buffer, out _, page);
if(sense) continue; if(sense) continue;
byte[] empty; byte[] empty;
@@ -149,33 +149,33 @@ namespace DiscImageChef.Core.Devices.Report
public void ReportScsiModes(ref DeviceReportV2 report, out byte[] cdromMode) public void ReportScsiModes(ref DeviceReportV2 report, out byte[] cdromMode)
{ {
Modes.DecodedMode? decMode = null; Modes.DecodedMode? decMode = null;
PeripheralDeviceTypes devType = dev.ScsiType; PeripheralDeviceTypes devType = _dev.ScsiType;
byte[] mode10Currentbuffer; byte[] mode10Currentbuffer;
byte[] mode10Changeablebuffer; byte[] mode10Changeablebuffer;
byte[] mode6Currentbuffer; byte[] mode6Currentbuffer;
byte[] mode6Changeablebuffer; byte[] mode6Changeablebuffer;
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)..."); DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)...");
bool sense = dev.ModeSense10(out byte[] mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default, bool sense = _dev.ModeSense10(out byte[] mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default,
0x3F, 0xFF, dev.Timeout, out _); 0x3F, 0xFF, _dev.Timeout, out _);
if(sense || dev.Error) if(sense || _dev.Error)
{ {
DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (10)..."); DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (10)...");
sense = dev.ModeSense10(out mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default, 0x3F, sense = _dev.ModeSense10(out mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default, 0x3F,
0x00, dev.Timeout, out _); 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSense10 = true;
report.SCSI.SupportsModeSubpages = false; report.SCSI.SupportsModeSubpages = false;
decMode = Modes.DecodeMode10(mode10Buffer, devType); decMode = Modes.DecodeMode10(mode10Buffer, devType);
if(debug)
{ {
sense = dev.ModeSense10(out mode10Currentbuffer, out _, false, true, sense = _dev.ModeSense10(out mode10Currentbuffer, out _, false, true,
ScsiModeSensePageControl.Current, 0x3F, 0x00, dev.Timeout, out _); ScsiModeSensePageControl.Current, 0x3F, 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer;
sense = dev.ModeSense10(out mode10Changeablebuffer, out _, false, true, sense = _dev.ModeSense10(out mode10Changeablebuffer, out _, false, true,
ScsiModeSensePageControl.Changeable, 0x3F, 0x00, dev.Timeout, out _); ScsiModeSensePageControl.Changeable, 0x3F, 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer;
} }
} }
} }
@@ -184,62 +184,62 @@ namespace DiscImageChef.Core.Devices.Report
report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSense10 = true;
report.SCSI.SupportsModeSubpages = true; report.SCSI.SupportsModeSubpages = true;
decMode = Modes.DecodeMode10(mode10Buffer, devType); decMode = Modes.DecodeMode10(mode10Buffer, devType);
if(debug)
{ {
sense = dev.ModeSense10(out mode10Currentbuffer, out _, false, true, sense = _dev.ModeSense10(out mode10Currentbuffer, out _, false, true,
ScsiModeSensePageControl.Current, 0x3F, 0xFF, dev.Timeout, out _); ScsiModeSensePageControl.Current, 0x3F, 0xFF, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer;
sense = dev.ModeSense10(out mode10Changeablebuffer, out _, false, true, sense = _dev.ModeSense10(out mode10Changeablebuffer, out _, false, true,
ScsiModeSensePageControl.Changeable, 0x3F, 0xFF, dev.Timeout, out _); ScsiModeSensePageControl.Changeable, 0x3F, 0xFF, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer;
} }
} }
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)..."); DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)...");
sense = dev.ModeSense6(out byte[] mode6Buffer, out _, false, ScsiModeSensePageControl.Default, 0x3F, 0xFF, sense = _dev.ModeSense6(out byte[] mode6Buffer, out _, false, ScsiModeSensePageControl.Default, 0x3F, 0xFF,
dev.Timeout, out _); _dev.Timeout, out _);
if(sense || dev.Error) if(sense || _dev.Error)
{ {
DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (6)..."); DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (6)...");
sense = dev.ModeSense6(out mode6Buffer, out _, false, ScsiModeSensePageControl.Default, 0x3F, 0x00, sense = _dev.ModeSense6(out mode6Buffer, out _, false, ScsiModeSensePageControl.Default, 0x3F, 0x00,
dev.Timeout, out _); _dev.Timeout, out _);
if(sense || dev.Error) if(sense || _dev.Error)
{ {
DicConsole.WriteLine("Querying SCSI MODE SENSE (6)..."); DicConsole.WriteLine("Querying SCSI MODE SENSE (6)...");
sense = dev.ModeSense(out mode6Buffer, out _, dev.Timeout, out _); sense = _dev.ModeSense(out mode6Buffer, out _, _dev.Timeout, out _);
} }
else if(debug) else
{ {
sense = dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F, sense = _dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F,
0x00, dev.Timeout, out _); 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer;
sense = dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable, sense = _dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable,
0x3F, 0x00, dev.Timeout, out _); 0x3F, 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer;
} }
} }
else else
{ {
report.SCSI.SupportsModeSubpages = true; report.SCSI.SupportsModeSubpages = true;
if(debug)
{ {
sense = dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F, sense = _dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F,
0xFF, dev.Timeout, out _); 0xFF, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer;
sense = dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable, sense = _dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable,
0x3F, 0xFF, dev.Timeout, out _); 0x3F, 0xFF, _dev.Timeout, out _);
if(!sense && !dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer; if(!sense && !_dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer;
} }
} }
if(!sense && !dev.Error && !decMode.HasValue) decMode = Modes.DecodeMode6(mode6Buffer, devType); if(!sense && !_dev.Error && !decMode.HasValue) decMode = Modes.DecodeMode6(mode6Buffer, devType);
report.SCSI.SupportsModeSense6 |= !sense && !dev.Error; report.SCSI.SupportsModeSense6 |= !sense && !_dev.Error;
cdromMode = null; cdromMode = null;
if(debug && report.SCSI.SupportsModeSense6) report.SCSI.ModeSense6Data = mode6Buffer; if(report.SCSI.SupportsModeSense6) report.SCSI.ModeSense6Data = mode6Buffer;
if(debug && report.SCSI.SupportsModeSense10) report.SCSI.ModeSense10Data = mode10Buffer; if(report.SCSI.SupportsModeSense10) report.SCSI.ModeSense10Data = mode10Buffer;
if(!decMode.HasValue) return; if(!decMode.HasValue) return;
@@ -273,8 +273,8 @@ namespace DiscImageChef.Core.Devices.Report
{ {
TestedMedia mediaTest = new TestedMedia(); TestedMedia mediaTest = new TestedMedia();
DicConsole.WriteLine("Querying SCSI READ CAPACITY..."); DicConsole.WriteLine("Querying SCSI READ CAPACITY...");
bool sense = dev.ReadCapacity(out byte[] buffer, out byte[] senseBuffer, dev.Timeout, out _); bool sense = _dev.ReadCapacity(out byte[] buffer, out byte[] senseBuffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
mediaTest.SupportsReadCapacity = true; mediaTest.SupportsReadCapacity = true;
mediaTest.Blocks = mediaTest.Blocks =
@@ -284,8 +284,8 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI READ CAPACITY (16)..."); DicConsole.WriteLine("Querying SCSI READ CAPACITY (16)...");
sense = dev.ReadCapacity16(out buffer, out buffer, dev.Timeout, out _); sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
mediaTest.SupportsReadCapacity16 = true; mediaTest.SupportsReadCapacity16 = true;
byte[] temp = new byte[8]; byte[] temp = new byte[8];
@@ -298,20 +298,20 @@ namespace DiscImageChef.Core.Devices.Report
Modes.DecodedMode? decMode = null; Modes.DecodedMode? decMode = null;
DicConsole.WriteLine("Querying SCSI MODE SENSE (10)..."); DicConsole.WriteLine("Querying SCSI MODE SENSE (10)...");
sense = dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Current, 0x3F, sense = _dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, dev.Timeout, out _); 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
decMode = Modes.DecodeMode10(buffer, dev.ScsiType); decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
if(debug) mediaTest.ModeSense10Data = buffer; mediaTest.ModeSense10Data = buffer;
} }
DicConsole.WriteLine("Querying SCSI MODE SENSE..."); DicConsole.WriteLine("Querying SCSI MODE SENSE...");
sense = dev.ModeSense(out buffer, out senseBuffer, dev.Timeout, out _); sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, _dev.ScsiType);
if(debug) mediaTest.ModeSense6Data = buffer; mediaTest.ModeSense6Data = buffer;
} }
if(decMode.HasValue) if(decMode.HasValue)
@@ -322,33 +322,33 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying SCSI READ (6)..."); DicConsole.WriteLine("Trying SCSI READ (6)...");
mediaTest.SupportsRead6 = !dev.Read6(out buffer, out senseBuffer, 0, mediaTest.SupportsRead6 = !_dev.Read6(out buffer, out senseBuffer, 0,
mediaTest.BlockSize ?? 512, dev.Timeout, out _); mediaTest.BlockSize ?? 512, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead6); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead6);
if(debug) mediaTest.Read6Data = buffer; mediaTest.Read6Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (10)..."); DicConsole.WriteLine("Trying SCSI READ (10)...");
mediaTest.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0, mediaTest.SupportsRead10 = !_dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0,
mediaTest.BlockSize ?? 512, 0, 1, dev.Timeout, out _); mediaTest.BlockSize ?? 512, 0, 1, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10);
if(debug) mediaTest.Read10Data = buffer; mediaTest.Read10Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (12)..."); DicConsole.WriteLine("Trying SCSI READ (12)...");
mediaTest.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0, mediaTest.SupportsRead12 = !_dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0,
mediaTest.BlockSize ?? 512, 0, 1, false, dev.Timeout, out _); mediaTest.BlockSize ?? 512, 0, 1, false, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12);
if(debug) mediaTest.Read12Data = buffer; mediaTest.Read12Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (16)..."); DicConsole.WriteLine("Trying SCSI READ (16)...");
mediaTest.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0, mediaTest.SupportsRead16 = !_dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0,
mediaTest.BlockSize ?? 512, 0, 1, false, dev.Timeout, out _); mediaTest.BlockSize ?? 512, 0, 1, false, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16);
if(debug) mediaTest.Read16Data = buffer; mediaTest.Read16Data = buffer;
mediaTest.LongBlockSize = mediaTest.BlockSize; mediaTest.LongBlockSize = mediaTest.BlockSize;
DicConsole.WriteLine("Trying SCSI READ LONG (10)..."); DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 0xFFFF, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 0xFFFF, _dev.Timeout, out _);
if(sense && !dev.Error) if(sense && !_dev.Error)
{ {
FixedSense? decSense = Sense.DecodeFixed(senseBuffer); FixedSense? decSense = Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue) if(decSense.HasValue)
@@ -374,9 +374,9 @@ namespace DiscImageChef.Core.Devices.Report
}) })
{ {
ushort testSize = (ushort)i; ushort testSize = (ushort)i;
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize, dev.Timeout, sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, testSize, _dev.Timeout,
out _); out _);
if(sense || dev.Error) continue; if(sense || _dev.Error) continue;
mediaTest.SupportsReadLong = true; mediaTest.SupportsReadLong = true;
mediaTest.LongBlockSize = testSize; mediaTest.LongBlockSize = testSize;
@@ -392,9 +392,9 @@ namespace DiscImageChef.Core.Devices.Report
}) })
{ {
ushort testSize = (ushort)i; ushort testSize = (ushort)i;
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, dev.Timeout, sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, _dev.Timeout,
out _); out _);
if(sense || dev.Error) continue; if(sense || _dev.Error) continue;
mediaTest.SupportsReadLong = true; mediaTest.SupportsReadLong = true;
mediaTest.LongBlockSize = testSize; mediaTest.LongBlockSize = testSize;
@@ -402,8 +402,8 @@ namespace DiscImageChef.Core.Devices.Report
} }
else if(mediaTest.BlockSize == 2048) else if(mediaTest.BlockSize == 2048)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
mediaTest.SupportsReadLong = true; mediaTest.SupportsReadLong = true;
mediaTest.LongBlockSize = 2380; mediaTest.LongBlockSize = 2380;
@@ -411,8 +411,8 @@ namespace DiscImageChef.Core.Devices.Report
} }
else if(mediaTest.BlockSize == 4096) else if(mediaTest.BlockSize == 4096)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
mediaTest.SupportsReadLong = true; mediaTest.SupportsReadLong = true;
mediaTest.LongBlockSize = 4760; mediaTest.LongBlockSize = 4760;
@@ -420,8 +420,8 @@ namespace DiscImageChef.Core.Devices.Report
} }
else if(mediaTest.BlockSize == 8192) else if(mediaTest.BlockSize == 8192)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
mediaTest.SupportsReadLong = true; mediaTest.SupportsReadLong = true;
mediaTest.LongBlockSize = 9424; mediaTest.LongBlockSize = 9424;
@@ -429,7 +429,7 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying SCSI READ MEDIA SERIAL NUMBER..."); DicConsole.WriteLine("Trying SCSI READ MEDIA SERIAL NUMBER...");
mediaTest.CanReadMediaSerial = !dev.ReadMediaSerialNumber(out buffer, out senseBuffer, dev.Timeout, out _); mediaTest.CanReadMediaSerial = !_dev.ReadMediaSerialNumber(out buffer, out senseBuffer, _dev.Timeout, out _);
return mediaTest; return mediaTest;
} }
@@ -439,8 +439,8 @@ namespace DiscImageChef.Core.Devices.Report
TestedMedia capabilities = new TestedMedia {MediaIsRecognized = true}; TestedMedia capabilities = new TestedMedia {MediaIsRecognized = true};
DicConsole.WriteLine("Querying SCSI READ CAPACITY..."); DicConsole.WriteLine("Querying SCSI READ CAPACITY...");
bool sense = dev.ReadCapacity(out byte[] buffer, out byte[] senseBuffer, dev.Timeout, out _); bool sense = _dev.ReadCapacity(out byte[] buffer, out byte[] senseBuffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
capabilities.SupportsReadCapacity = true; capabilities.SupportsReadCapacity = true;
capabilities.Blocks = capabilities.Blocks =
@@ -450,8 +450,8 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Querying SCSI READ CAPACITY (16)..."); DicConsole.WriteLine("Querying SCSI READ CAPACITY (16)...");
sense = dev.ReadCapacity16(out buffer, out buffer, dev.Timeout, out _); sense = _dev.ReadCapacity16(out buffer, out buffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
capabilities.SupportsReadCapacity16 = true; capabilities.SupportsReadCapacity16 = true;
byte[] temp = new byte[8]; byte[] temp = new byte[8];
@@ -464,20 +464,20 @@ namespace DiscImageChef.Core.Devices.Report
Modes.DecodedMode? decMode = null; Modes.DecodedMode? decMode = null;
DicConsole.WriteLine("Querying SCSI MODE SENSE (10)..."); DicConsole.WriteLine("Querying SCSI MODE SENSE (10)...");
sense = dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Current, 0x3F, sense = _dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Current, 0x3F,
0x00, dev.Timeout, out _); 0x00, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
decMode = Modes.DecodeMode10(buffer, dev.ScsiType); decMode = Modes.DecodeMode10(buffer, _dev.ScsiType);
if(debug) capabilities.ModeSense10Data = buffer; capabilities.ModeSense10Data = buffer;
} }
DicConsole.WriteLine("Querying SCSI MODE SENSE..."); DicConsole.WriteLine("Querying SCSI MODE SENSE...");
sense = dev.ModeSense(out buffer, out senseBuffer, dev.Timeout, out _); sense = _dev.ModeSense(out buffer, out senseBuffer, _dev.Timeout, out _);
if(!sense && !dev.Error) if(!sense && !_dev.Error)
{ {
if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, _dev.ScsiType);
if(debug) capabilities.ModeSense6Data = buffer; capabilities.ModeSense6Data = buffer;
} }
if(decMode.HasValue) if(decMode.HasValue)
@@ -488,33 +488,33 @@ namespace DiscImageChef.Core.Devices.Report
} }
DicConsole.WriteLine("Trying SCSI READ (6)..."); DicConsole.WriteLine("Trying SCSI READ (6)...");
capabilities.SupportsRead6 = !dev.Read6(out buffer, out senseBuffer, 0, capabilities.BlockSize ?? 512, capabilities.SupportsRead6 = !_dev.Read6(out buffer, out senseBuffer, 0, capabilities.BlockSize ?? 512,
dev.Timeout, out _); _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead6); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead6);
if(debug) capabilities.Read6Data = buffer; capabilities.Read6Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (10)..."); DicConsole.WriteLine("Trying SCSI READ (10)...");
capabilities.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0, capabilities.SupportsRead10 = !_dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0,
capabilities.BlockSize ?? 512, 0, 1, dev.Timeout, out _); capabilities.BlockSize ?? 512, 0, 1, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead10); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead10);
if(debug) capabilities.Read10Data = buffer; capabilities.Read10Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (12)..."); DicConsole.WriteLine("Trying SCSI READ (12)...");
capabilities.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0, capabilities.SupportsRead12 = !_dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0,
capabilities.BlockSize ?? 512, 0, 1, false, dev.Timeout, out _); capabilities.BlockSize ?? 512, 0, 1, false, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead12); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead12);
if(debug) capabilities.Read12Data = buffer; capabilities.Read12Data = buffer;
DicConsole.WriteLine("Trying SCSI READ (16)..."); DicConsole.WriteLine("Trying SCSI READ (16)...");
capabilities.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0, capabilities.SupportsRead16 = !_dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0,
capabilities.BlockSize ?? 512, 0, 1, false, dev.Timeout, out _); capabilities.BlockSize ?? 512, 0, 1, false, _dev.Timeout, out _);
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead16); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !capabilities.SupportsRead16);
if(debug) capabilities.Read16Data = buffer; capabilities.Read16Data = buffer;
capabilities.LongBlockSize = capabilities.BlockSize; capabilities.LongBlockSize = capabilities.BlockSize;
DicConsole.WriteLine("Trying SCSI READ LONG (10)..."); DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 0xFFFF, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 0xFFFF, _dev.Timeout, out _);
if(sense && !dev.Error) if(sense && !_dev.Error)
{ {
FixedSense? decSense = Sense.DecodeFixed(senseBuffer); FixedSense? decSense = Sense.DecodeFixed(senseBuffer);
if(decSense.HasValue) if(decSense.HasValue)
@@ -542,8 +542,8 @@ namespace DiscImageChef.Core.Devices.Report
}) })
{ {
ushort testSize = (ushort)i; ushort testSize = (ushort)i;
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, _dev.Timeout, out _);
if(sense || dev.Error) continue; if(sense || _dev.Error) continue;
capabilities.SupportsReadLong = true; capabilities.SupportsReadLong = true;
capabilities.LongBlockSize = testSize; capabilities.LongBlockSize = testSize;
@@ -559,8 +559,8 @@ namespace DiscImageChef.Core.Devices.Report
}) })
{ {
ushort testSize = (ushort)i; ushort testSize = (ushort)i;
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)i, _dev.Timeout, out _);
if(sense || dev.Error) continue; if(sense || _dev.Error) continue;
capabilities.SupportsReadLong = true; capabilities.SupportsReadLong = true;
capabilities.LongBlockSize = testSize; capabilities.LongBlockSize = testSize;
@@ -568,24 +568,24 @@ namespace DiscImageChef.Core.Devices.Report
} }
else if(capabilities.BlockSize == 2048) else if(capabilities.BlockSize == 2048)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout, out _);
if(sense || dev.Error) return capabilities; if(sense || _dev.Error) return capabilities;
capabilities.SupportsReadLong = true; capabilities.SupportsReadLong = true;
capabilities.LongBlockSize = 2380; capabilities.LongBlockSize = 2380;
} }
else if(capabilities.BlockSize == 4096) else if(capabilities.BlockSize == 4096)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout, out _);
if(sense || dev.Error) return capabilities; if(sense || _dev.Error) return capabilities;
capabilities.SupportsReadLong = true; capabilities.SupportsReadLong = true;
capabilities.LongBlockSize = 4760; capabilities.LongBlockSize = 4760;
} }
else if(capabilities.BlockSize == 8192) else if(capabilities.BlockSize == 8192)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, dev.Timeout, out _); sense = _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout, out _);
if(sense || dev.Error) return capabilities; if(sense || _dev.Error) return capabilities;
capabilities.SupportsReadLong = true; capabilities.SupportsReadLong = true;
capabilities.LongBlockSize = 9424; capabilities.LongBlockSize = 9424;

View File

@@ -49,13 +49,13 @@ namespace DiscImageChef.Core.Devices.Report
MmcSd report = new MmcSd(); MmcSd report = new MmcSd();
DicConsole.WriteLine("Trying to get CID..."); DicConsole.WriteLine("Trying to get CID...");
bool sense = dev.ReadCid(out byte[] cid, out _, dev.Timeout, out _); bool sense = _dev.ReadCid(out byte[] cid, out _, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
DicConsole.WriteLine("CID obtained correctly..."); DicConsole.WriteLine("CID obtained correctly...");
switch(dev.Type) switch(_dev.Type)
{ {
case DeviceType.SecureDigital: case DeviceType.SecureDigital:
// Clear serial number and manufacturing date // Clear serial number and manufacturing date
@@ -81,7 +81,7 @@ namespace DiscImageChef.Core.Devices.Report
else DicConsole.WriteLine("Could not read CID..."); else DicConsole.WriteLine("Could not read CID...");
DicConsole.WriteLine("Trying to get CSD..."); DicConsole.WriteLine("Trying to get CSD...");
sense = dev.ReadCsd(out byte[] csd, out _, dev.Timeout, out _); sense = _dev.ReadCsd(out byte[] csd, out _, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
@@ -93,16 +93,16 @@ namespace DiscImageChef.Core.Devices.Report
sense = true; sense = true;
byte[] ocr = null; byte[] ocr = null;
DicConsole.WriteLine("Trying to get OCR..."); DicConsole.WriteLine("Trying to get OCR...");
switch(dev.Type) switch(_dev.Type)
{ {
case DeviceType.MMC: case DeviceType.MMC:
{ {
sense = dev.ReadOcr(out ocr, out _, dev.Timeout, out _); sense = _dev.ReadOcr(out ocr, out _, _dev.Timeout, out _);
break; break;
} }
case DeviceType.SecureDigital: case DeviceType.SecureDigital:
{ {
sense = dev.ReadSdocr(out ocr, out _, dev.Timeout, out _); sense = _dev.ReadSdocr(out ocr, out _, _dev.Timeout, out _);
break; break;
} }
} }
@@ -114,12 +114,12 @@ namespace DiscImageChef.Core.Devices.Report
} }
else DicConsole.WriteLine("Could not read OCR..."); else DicConsole.WriteLine("Could not read OCR...");
switch(dev.Type) switch(_dev.Type)
{ {
case DeviceType.MMC: case DeviceType.MMC:
{ {
DicConsole.WriteLine("Trying to get Extended CSD..."); DicConsole.WriteLine("Trying to get Extended CSD...");
sense = dev.ReadExtendedCsd(out byte[] ecsd, out _, dev.Timeout, out _); sense = _dev.ReadExtendedCsd(out byte[] ecsd, out _, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {
@@ -133,7 +133,7 @@ namespace DiscImageChef.Core.Devices.Report
case DeviceType.SecureDigital: case DeviceType.SecureDigital:
{ {
DicConsole.WriteLine("Trying to get SCR..."); DicConsole.WriteLine("Trying to get SCR...");
sense = dev.ReadScr(out byte[] scr, out _, dev.Timeout, out _); sense = _dev.ReadScr(out byte[] scr, out _, _dev.Timeout, out _);
if(!sense) if(!sense)
{ {

View File

@@ -50,13 +50,13 @@ namespace DiscImageChef.Core.Devices.Report
{ {
Usb usbReport = new Usb Usb usbReport = new Usb
{ {
Manufacturer = dev.UsbManufacturerString, Manufacturer = _dev.UsbManufacturerString,
Product = dev.UsbProductString, Product = _dev.UsbProductString,
ProductID = dev.UsbProductId, ProductID = _dev.UsbProductId,
VendorID = dev.UsbVendorId VendorID = _dev.UsbVendorId
}; };
if(debug) usbReport.Descriptors = dev.UsbDescriptors; usbReport.Descriptors = _dev.UsbDescriptors;
return usbReport; return usbReport;
} }

View File

@@ -54,9 +54,8 @@ namespace DiscImageChef.Commands
{ {
internal class DeviceReportCommand : Command internal class DeviceReportCommand : Command
{ {
string devicePath; string _devicePath;
bool _showHelp;
bool showHelp;
public DeviceReportCommand() : base("device-report", public DeviceReportCommand() : base("device-report",
"Tests the device capabilities and creates an JSON report of them.") => "Tests the device capabilities and creates an JSON report of them.") =>
@@ -66,7 +65,7 @@ namespace DiscImageChef.Commands
$"{MainClass.AssemblyCopyright}", "", $"usage: DiscImageChef {Name} devicepath", "", $"{MainClass.AssemblyCopyright}", "", $"usage: DiscImageChef {Name} devicepath", "",
Help, Help,
{ {
"help|h|?", "Show this message and exit.", v => showHelp = v != null "help|h|?", "Show this message and exit.", v => _showHelp = v != null
} }
}; };
@@ -74,7 +73,7 @@ namespace DiscImageChef.Commands
{ {
List<string> extra = Options.Parse(arguments); List<string> extra = Options.Parse(arguments);
if(showHelp) if(_showHelp)
{ {
Options.WriteOptionDescriptions(CommandSet.Out); Options.WriteOptionDescriptions(CommandSet.Out);
@@ -105,23 +104,23 @@ namespace DiscImageChef.Commands
return(int)ErrorNumber.MissingArgument; return(int)ErrorNumber.MissingArgument;
} }
devicePath = extra[0]; _devicePath = extra[0];
DicConsole.DebugWriteLine("Device-Report command", "--debug={0}", MainClass.Debug); DicConsole.DebugWriteLine("Device-Report command", "--debug={0}", MainClass.Debug);
DicConsole.DebugWriteLine("Device-Report command", "--device={0}", devicePath); DicConsole.DebugWriteLine("Device-Report command", "--device={0}", _devicePath);
DicConsole.DebugWriteLine("Device-Report command", "--verbose={0}", MainClass.Verbose); DicConsole.DebugWriteLine("Device-Report command", "--verbose={0}", MainClass.Verbose);
if(devicePath.Length == 2 && if(_devicePath.Length == 2 &&
devicePath[1] == ':' && _devicePath[1] == ':' &&
devicePath[0] != '/' && _devicePath[0] != '/' &&
char.IsLetter(devicePath[0])) char.IsLetter(_devicePath[0]))
devicePath = "\\\\.\\" + char.ToUpper(devicePath[0]) + ':'; _devicePath = "\\\\.\\" + char.ToUpper(_devicePath[0]) + ':';
Device dev; Device dev;
try try
{ {
dev = new Device(devicePath); dev = new Device(_devicePath);
if(dev.IsRemote) if(dev.IsRemote)
Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion, dev.RemoteOperatingSystem, Statistics.AddRemote(dev.RemoteApplication, dev.RemoteVersion, dev.RemoteOperatingSystem,
@@ -145,10 +144,7 @@ namespace DiscImageChef.Commands
bool isAdmin; bool isAdmin;
if(dev.IsRemote) isAdmin = dev.IsRemote ? dev.IsRemoteAdmin : DetectOS.IsAdmin;
isAdmin = dev.IsRemoteAdmin;
else
isAdmin = DetectOS.IsAdmin;
if(!isAdmin) if(!isAdmin)
{ {
@@ -180,7 +176,7 @@ namespace DiscImageChef.Commands
jsonFile = jsonFile.Replace('\\', '_').Replace('/', '_').Replace('?', '_'); jsonFile = jsonFile.Replace('\\', '_').Replace('/', '_').Replace('?', '_');
var reporter = new DeviceReport(dev, MainClass.Debug); var reporter = new DeviceReport(dev);
ConsoleKeyInfo pressedKey; ConsoleKeyInfo pressedKey;
@@ -658,8 +654,7 @@ namespace DiscImageChef.Commands
tryPioneer |= dev.Manufacturer.ToLowerInvariant() == "pioneer"; tryPioneer |= dev.Manufacturer.ToLowerInvariant() == "pioneer";
tryNec |= dev.Manufacturer.ToLowerInvariant() == "nec"; tryNec |= dev.Manufacturer.ToLowerInvariant() == "nec";
if(MainClass.Debug && if(!iomegaRev)
!iomegaRev)
{ {
if(!tryPlextor) if(!tryPlextor)
{ {
@@ -880,9 +875,7 @@ namespace DiscImageChef.Commands
if(!sense) if(!sense)
{ {
if(MainClass.Debug)
mediaTest.ReadLong10Data = buffer; mediaTest.ReadLong10Data = buffer;
mediaTest.LongBlockSize = i; mediaTest.LongBlockSize = i;
break; break;
@@ -896,8 +889,7 @@ namespace DiscImageChef.Commands
} }
} }
if(MainClass.Debug && if(mediaTest.SupportsReadLong == true &&
mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize) mediaTest.LongBlockSize != mediaTest.BlockSize)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
@@ -1200,8 +1192,7 @@ namespace DiscImageChef.Commands
} }
} }
if(MainClass.Debug && if(mediaTest.SupportsReadLong == true &&
mediaTest.SupportsReadLong == true &&
mediaTest.LongBlockSize != mediaTest.BlockSize) mediaTest.LongBlockSize != mediaTest.BlockSize)
{ {
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
@@ -1256,9 +1247,7 @@ namespace DiscImageChef.Commands
if(!sense) if(!sense)
{ {
if(MainClass.Debug)
report.SCSI.ReadCapabilities.ReadLong10Data = buffer; report.SCSI.ReadCapabilities.ReadLong10Data = buffer;
report.SCSI.ReadCapabilities.LongBlockSize = i; report.SCSI.ReadCapabilities.LongBlockSize = i;
break; break;
@@ -1272,7 +1261,7 @@ namespace DiscImageChef.Commands
} }
} }
if(MainClass.Debug && if(
report.SCSI.ReadCapabilities.SupportsReadLong == true && report.SCSI.ReadCapabilities.SupportsReadLong == true &&
report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.LongBlockSize !=
report.SCSI.ReadCapabilities.BlockSize) report.SCSI.ReadCapabilities.BlockSize)