diff --git a/DiscImageChef.Decoders/ChangeLog b/DiscImageChef.Decoders/ChangeLog index 38475b23..7480ddad 100644 --- a/DiscImageChef.Decoders/ChangeLog +++ b/DiscImageChef.Decoders/ChangeLog @@ -1,3 +1,9 @@ +2015-11-02 Natalia Portillo + + * DiscImageChef.Decoders.csproj: + * SCSI/DiscStructureCapabilities.cs: + Added READ DISC STRUCTURE. + 2015-11-01 Natalia Portillo * SCSI/MMC/Features.cs: diff --git a/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj b/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj index 2514e0fe..29cc15cb 100644 --- a/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj +++ b/DiscImageChef.Decoders/DiscImageChef.Decoders.csproj @@ -81,6 +81,7 @@ + diff --git a/DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs b/DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs new file mode 100644 index 00000000..e7824b41 --- /dev/null +++ b/DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs @@ -0,0 +1,86 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : DiscStructureCapabilities.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using System.Collections.Generic; + +namespace DiscImageChef.Decoders.SCSI +{ + public static class DiscStructureCapabilities + { + public struct Capability + { + /// + /// READ/SEND DISC STRUCTURE format code + /// + public byte FormatCode; + /// + /// Supported in SEND DISC STRUCTURE + /// + public bool SDS; + /// + /// Supported in READ DISC STRUCTURE + /// + public bool RDS; + } + + public static Capability[] Decode(byte[] response) + { + ushort len = (ushort)((response[0] << 8) + response[1]); + + if (len + 2 != response.Length) + return null; + + List caps = new List(); + + uint offset = 4; + + while (offset < response.Length) + { + Capability cap = new Capability(); + cap.FormatCode = response[offset]; + cap.SDS = (response[offset + 1] & 0x80) == 0x80; + cap.RDS = (response[offset + 1] & 0x40) == 0x40; + caps.Add(cap); + offset += 4; + } + + return caps.ToArray(); + } + } +} + diff --git a/DiscImageChef.Devices/ChangeLog b/DiscImageChef.Devices/ChangeLog index 7571517c..7c6de823 100644 --- a/DiscImageChef.Devices/ChangeLog +++ b/DiscImageChef.Devices/ChangeLog @@ -1,3 +1,9 @@ +2015-11-02 Natalia Portillo + + * Enums.cs: + * Device/ScsiCommands.cs: + Added READ DISC STRUCTURE. + 2015-11-01 Natalia Portillo * Device/ScsiCommands.cs: diff --git a/DiscImageChef.Devices/Device/ScsiCommands.cs b/DiscImageChef.Devices/Device/ScsiCommands.cs index 89309d11..a810702b 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands.cs @@ -507,6 +507,45 @@ namespace DiscImageChef.Devices return sense; } + + public bool ReadDiscStructure(out byte[] buffer, out byte[] senseBuffer, MmcDiscStructureMediaType mediaType, uint address, byte layerNumber, MmcDiscStructureFormat format, byte AGID, uint timeout, out double duration) + { + senseBuffer = new byte[32]; + byte[] cdb = new byte[12]; + buffer = new byte[8]; + bool sense; + + cdb[0] = (byte)ScsiCommands.ReadDiscStructure; + cdb[1] = (byte)((byte)mediaType & 0x0F); + cdb[2] = (byte)((address & 0xFF000000) >> 24); + cdb[2] = (byte)((address & 0xFF0000) >> 16); + cdb[4] = (byte)((address & 0xFF00) >> 8); + cdb[5] = (byte)(address & 0xFF); + cdb[6] = layerNumber; + cdb[7] = (byte)format; + cdb[8] = (byte)((buffer.Length & 0xFF00) >> 8); + cdb[9] = (byte)(buffer.Length & 0xFF); + cdb[10] = (byte)((AGID & 0x03) << 6); + + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); + error = lastError != 0; + + if (sense) + return true; + + ushort strctLength = (ushort)(((int)buffer[0] << 8) + buffer[1] + 2); + buffer = new byte[strctLength]; + cdb[8] = (byte)((buffer.Length & 0xFF00) >> 8); + cdb[9] = (byte)(buffer.Length & 0xFF); + senseBuffer = new byte[32]; + + lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense); + error = lastError != 0; + + DicConsole.DebugWriteLine("SCSI Device", "READ DISC STRUCTURE took {0} ms.", duration); + + return sense; + } } } diff --git a/DiscImageChef.Devices/Enums.cs b/DiscImageChef.Devices/Enums.cs index cc54604c..3bd83990 100644 --- a/DiscImageChef.Devices/Enums.cs +++ b/DiscImageChef.Devices/Enums.cs @@ -2760,5 +2760,207 @@ namespace DiscImageChef.Devices Single = 0x02, Reserved = 0x03 } + + public enum MmcDiscStructureMediaType : byte + { + /// + /// Disc Structures for DVD and HD DVD + /// + DVD = 0x00, + /// + /// Disc Structures for BD + /// + BD = 0x01 + } + + public enum MmcDiscStructureFormat : byte + { + // Generic Format Codes + + /// + /// AACS Volume Identifier + /// + AACSVolId = 0x80, + /// + /// AACS Pre-recorded Media Serial Number + /// + AACSMediaSerial = 0x81, + /// + /// AACS Media Identifier + /// + AACSMediaId = 0x82, + /// + /// AACS Lead-in Media Key Block + /// + AACSMKB = 0x83, + /// + /// AACS Data Keys + /// + AACSDataKeys = 0x84, + /// + /// AACS LBA extents + /// + AACSLBAExtents = 0x85, + /// + /// CPRM Media Key Block specified by AACS + /// + AACSMKBCPRM = 0x86, + /// + /// Recognized format layers + /// + RecognizedFormatLayers = 0x90, + /// + /// Write protection status + /// + WriteProtectionStatus = 0xC0, + /// + /// READ/SEND DISC STRUCTURE capability list + /// + CapabilityList = 0xFF, + + // DVD Disc Structures + /// + /// DVD Lead-in Physical Information + /// + PhysicalInformation = 0x00, + /// + /// DVD Lead-in Copyright Information + /// + CopyrightInformation = 0x01, + /// + /// CSS/CPPM Disc key + /// + DiscKey = 0x02, + /// + /// DVD Burst Cutting Area + /// + BurstCuttingArea = 0x03, + /// + /// DVD Lead-in Disc Manufacturing Information + /// + DiscManufacturingInformation = 0x04, + /// + /// DVD Copyright Information from specified sector + /// + SectorCopyrightInformation = 0x05, + /// + /// CSS/CPPM Media Identifier + /// + MediaIdentifier = 0x06, + /// + /// CSS/CPPM Media Key Block + /// + MediaKeyBlock = 0x07, + /// + /// DDS from DVD-RAM + /// + DVDRAM_DDS = 0x08, + /// + /// DVD-RAM Medium Status + /// + DVDRAM_MediumStatus = 0x09, + /// + /// DVD-RAM Spare Area Information + /// + DVDRAM_SpareAreaInformation = 0x0A, + /// + /// DVD-RAM Recording Type Information + /// + DVDRAM_RecordingType = 0x0B, + /// + /// DVD-R/-RW RMD in last Border-out + /// + LastBorderOutRMD = 0x0C, + /// + /// Specified RMD from last recorded Border-out + /// + SpecifiedRMD = 0x0D, + /// + /// DVD-R/-RW Lead-in pre-recorded information + /// + PreRecordedInfo = 0x0E, + /// + /// DVD-R/-RW Media Identifier + /// + DVDR_MediaIdentifier = 0x0F, + /// + /// DVD-R/-RW Physical Format Information + /// + DVDR_PhysicalInformation = 0x10, + /// + /// ADIP + /// + ADIP = 0x11, + /// + /// HD DVD Lead-in Copyright Protection Information + /// + HDDVD_CopyrightInformation = 0x12, + /// + /// AACS Lead-in Copyright Data Section + /// + DVD_AACS = 0x15, + /// + /// HD DVD-R Medium Status + /// + HDDVDR_MediumStatus = 0x19, + /// + /// HD DVD-R Last recorded RMD in the latest RMZ + /// + HDDVDR_LastRMD = 0x1A, + /// + /// DVD+/-R DL and DVD-Download DL layer capacity + /// + DVDR_LayerCapacity = 0x20, + /// + /// DVD-R DL Middle Zone start address + /// + MiddleZoneStart = 0x21, + /// + /// DVD-R DL Jump Interval Size + /// + JumpIntervalSize = 0x22, + /// + /// DVD-R DL Start LBA of the manual layer jump + /// + ManualLayerJumpStartLBA = 0x23, + /// + /// DVD-R DL Remapping information of the specified Anchor Point + /// + RemapAnchorPoint = 0x24, + /// + /// Disc Control Block + /// + DCB = 0x30, + + // BD Disc Structures + /// + /// Blu-ray Disc Information + /// + DiscInformation = 0x00, + /// + /// Blu-ray Burst Cutting Area + /// + BD_BurstCuttingArea = 0x03, + /// + /// Blu-ray DDS + /// + BD_DDS = 0x08, + /// + /// Blu-ray Cartridge Status + /// + CartridgeStatus = 0x09, + /// + /// Blu-ray Spare Area Information + /// + BD_SpareAreaInformation = 0x0A, + /// + /// Unmodified DFL + /// + RawDFL = 0x12, + /// + /// Physical Access Control + /// + PAC = 0x30 + } } diff --git a/DiscImageChef/ChangeLog b/DiscImageChef/ChangeLog index 907b8686..1b9599f4 100644 --- a/DiscImageChef/ChangeLog +++ b/DiscImageChef/ChangeLog @@ -1,3 +1,8 @@ +2015-11-02 Natalia Portillo + + * Commands/DeviceInfo.cs: + Added READ DISC STRUCTURE. + 2015-11-01 Natalia Portillo * Commands/DeviceInfo.cs: diff --git a/DiscImageChef/Commands/DeviceInfo.cs b/DiscImageChef/Commands/DeviceInfo.cs index 81febe9d..59f6c000 100644 --- a/DiscImageChef/Commands/DeviceInfo.cs +++ b/DiscImageChef/Commands/DeviceInfo.cs @@ -449,208 +449,252 @@ namespace DiscImageChef.Commands if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) { - } + byte[] confBuf; + sense = dev.GetConfiguration(out confBuf, out senseBuf, dev.Timeout, out duration); - byte[] confBuf; - sense = dev.GetConfiguration(out confBuf, out senseBuf, dev.Timeout, out duration); - - if (!sense) - { - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(confBuf); - - DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength); - DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h", ftr.CurrentProfile); - if (ftr.Descriptors != null) + if (!sense) { - DicConsole.WriteLine("SCSI MMC GET CONFIGURATION Features:"); - foreach (Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) - { - DicConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code); + Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(confBuf); - switch (desc.Code) + DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength); + DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h", ftr.CurrentProfile); + if (ftr.Descriptors != null) + { + DicConsole.WriteLine("SCSI MMC GET CONFIGURATION Features:"); + foreach (Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) { - case 0x0000: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0000(desc.Data)); - break; - case 0x0001: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data)); - break; - case 0x0002: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data)); - break; - case 0x0003: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data)); - break; - case 0x0004: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data)); - break; - case 0x0010: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data)); - break; - case 0x001D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data)); - break; - case 0x001E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data)); - break; - case 0x001F: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data)); - break; - case 0x0020: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data)); - break; - case 0x0021: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data)); - break; - case 0x0022: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data)); - break; - case 0x0023: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data)); - break; - case 0x0024: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data)); - break; - case 0x0025: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data)); - break; - case 0x0026: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data)); - break; - case 0x0027: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data)); - break; - case 0x0028: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data)); - break; - case 0x0029: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data)); - break; - case 0x002A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data)); - break; - case 0x002B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data)); - break; - case 0x002C: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data)); - break; - case 0x002D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data)); - break; - case 0x002E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data)); - break; - case 0x002F: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data)); - break; - case 0x0030: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data)); - break; - case 0x0031: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data)); - break; - case 0x0032: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data)); - break; - case 0x0033: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data)); - break; - case 0x0035: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data)); - break; - case 0x0037: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data)); - break; - case 0x0038: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data)); - break; - case 0x003A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data)); - break; - case 0x003B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data)); - break; - case 0x0040: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data)); - break; - case 0x0041: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data)); - break; - case 0x0042: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data)); - break; - case 0x0050: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data)); - break; - case 0x0051: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data)); - break; - case 0x0080: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data)); - break; - case 0x0100: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data)); - break; - case 0x0101: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data)); - break; - case 0x0102: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data)); - break; - case 0x0103: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data)); - break; - case 0x0104: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data)); - break; - case 0x0105: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data)); - break; - case 0x0106: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data)); - break; - case 0x0107: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data)); - break; - case 0x0108: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data)); - break; - case 0x0109: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data)); - break; - case 0x010A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data)); - break; - case 0x010B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data)); - break; - case 0x010C: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data)); - break; - case 0x010D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data)); - break; - case 0x010E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data)); - break; - case 0x0110: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data)); - break; - case 0x0113: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data)); - break; - case 0x0142: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data)); - break; - default: - DicConsole.WriteLine("Found unknown feature code {0:X4}h", desc.Code); - break; + DicConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code); + + switch (desc.Code) + { + case 0x0000: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0000(desc.Data)); + break; + case 0x0001: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data)); + break; + case 0x0002: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data)); + break; + case 0x0003: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data)); + break; + case 0x0004: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data)); + break; + case 0x0010: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data)); + break; + case 0x001D: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data)); + break; + case 0x001E: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data)); + break; + case 0x001F: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data)); + break; + case 0x0020: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data)); + break; + case 0x0021: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data)); + break; + case 0x0022: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data)); + break; + case 0x0023: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data)); + break; + case 0x0024: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data)); + break; + case 0x0025: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data)); + break; + case 0x0026: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data)); + break; + case 0x0027: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data)); + break; + case 0x0028: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data)); + break; + case 0x0029: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data)); + break; + case 0x002A: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data)); + break; + case 0x002B: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data)); + break; + case 0x002C: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data)); + break; + case 0x002D: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data)); + break; + case 0x002E: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data)); + break; + case 0x002F: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data)); + break; + case 0x0030: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data)); + break; + case 0x0031: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data)); + break; + case 0x0032: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data)); + break; + case 0x0033: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data)); + break; + case 0x0035: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data)); + break; + case 0x0037: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data)); + break; + case 0x0038: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data)); + break; + case 0x003A: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data)); + break; + case 0x003B: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data)); + break; + case 0x0040: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data)); + break; + case 0x0041: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data)); + break; + case 0x0042: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data)); + break; + case 0x0050: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data)); + break; + case 0x0051: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data)); + break; + case 0x0080: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data)); + break; + case 0x0100: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data)); + break; + case 0x0101: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data)); + break; + case 0x0102: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data)); + break; + case 0x0103: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data)); + break; + case 0x0104: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data)); + break; + case 0x0105: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data)); + break; + case 0x0106: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data)); + break; + case 0x0107: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data)); + break; + case 0x0108: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data)); + break; + case 0x0109: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data)); + break; + case 0x010A: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data)); + break; + case 0x010B: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data)); + break; + case 0x010C: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data)); + break; + case 0x010D: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data)); + break; + case 0x010E: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data)); + break; + case 0x0110: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data)); + break; + case 0x0113: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data)); + break; + case 0x0142: + DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data)); + break; + default: + DicConsole.WriteLine("Found unknown feature code {0:X4}h", desc.Code); + break; + } + } + } + else + DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors"); + } + + // TODO: DVD drives respond correctly to BD status. + // While specification says if no medium is present + // it should inform all possible capabilities, + // testing drives show only supported media capabilities. + /* + byte[] strBuf; + sense = dev.ReadDiscStructure(out strBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.CapabilityList, 0, dev.Timeout, out duration); + + if (!sense) + { + Decoders.SCSI.DiscStructureCapabilities.Capability[] caps = Decoders.SCSI.DiscStructureCapabilities.Decode(strBuf); + if (caps != null) + { + foreach (Decoders.SCSI.DiscStructureCapabilities.Capability cap in caps) + { + if (cap.SDS && cap.RDS) + DicConsole.WriteLine("Drive can READ/SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode); + else if (cap.SDS) + DicConsole.WriteLine("Drive can SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode); + else if (cap.RDS) + DicConsole.WriteLine("Drive can READ DISC STRUCTURE format {0:X2}h", cap.FormatCode); } } } - else - DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors"); + + sense = dev.ReadDiscStructure(out strBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.CapabilityList, 0, dev.Timeout, out duration); + + if (!sense) + { + Decoders.SCSI.DiscStructureCapabilities.Capability[] caps = Decoders.SCSI.DiscStructureCapabilities.Decode(strBuf); + if (caps != null) + { + foreach (Decoders.SCSI.DiscStructureCapabilities.Capability cap in caps) + { + if (cap.SDS && cap.RDS) + DicConsole.WriteLine("Drive can READ/SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode); + else if (cap.SDS) + DicConsole.WriteLine("Drive can SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode); + else if (cap.RDS) + DicConsole.WriteLine("Drive can READ DISC STRUCTURE format {0:X2}h", cap.FormatCode); + } + } + } + */ } break;