From 07f895c4b5ec04a642ff5a6d279d41346f704878 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 31 Oct 2015 03:36:01 +0000 Subject: [PATCH] Added information from ANSI X3.304-1997 (MMC-1). --- ChangeLog | 5 +++++ SCSI/Modes.cs | 60 ++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e40b9a..5d2901e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-31 Natalia Portillo + + * SCSI/Modes.cs: + Added information from ANSI X3.304-1997 (MMC-1). + 2015-10-31 Natalia Portillo * SCSI/Modes.cs: diff --git a/SCSI/Modes.cs b/SCSI/Modes.cs index 8d88dcd..d4ca89e 100644 --- a/SCSI/Modes.cs +++ b/SCSI/Modes.cs @@ -2875,7 +2875,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// Device configuration page /// Page code 0x10 - /// 16 bytes in SCSI-2, SSC-1, SSC-2 + /// 16 bytes in SCSI-2, SSC-1, SSC-2, SSC-3 /// public struct ModePage_10_SSC { @@ -2984,6 +2984,15 @@ namespace DiscImageChef.Decoders.SCSI public bool BAML; public bool BAM; public byte RewindOnReset; + + /// + /// How drive shall respond to detection of compromised WORM medium integrity + /// + public byte WTRE; + /// + /// Respond to commands only if a reservation exists + /// + public bool OIR; } public static ModePage_10_SSC? DecodeModePage_10_SSC(byte[] pageResponse) @@ -3035,6 +3044,9 @@ namespace DiscImageChef.Decoders.SCSI decoded.RewindOnReset = (byte)((pageResponse[15] & 0x18) >> 3); + decoded.OIR |= (pageResponse[15] & 0x20) == 0x20; + decoded.WTRE = (byte)((pageResponse[15] & 0xC0) >> 6); + return decoded; } @@ -3167,6 +3179,19 @@ namespace DiscImageChef.Decoders.SCSI break; } + switch (page.WTRE) + { + case 1: + sb.AppendLine("\tDrive will do nothing on WORM tampered medium"); + break; + case 2: + sb.AppendLine("\tDrive will return CHECK CONDITION on WORM tampered medium"); + break; + } + + if (page.OIR) + sb.AppendLine("\tDrive will only respond to commands if it has received a reservation"); + return sb.ToString(); } #endregion Mode Page 0x10: Device configuration page @@ -3175,7 +3200,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// CD-ROM audio control parameters /// Page code 0x0E - /// 16 bytes in SCSI-2 + /// 16 bytes in SCSI-2, MMC-1 /// public struct ModePage_0E { @@ -3421,7 +3446,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// CD-ROM parameteres page /// Page code 0x0D - /// 8 bytes in SCSI-2 + /// 8 bytes in SCSI-2, MMC-1 /// public struct ModePage_0D { @@ -3552,7 +3577,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// Read error recovery page for MultiMedia Devices /// Page code 0x01 - /// 8 bytes in SCSI-2 + /// 8 bytes in SCSI-2, MMC-1 /// public struct ModePage_01_MMC { @@ -3700,7 +3725,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// Verify error recovery page for MultiMedia Devices /// Page code 0x07 - /// 8 bytes in SCSI-2 + /// 8 bytes in SCSI-2, MMC-1 /// public struct ModePage_07_MMC { @@ -3917,6 +3942,7 @@ namespace DiscImageChef.Decoders.SCSI /// Page code 0x2A /// 16 bytes in OB-U0077C /// 20 bytes in SFF-8020i + /// 22 bytes in MMC-1 /// public struct ModePage_2A { @@ -4027,6 +4053,10 @@ namespace DiscImageChef.Decoders.SCSI public bool LSBF; public bool RCK; public bool BCK; + + public bool TestWrite; + public ushort MaxWriteSpeed; + public ushort CurrentWriteSpeed; } public static ModePage_2A? DecodeModePage_2A(byte[] pageResponse) @@ -4099,6 +4129,13 @@ namespace DiscImageChef.Decoders.SCSI decoded.RCK |= (pageResponse[17] & 0x04) == 0x04; decoded.BCK |= (pageResponse[17] & 0x02) == 0x02; + if (pageResponse.Length < 22) + return decoded; + + decoded.TestWrite |= (pageResponse[3] & 0x04) == 0x04; + decoded.MaxWriteSpeed = (ushort)((pageResponse[18] << 8) + pageResponse[19]); + decoded.CurrentWriteSpeed = (ushort)((pageResponse[20] << 8) + pageResponse[21]); + return decoded; } @@ -4196,9 +4233,9 @@ namespace DiscImageChef.Decoders.SCSI if(page.BufferSize > 0) sb.AppendFormat("\tDrive has {0} Kbyte of buffer", page.BufferSize).AppendLine(); if (page.MaximumSpeed > 0) - sb.AppendFormat("\tDrive's maximum speed is {0} Kbyte/sec.", page.MaximumSpeed).AppendLine(); + sb.AppendFormat("\tDrive's maximum reading speed is {0} Kbyte/sec.", page.MaximumSpeed).AppendLine(); if (page.CurrentSpeed > 0) - sb.AppendFormat("\tDrive's current speed is {0} Kbyte/sec.", page.CurrentSpeed).AppendLine(); + sb.AppendFormat("\tDrive's current reading speed is {0} Kbyte/sec.", page.CurrentSpeed).AppendLine(); if (page.ReadCDR) { @@ -4229,6 +4266,13 @@ namespace DiscImageChef.Decoders.SCSI if (page.SDP) sb.AppendLine("\tDrive contains a changer that can report the exact contents of the slots"); + if (page.MaxWriteSpeed > 0) + sb.AppendFormat("\tDrive's maximum writing speed is {0} Kbyte/sec.", page.MaxWriteSpeed).AppendLine(); + if (page.CurrentWriteSpeed > 0) + sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec.", page.CurrentWriteSpeed).AppendLine(); + if (page.TestWrite) + sb.AppendLine("\tDrive supports test writing"); + return sb.ToString(); } #endregion Mode Page 0x2A: CD-ROM capabilities page @@ -5015,7 +5059,7 @@ namespace DiscImageChef.Decoders.SCSI /// /// Data compression page /// Page code 0x0F - /// 16 bytes in SSC-1, SSC-2 + /// 16 bytes in SSC-1, SSC-2, SSC-3 /// public struct ModePage_0F {