diff --git a/DiscImageChef.Core/Devices/Report/ATA.cs b/DiscImageChef.Core/Devices/Report/ATA.cs index 090a1a72d..a7234bee7 100644 --- a/DiscImageChef.Core/Devices/Report/ATA.cs +++ b/DiscImageChef.Core/Devices/Report/ATA.cs @@ -493,7 +493,9 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.ATA.WRVSectorCountMode2 = ataId.WRVSectorCountMode2; report.ATA.WRVSectorCountMode2Specified = true; } - + if(debug) + report.ATA.Identify = buffer; + if(removable) { List mediaTests = new List(); diff --git a/DiscImageChef.Core/Devices/Report/ATAPI.cs b/DiscImageChef.Core/Devices/Report/ATAPI.cs index 9ec42af62..7e11d1102 100644 --- a/DiscImageChef.Core/Devices/Report/ATAPI.cs +++ b/DiscImageChef.Core/Devices/Report/ATAPI.cs @@ -458,6 +458,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.ATAPI.WRVSectorCountMode2 = atapiId.WRVSectorCountMode2; report.ATAPI.WRVSectorCountMode2Specified = true; } + if(debug) + report.ATAPI.Identify = buffer; } } } diff --git a/DiscImageChef.Core/Devices/Report/SCSI/General.cs b/DiscImageChef.Core/Devices/Report/SCSI/General.cs index eb0c5e56a..cec28ccdf 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/General.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/General.cs @@ -181,6 +181,9 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.SCSI.Inquiry.SyncTransfer = inq.Sync; report.SCSI.Inquiry.WideBus16 = inq.WBus16; report.SCSI.Inquiry.WideBus32 = inq.WBus32; + + if(debug) + report.SCSI.Inquiry.Data = buffer; } DicConsole.WriteLine("Querying list of SCSI EVPDs..."); @@ -233,47 +236,52 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b Decoders.SCSI.PeripheralDeviceTypes devType = dev.SCSIType; DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)..."); - sense = dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Default, 0x3F, 0xFF, timeout, out duration); + sense = dev.ModeSense10(out byte[] mode10Buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Default, 0x3F, 0xFF, timeout, out duration); if(sense || dev.Error) { DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (10)..."); - sense = dev.ModeSense10(out buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Default, 0x3F, 0x00, timeout, out duration); + sense = dev.ModeSense10(out mode10Buffer, out senseBuffer, false, true, ScsiModeSensePageControl.Default, 0x3F, 0x00, timeout, out duration); if(!sense && dev.Error) { report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSubpages = false; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, devType); + decMode = Decoders.SCSI.Modes.DecodeMode10(mode10Buffer, devType); } } else { report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSubpages = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, devType); + decMode = Decoders.SCSI.Modes.DecodeMode10(mode10Buffer, devType); } DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)..."); - sense = dev.ModeSense6(out buffer, out senseBuffer, false, ScsiModeSensePageControl.Default, 0x3F, 0xFF, timeout, out duration); + sense = dev.ModeSense6(out byte[] mode6Buffer, out senseBuffer, false, ScsiModeSensePageControl.Default, 0x3F, 0xFF, timeout, out duration); if(sense || dev.Error) { DicConsole.WriteLine("Querying all mode pages using SCSI MODE SENSE (6)..."); - sense = dev.ModeSense6(out buffer, out senseBuffer, false, ScsiModeSensePageControl.Default, 0x3F, 0x00, timeout, out duration); + sense = dev.ModeSense6(out mode6Buffer, out senseBuffer, false, ScsiModeSensePageControl.Default, 0x3F, 0x00, timeout, out duration); if(sense || dev.Error) { DicConsole.WriteLine("Querying SCSI MODE SENSE (6)..."); - sense = dev.ModeSense(out buffer, out senseBuffer, timeout, out duration); + sense = dev.ModeSense(out mode6Buffer, out senseBuffer, timeout, out duration); } } else report.SCSI.SupportsModeSubpages = true; if(!sense && !dev.Error && !decMode.HasValue) - decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, devType); + decMode = Decoders.SCSI.Modes.DecodeMode6(mode6Buffer, devType); report.SCSI.SupportsModeSense6 |= (!sense && !dev.Error); Decoders.SCSI.Modes.ModePage_2A? cdromMode = null; + if(debug && report.SCSI.SupportsModeSense6) + report.SCSI.ModeSense6Data = mode6Buffer; + if(debug && report.SCSI.SupportsModeSense10) + report.SCSI.ModeSense10Data = mode10Buffer; + if(decMode.HasValue) { report.SCSI.ModeSense = new modeType(); @@ -320,7 +328,7 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) MMC.Report(dev, ref report, debug, ref cdromMode, ref mediaTypes); else if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess) - SSC.Report(dev, ref report); + SSC.Report(dev, ref report, debug); else { if(removable) @@ -438,6 +446,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b { report.SCSI.SupportsModeSense10 = true; decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType); + if(debug) + mediaTest.ModeSense10Data = buffer; } DicConsole.WriteLine("Querying SCSI MODE SENSE..."); @@ -447,6 +457,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.SCSI.SupportsModeSense6 = true; if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType); + if(debug) + mediaTest.ModeSense6Data = buffer; } if(decMode.HasValue) @@ -658,6 +670,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b { report.SCSI.SupportsModeSense10 = true; decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType); + if(debug) + report.SCSI.ReadCapabilities.ModeSense10Data = buffer; } DicConsole.WriteLine("Querying SCSI MODE SENSE..."); @@ -667,6 +681,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.SCSI.SupportsModeSense6 = true; if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType); + if(debug) + report.SCSI.ReadCapabilities.ModeSense10Data = buffer; } if(decMode.HasValue) diff --git a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs index ebd69e2f2..79cb569f7 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs @@ -844,6 +844,8 @@ internal static void Report(Device dev, ref DeviceReport report, bool debug, ref { report.SCSI.SupportsModeSense10 = true; decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType); + if(debug) + mediaTest.ModeSense10Data = buffer; } DicConsole.WriteLine("Querying SCSI MODE SENSE..."); sense = dev.ModeSense(out buffer, out senseBuffer, timeout, out duration); @@ -852,6 +854,8 @@ internal static void Report(Device dev, ref DeviceReport report, bool debug, ref report.SCSI.SupportsModeSense6 = true; if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType); + if(debug) + mediaTest.ModeSense6Data = buffer; } if(decMode.HasValue) diff --git a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs index 0e978a9df..0548120f0 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs @@ -45,7 +45,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { internal static class SSC { - internal static void Report(Device dev, ref DeviceReport report) + internal static void Report(Device dev, ref DeviceReport report, bool debug) { if(report == null) return; @@ -220,6 +220,8 @@ internal static void Report(Device dev, ref DeviceReport report) { report.SCSI.SupportsModeSense10 = true; decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType); + if(debug) + seqTest.ModeSense10Data = buffer; } DicConsole.WriteLine("Querying SCSI MODE SENSE..."); @@ -229,6 +231,8 @@ internal static void Report(Device dev, ref DeviceReport report) report.SCSI.SupportsModeSense6 = true; if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType); + if(debug) + seqTest.ModeSense6Data = buffer; } if(decMode.HasValue) diff --git a/DiscImageChef.Core/Devices/Report/USB.cs b/DiscImageChef.Core/Devices/Report/USB.cs index ffeac369c..30953f7d6 100644 --- a/DiscImageChef.Core/Devices/Report/USB.cs +++ b/DiscImageChef.Core/Devices/Report/USB.cs @@ -75,6 +75,8 @@ public static void Report(Device dev, ref DeviceReport report, bool debug, ref b report.USB.RemovableMedia = pressedKey.Key == ConsoleKey.Y; removable = report.USB.RemovableMedia; + if(debug) + report.USB.Descriptors = dev.USBDescriptors; } } } diff --git a/DiscImageChef.Metadata/DeviceReport.cs b/DiscImageChef.Metadata/DeviceReport.cs index dd18fcd77..86da8eefb 100644 --- a/DiscImageChef.Metadata/DeviceReport.cs +++ b/DiscImageChef.Metadata/DeviceReport.cs @@ -60,6 +60,7 @@ public class usbType public string Manufacturer { get; set; } public string Product { get; set; } public bool RemovableMedia { get; set; } + public byte[] Descriptors { get; set; } } public class firewireType @@ -154,10 +155,11 @@ public class ataType public uint WRVSectorCountMode3 { get; set; } public uint WRVSectorCountMode2 { get; set; } + public byte[] Identify { get; set; } + public testedMediaType ReadCapabilities { get; set; } public testedMediaType[] RemovableMedias { get; set; } - [XmlIgnore] public bool AdditionalPIDSpecified { get; set; } [XmlIgnore] @@ -339,6 +341,8 @@ public class scsiType public testedMediaType ReadCapabilities { get; set; } public testedMediaType[] RemovableMedias { get; set; } public sscType SequentialDevice { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } [XmlIgnore] public bool ReadCapabilitiesSpecified { get; set; } @@ -385,6 +389,7 @@ public class scsiInquiryType public ushort[] VersionDescriptors { get; set; } public bool WideBus16 { get; set; } public bool WideBus32 { get; set; } + public byte[] Data { get; set; } [XmlIgnore] public bool ANSIVersionSpecified { get; set; } @@ -750,6 +755,9 @@ public class testedMediaType public bool SupportsReadLong16 { get; set; } public bool SupportsReadLong { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + [XmlIgnore] public bool BlocksSpecified { get; set; } [XmlIgnore] @@ -995,6 +1003,9 @@ public struct SequentialMedia public SupportedDensity[] SupportedDensities { get; set; } public SupportedMedia[] SupportedMediaTypes { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + [XmlIgnore] public bool CanReadMediaSerialSpecified { get; set; } [XmlIgnore]