mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: All refactor in DiscImageChef.Decoders.
This commit is contained in:
@@ -31,9 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class DiscStructureCapabilities
|
||||
{
|
||||
public struct Capability
|
||||
@@ -64,10 +69,12 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
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;
|
||||
Capability cap = new Capability
|
||||
{
|
||||
FormatCode = response[offset],
|
||||
SDS = (response[offset + 1] & 0x80) == 0x80,
|
||||
RDS = (response[offset + 1] & 0x40) == 0x40
|
||||
};
|
||||
caps.Add(cap);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
442
SCSI/EVPD.cs
442
SCSI/EVPD.cs
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -39,6 +40,11 @@ using DiscImageChef.Decoders.ATA;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public static class EVPD
|
||||
{
|
||||
/// <summary>
|
||||
@@ -48,9 +54,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x00.</param>
|
||||
public static byte[] DecodePage00(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0) return null;
|
||||
if(page?[1] != 0) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -88,9 +92,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x80.</param>
|
||||
public static string DecodePage80(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0x80) return null;
|
||||
if(page?[1] != 0x80) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -140,21 +142,20 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_81? DecodePage_81(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x81) return null;
|
||||
if(pageResponse?[1] != 0x81) return null;
|
||||
|
||||
if(pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 6) return null;
|
||||
|
||||
Page_81 decoded = new Page_81();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
decoded.Current = (ScsiDefinitions)(pageResponse[4] & 0x7F);
|
||||
decoded.Default = (ScsiDefinitions)(pageResponse[5] & 0x7F);
|
||||
Page_81 decoded = new Page_81
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
Current = (ScsiDefinitions)(pageResponse[4] & 0x7F),
|
||||
Default = (ScsiDefinitions)(pageResponse[5] & 0x7F)
|
||||
};
|
||||
|
||||
int position = 6;
|
||||
List<ScsiDefinitions> definitions = new List<ScsiDefinitions>();
|
||||
@@ -222,9 +223,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// <param name="page">Page 0x82.</param>
|
||||
public static string DecodePage82(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0x82) return null;
|
||||
if(page?[1] != 0x82) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -378,32 +377,34 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_83? DecodePage_83(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x83) return null;
|
||||
if(pageResponse?[1] != 0x83) return null;
|
||||
|
||||
if(pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 6) return null;
|
||||
|
||||
Page_83 decoded = new Page_83();
|
||||
Page_83 decoded = new Page_83
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
int position = 4;
|
||||
List<IdentificatonDescriptor> descriptors = new List<IdentificatonDescriptor>();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
IdentificatonDescriptor descriptor = new IdentificatonDescriptor();
|
||||
descriptor.ProtocolIdentifier = (ProtocolIdentifiers)((pageResponse[position] & 0xF0) >> 4);
|
||||
descriptor.CodeSet = (IdentificationCodeSet)(pageResponse[position] & 0x0F);
|
||||
descriptor.PIV |= (pageResponse[position + 1] & 0x80) == 0x80;
|
||||
descriptor.Association = (IdentificationAssociation)((pageResponse[position + 1] & 0x30) >> 4);
|
||||
descriptor.Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F);
|
||||
descriptor.Length = pageResponse[position + 3];
|
||||
IdentificatonDescriptor descriptor = new IdentificatonDescriptor
|
||||
{
|
||||
ProtocolIdentifier = (ProtocolIdentifiers)((pageResponse[position] & 0xF0) >> 4),
|
||||
CodeSet = (IdentificationCodeSet)(pageResponse[position] & 0x0F),
|
||||
PIV = (pageResponse[position + 1] & 0x80) == 0x80,
|
||||
Association = (IdentificationAssociation)((pageResponse[position + 1] & 0x30) >> 4),
|
||||
Type = (IdentificationTypes)(pageResponse[position + 1] & 0x0F),
|
||||
Length = pageResponse[position + 3]
|
||||
};
|
||||
descriptor.Binary = new byte[descriptor.Length];
|
||||
if(descriptor.Length + position + 4 >= pageResponse.Length)
|
||||
descriptor.Length = (byte)(pageResponse.Length - position - 4);
|
||||
@@ -534,6 +535,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
(byte)descriptor.CodeSet).AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case IdentificationTypes.Inquiry:
|
||||
switch(descriptor.CodeSet) {
|
||||
@@ -550,6 +552,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
(byte)descriptor.CodeSet).AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case IdentificationTypes.EUI:
|
||||
if(descriptor.CodeSet == IdentificationCodeSet.ASCII ||
|
||||
@@ -782,27 +785,26 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_84? DecodePage_84(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x84) return null;
|
||||
if(pageResponse?[1] != 0x84) return null;
|
||||
|
||||
if(pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 10) return null;
|
||||
|
||||
Page_84 decoded = new Page_84();
|
||||
Page_84 decoded = new Page_84
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
int position = 4;
|
||||
List<SoftwareIdentifier> identifiers = new List<SoftwareIdentifier>();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
SoftwareIdentifier identifier = new SoftwareIdentifier();
|
||||
identifier.Identifier = new byte[6];
|
||||
SoftwareIdentifier identifier = new SoftwareIdentifier {Identifier = new byte[6]};
|
||||
Array.Copy(pageResponse, position, identifier.Identifier, 0, 6);
|
||||
identifiers.Add(identifier);
|
||||
position += 6;
|
||||
@@ -909,29 +911,31 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_85? DecodePage_85(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x85) return null;
|
||||
if(pageResponse?[1] != 0x85) return null;
|
||||
|
||||
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 4) return null;
|
||||
|
||||
Page_85 decoded = new Page_85();
|
||||
Page_85 decoded = new Page_85
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
|
||||
|
||||
int position = 4;
|
||||
List<NetworkDescriptor> descriptors = new List<NetworkDescriptor>();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
NetworkDescriptor descriptor = new NetworkDescriptor();
|
||||
descriptor.Association = (IdentificationAssociation)((pageResponse[position] & 0x60) >> 5);
|
||||
descriptor.Type = (NetworkServiceTypes)(pageResponse[position] & 0x1F);
|
||||
descriptor.Length = (ushort)((pageResponse[position + 2] << 8) + pageResponse[position + 3]);
|
||||
NetworkDescriptor descriptor = new NetworkDescriptor
|
||||
{
|
||||
Association = (IdentificationAssociation)((pageResponse[position] & 0x60) >> 5),
|
||||
Type = (NetworkServiceTypes)(pageResponse[position] & 0x1F),
|
||||
Length = (ushort)((pageResponse[position + 2] << 8) + pageResponse[position + 3])
|
||||
};
|
||||
descriptor.Address = new byte[descriptor.Length];
|
||||
Array.Copy(pageResponse, position + 4, descriptor.Address, 0, descriptor.Length);
|
||||
|
||||
@@ -1164,49 +1168,45 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_86? DecodePage_86(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x86) return null;
|
||||
if(pageResponse?[1] != 0x86) return null;
|
||||
|
||||
if(pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 64) return null;
|
||||
|
||||
Page_86 decoded = new Page_86();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.ActivateMicrocode = (byte)((pageResponse[4] & 0xC0) >> 6);
|
||||
decoded.SPT = (byte)((pageResponse[4] & 0x38) >> 3);
|
||||
decoded.GRD_CHK |= (pageResponse[4] & 0x04) == 0x04;
|
||||
decoded.APP_CHK |= (pageResponse[4] & 0x02) == 0x02;
|
||||
decoded.REF_CHK |= (pageResponse[4] & 0x01) == 0x01;
|
||||
decoded.UASK_SUP |= (pageResponse[5] & 0x20) == 0x20;
|
||||
decoded.GROUP_SUP |= (pageResponse[5] & 0x10) == 0x10;
|
||||
decoded.PRIOR_SUP |= (pageResponse[5] & 0x08) == 0x08;
|
||||
decoded.HEADSUP |= (pageResponse[5] & 0x04) == 0x04;
|
||||
decoded.ORDSUP |= (pageResponse[5] & 0x02) == 0x02;
|
||||
decoded.SIMPSUP |= (pageResponse[5] & 0x01) == 0x01;
|
||||
decoded.WU_SUP |= (pageResponse[6] & 0x08) == 0x08;
|
||||
decoded.CRD_SUP |= (pageResponse[6] & 0x04) == 0x04;
|
||||
decoded.NV_SUP |= (pageResponse[6] & 0x02) == 0x02;
|
||||
decoded.V_SUP |= (pageResponse[6] & 0x01) == 0x01;
|
||||
decoded.NO_PI_CHK |= (pageResponse[7] & 0x20) == 0x20;
|
||||
decoded.P_I_I_SUP |= (pageResponse[7] & 0x10) == 0x10;
|
||||
decoded.LUICLR |= (pageResponse[7] & 0x01) == 0x01;
|
||||
decoded.R_SUP |= (pageResponse[8] & 0x10) == 0x10;
|
||||
decoded.HSSRELEF |= (pageResponse[8] & 0x02) == 0x02;
|
||||
decoded.CBCS |= (pageResponse[8] & 0x01) == 0x01;
|
||||
decoded.Nexus = (byte)(pageResponse[9] & 0x0F);
|
||||
decoded.ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]);
|
||||
decoded.POA_SUP |= (pageResponse[12] & 0x80) == 0x80;
|
||||
decoded.HRA_SUP |= (pageResponse[12] & 0x40) == 0x40;
|
||||
decoded.VSA_SUP |= (pageResponse[12] & 0x20) == 0x20;
|
||||
decoded.MaximumSenseLength = pageResponse[13];
|
||||
|
||||
return decoded;
|
||||
return new Page_86
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
ActivateMicrocode = (byte)((pageResponse[4] & 0xC0) >> 6),
|
||||
SPT = (byte)((pageResponse[4] & 0x38) >> 3),
|
||||
GRD_CHK = (pageResponse[4] & 0x04) == 0x04,
|
||||
APP_CHK = (pageResponse[4] & 0x02) == 0x02,
|
||||
REF_CHK = (pageResponse[4] & 0x01) == 0x01,
|
||||
UASK_SUP = (pageResponse[5] & 0x20) == 0x20,
|
||||
GROUP_SUP = (pageResponse[5] & 0x10) == 0x10,
|
||||
PRIOR_SUP = (pageResponse[5] & 0x08) == 0x08,
|
||||
HEADSUP = (pageResponse[5] & 0x04) == 0x04,
|
||||
ORDSUP = (pageResponse[5] & 0x02) == 0x02,
|
||||
SIMPSUP = (pageResponse[5] & 0x01) == 0x01,
|
||||
WU_SUP = (pageResponse[6] & 0x08) == 0x08,
|
||||
CRD_SUP = (pageResponse[6] & 0x04) == 0x04,
|
||||
NV_SUP = (pageResponse[6] & 0x02) == 0x02,
|
||||
V_SUP = (pageResponse[6] & 0x01) == 0x01,
|
||||
NO_PI_CHK = (pageResponse[7] & 0x20) == 0x20,
|
||||
P_I_I_SUP = (pageResponse[7] & 0x10) == 0x10,
|
||||
LUICLR = (pageResponse[7] & 0x01) == 0x01,
|
||||
R_SUP = (pageResponse[8] & 0x10) == 0x10,
|
||||
HSSRELEF = (pageResponse[8] & 0x02) == 0x02,
|
||||
CBCS = (pageResponse[8] & 0x01) == 0x01,
|
||||
Nexus = (byte)(pageResponse[9] & 0x0F),
|
||||
ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]),
|
||||
POA_SUP = (pageResponse[12] & 0x80) == 0x80,
|
||||
HRA_SUP = (pageResponse[12] & 0x40) == 0x40,
|
||||
VSA_SUP = (pageResponse[12] & 0x20) == 0x20,
|
||||
MaximumSenseLength = pageResponse[13]
|
||||
};
|
||||
}
|
||||
|
||||
public static string PrettifyPage_86(byte[] pageResponse)
|
||||
@@ -1254,6 +1254,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
.AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case PeripheralDeviceTypes.SequentialAccess when page.SPT == 1: sb.AppendLine("Logical unit supports logical block protection");
|
||||
break;
|
||||
@@ -1346,25 +1347,23 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_89? DecodePage_89(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0x89) return null;
|
||||
if(pageResponse?[1] != 0x89) return null;
|
||||
|
||||
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 572) return null;
|
||||
|
||||
Page_89 decoded = new Page_89();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
|
||||
|
||||
decoded.VendorIdentification = new byte[8];
|
||||
decoded.ProductIdentification = new byte[16];
|
||||
decoded.ProductRevisionLevel = new byte[4];
|
||||
decoded.Signature = new byte[20];
|
||||
decoded.IdentifyData = new byte[512];
|
||||
Page_89 decoded = new Page_89
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
|
||||
VendorIdentification = new byte[8],
|
||||
ProductIdentification = new byte[16],
|
||||
ProductRevisionLevel = new byte[4],
|
||||
Signature = new byte[20],
|
||||
IdentifyData = new byte[512]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 8, decoded.VendorIdentification, 0, 8);
|
||||
Array.Copy(pageResponse, 8, decoded.ProductIdentification, 0, 16);
|
||||
@@ -1478,25 +1477,25 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_C0_Quantum? DecodePage_C0_Quantum(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xC0) return null;
|
||||
if(pageResponse?[1] != 0xC0) return null;
|
||||
|
||||
if(pageResponse[3] != 20) return null;
|
||||
|
||||
if(pageResponse.Length != 36) return null;
|
||||
|
||||
Page_C0_Quantum decoded = new Page_C0_Quantum();
|
||||
Page_C0_Quantum decoded = new Page_C0_Quantum
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
ServoFirmwareChecksum = (ushort)((pageResponse[4] << 8) + pageResponse[5]),
|
||||
ServoEEPROMChecksum = (ushort)((pageResponse[6] << 8) + pageResponse[7]),
|
||||
ReadWriteFirmwareChecksum =
|
||||
(uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) +
|
||||
pageResponse[11]),
|
||||
ReadWriteFirmwareBuildData = new byte[24]
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.ServoFirmwareChecksum = (ushort)((pageResponse[4] << 8) + pageResponse[5]);
|
||||
decoded.ServoEEPROMChecksum = (ushort)((pageResponse[6] << 8) + pageResponse[7]);
|
||||
decoded.ReadWriteFirmwareChecksum = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) +
|
||||
(pageResponse[10] << 8) + pageResponse[11]);
|
||||
decoded.ReadWriteFirmwareBuildData = new byte[24];
|
||||
Array.Copy(pageResponse, 12, decoded.ReadWriteFirmwareBuildData, 0, 24);
|
||||
|
||||
return decoded;
|
||||
@@ -1565,16 +1564,16 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(pageResponse.Length != 96) return null;
|
||||
|
||||
Page_C0_C1_Certance decoded = new Page_C0_C1_Certance();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.Component = new byte[26];
|
||||
decoded.Version = new byte[19];
|
||||
decoded.Date = new byte[24];
|
||||
decoded.Variant = new byte[23];
|
||||
Page_C0_C1_Certance decoded = new Page_C0_C1_Certance
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
Component = new byte[26],
|
||||
Version = new byte[19],
|
||||
Date = new byte[24],
|
||||
Variant = new byte[23]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.Component, 0, 26);
|
||||
Array.Copy(pageResponse, 30, decoded.Version, 0, 19);
|
||||
@@ -1644,13 +1643,14 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(pageResponse.Length != 16) return null;
|
||||
|
||||
Page_C2_C3_C4_C5_C6_Certance decoded = new Page_C2_C3_C4_C5_C6_Certance();
|
||||
Page_C2_C3_C4_C5_C6_Certance decoded = new Page_C2_C3_C4_C5_C6_Certance
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
SerialNumber = new byte[12]
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.SerialNumber = new byte[12];
|
||||
Array.Copy(pageResponse, 4, decoded.SerialNumber, 0, 12);
|
||||
|
||||
return decoded;
|
||||
@@ -1789,41 +1789,38 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_DF_Certance? DecodePage_DF_Certance(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xDF) return null;
|
||||
if(pageResponse?[1] != 0xDF) return null;
|
||||
|
||||
if(pageResponse[3] != 60) return null;
|
||||
|
||||
if(pageResponse.Length != 64) return null;
|
||||
|
||||
Page_DF_Certance decoded = new Page_DF_Certance();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.CmdFwd = (byte)((pageResponse[5] & 0xC0) >> 5);
|
||||
decoded.Alerts |= (pageResponse[5] & 0x20) == 0x20;
|
||||
decoded.NoRemov |= (pageResponse[5] & 0x08) == 0x08;
|
||||
decoded.UnitRsvd |= (pageResponse[5] & 0x04) == 0x04;
|
||||
decoded.Clean |= (pageResponse[5] & 0x01) == 0x01;
|
||||
decoded.Threaded |= (pageResponse[6] & 0x10) == 0x10;
|
||||
decoded.Lun1Cmd |= (pageResponse[6] & 0x08) == 0x08;
|
||||
decoded.AutoloadMode = (byte)(pageResponse[6] & 0x07);
|
||||
decoded.CartridgeType = pageResponse[8];
|
||||
decoded.CartridgeFormat = pageResponse[9];
|
||||
decoded.CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4);
|
||||
decoded.PortATransportType = pageResponse[12];
|
||||
decoded.PortASelectionID = pageResponse[15];
|
||||
decoded.OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) +
|
||||
(pageResponse[22] << 8) + pageResponse[23]);
|
||||
Page_DF_Certance decoded = new Page_DF_Certance
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
CmdFwd = (byte)((pageResponse[5] & 0xC0) >> 5),
|
||||
Alerts = (pageResponse[5] & 0x20) == 0x20,
|
||||
NoRemov = (pageResponse[5] & 0x08) == 0x08,
|
||||
UnitRsvd = (pageResponse[5] & 0x04) == 0x04,
|
||||
Clean = (pageResponse[5] & 0x01) == 0x01,
|
||||
Threaded = (pageResponse[6] & 0x10) == 0x10,
|
||||
Lun1Cmd = (pageResponse[6] & 0x08) == 0x08,
|
||||
AutoloadMode = (byte)(pageResponse[6] & 0x07),
|
||||
CartridgeType = pageResponse[8],
|
||||
CartridgeFormat = pageResponse[9],
|
||||
CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4),
|
||||
PortATransportType = pageResponse[12],
|
||||
PortASelectionID = pageResponse[15],
|
||||
OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) +
|
||||
pageResponse[23]),
|
||||
CartridgeSerialNumber = new byte[32]
|
||||
};
|
||||
|
||||
byte[] buf = new byte[8];
|
||||
Array.Copy(pageResponse, 24, buf, 0, 8);
|
||||
decoded.InitiatorID = BitConverter.ToUInt64(buf.Reverse().ToArray(), 0);
|
||||
|
||||
decoded.CartridgeSerialNumber = new byte[32];
|
||||
Array.Copy(pageResponse, 32, decoded.CartridgeSerialNumber, 0, 32);
|
||||
|
||||
return decoded;
|
||||
@@ -1984,22 +1981,22 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_C0_IBM? DecodePage_C0_IBM(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xC0) return null;
|
||||
if(pageResponse?[1] != 0xC0) return null;
|
||||
|
||||
if(pageResponse[3] != 39) return null;
|
||||
|
||||
if(pageResponse.Length != 43) return null;
|
||||
|
||||
Page_C0_IBM decoded = new Page_C0_IBM();
|
||||
Page_C0_IBM decoded = new Page_C0_IBM
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
CodeName = new byte[12],
|
||||
Date = new byte[8]
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.CodeName = new byte[12];
|
||||
decoded.Date = new byte[8];
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.CodeName, 0, 12);
|
||||
Array.Copy(pageResponse, 23, decoded.Date, 0, 8);
|
||||
@@ -2057,22 +2054,20 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_C1_IBM? DecodePage_C1_IBM(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xC1) return null;
|
||||
if(pageResponse?[1] != 0xC1) return null;
|
||||
|
||||
if(pageResponse[3] != 24) return null;
|
||||
|
||||
if(pageResponse.Length != 28) return null;
|
||||
|
||||
Page_C1_IBM decoded = new Page_C1_IBM();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
|
||||
decoded.ManufacturingSerial = new byte[12];
|
||||
decoded.ReportedSerial = new byte[12];
|
||||
Page_C1_IBM decoded = new Page_C1_IBM
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
ManufacturingSerial = new byte[12],
|
||||
ReportedSerial = new byte[12]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.ManufacturingSerial, 0, 12);
|
||||
Array.Copy(pageResponse, 16, decoded.ReportedSerial, 0, 12);
|
||||
@@ -2132,22 +2127,20 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_B0? DecodePage_B0(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xB0) return null;
|
||||
if(pageResponse?[1] != 0xB0) return null;
|
||||
|
||||
if((pageResponse[2] << 8) + pageResponse[3] + 4 != pageResponse.Length) return null;
|
||||
|
||||
if(pageResponse.Length < 5) return null;
|
||||
|
||||
Page_B0 decoded = new Page_B0();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4);
|
||||
|
||||
decoded.TSMC = (pageResponse[4] & 0x02) == 0x02;
|
||||
decoded.WORM = (pageResponse[4] & 0x01) == 0x01;
|
||||
Page_B0 decoded = new Page_B0
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
|
||||
TSMC = (pageResponse[4] & 0x02) == 0x02,
|
||||
WORM = (pageResponse[4] & 0x01) == 0x01
|
||||
};
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2176,9 +2169,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
#region EVPD Page 0xB1: Manufacturer-assigned Serial Number page
|
||||
public static string DecodePageB1(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0xB1) return null;
|
||||
if(page?[1] != 0xB1) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -2193,9 +2184,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
#region EVPD Page 0xB2: TapeAlert Supported Flags page
|
||||
public static ulong DecodePageB2(byte[] page)
|
||||
{
|
||||
if(page == null) return 0;
|
||||
|
||||
if(page[1] != 0xB2) return 0;
|
||||
if(page?[1] != 0xB2) return 0;
|
||||
|
||||
if(page.Length != 12) return 0;
|
||||
|
||||
@@ -2210,9 +2199,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
#region EVPD Page 0xB3: Automation Device Serial Number page
|
||||
public static string DecodePageB3(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0xB3) return null;
|
||||
if(page?[1] != 0xB3) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -2227,9 +2214,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
#region EVPD Page 0xB4: Data Transfer Device Element Address page
|
||||
public static string DecodePageB4(byte[] page)
|
||||
{
|
||||
if(page == null) return null;
|
||||
|
||||
if(page[1] != 0xB3) return null;
|
||||
if(page?[1] != 0xB3) return null;
|
||||
|
||||
if(page.Length != page[3] + 4) return null;
|
||||
|
||||
@@ -2280,12 +2265,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(pageResponse.Length < 4) return null;
|
||||
|
||||
Page_C0_to_C5_HP decoded = new Page_C0_to_C5_HP();
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
decoded.PageCode = pageResponse[1];
|
||||
Page_C0_to_C5_HP decoded = new Page_C0_to_C5_HP
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
PageCode = pageResponse[1]
|
||||
};
|
||||
|
||||
if(pageResponse[3] == 92 && pageResponse.Length >= 96)
|
||||
{
|
||||
@@ -2305,24 +2291,20 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(pageResponse[4] != pageResponse[3] - 1) return null;
|
||||
|
||||
List<byte> array = new List<byte>();
|
||||
string fwRegExStr =
|
||||
"Firmware Rev\\s+=\\s+(?<fw>\\d+\\.\\d+)\\s+Build date\\s+=\\s+(?<date>(\\w|\\d|\\s*.)*)\\s*$";
|
||||
string fwcRegExStr = "FW_CONF\\s+=\\s+(?<value>0x[0-9A-Fa-f]{8})\\s*$";
|
||||
string servoRegExStr = "Servo\\s+Rev\\s+=\\s+(?<version>\\d+\\.\\d+)\\s*$";
|
||||
const string fwRegExStr = @"Firmware Rev\s+=\s+(?<fw>\d+\.\d+)\s+Build date\s+=\s+(?<date>(\w|\d|\s*.)*)\s*$";
|
||||
const string fwcRegExStr = @"FW_CONF\s+=\s+(?<value>0x[0-9A-Fa-f]{8})\s*$";
|
||||
const string servoRegExStr = @"Servo\s+Rev\s+=\s+(?<version>\d+\.\d+)\s*$";
|
||||
Regex fwRegEx = new Regex(fwRegExStr);
|
||||
Regex fwcRegEx = new Regex(fwcRegExStr);
|
||||
Regex servoRegEx = new Regex(servoRegExStr);
|
||||
Match fwMatch;
|
||||
Match fwcMatch;
|
||||
Match servoMatch;
|
||||
|
||||
for(int pos = 5; pos < pageResponse.Length; pos++)
|
||||
if(pageResponse[pos] == 0x00)
|
||||
{
|
||||
string str = StringHandlers.CToString(array.ToArray());
|
||||
fwMatch = fwRegEx.Match(str);
|
||||
fwcMatch = fwcRegEx.Match(str);
|
||||
servoMatch = servoRegEx.Match(str);
|
||||
Match fwMatch = fwRegEx.Match(str);
|
||||
Match fwcMatch = fwcRegEx.Match(str);
|
||||
Match servoMatch = servoRegEx.Match(str);
|
||||
|
||||
if(str.ToLowerInvariant().StartsWith("copyright", StringComparison.Ordinal))
|
||||
decoded.Copyright = Encoding.ASCII.GetBytes(str);
|
||||
@@ -2426,24 +2408,24 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static Page_C0_Seagate? DecodePage_C0_Seagate(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if(pageResponse[1] != 0xC0) return null;
|
||||
if(pageResponse?[1] != 0xC0) return null;
|
||||
|
||||
if(pageResponse[3] != 12) return null;
|
||||
|
||||
if(pageResponse.Length != 16) return null;
|
||||
|
||||
Page_C0_Seagate decoded = new Page_C0_Seagate();
|
||||
Page_C0_Seagate decoded = new Page_C0_Seagate
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
PageCode = pageResponse[1],
|
||||
ControllerFirmware = new byte[4],
|
||||
BootFirmware = new byte[4],
|
||||
ServoFirmware = new byte[4]
|
||||
};
|
||||
|
||||
decoded.PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5);
|
||||
decoded.PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F);
|
||||
decoded.PageLength = (byte)(pageResponse[3] + 4);
|
||||
decoded.PageCode = pageResponse[1];
|
||||
|
||||
decoded.ControllerFirmware = new byte[4];
|
||||
decoded.BootFirmware = new byte[4];
|
||||
decoded.ServoFirmware = new byte[4];
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.ControllerFirmware, 0, 4);
|
||||
Array.Copy(pageResponse, 8, decoded.BootFirmware, 0, 4);
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
public enum PeripheralQualifiers : byte
|
||||
@@ -56,6 +58,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
VendorMask = 0x04
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PeripheralDeviceTypes : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -152,6 +155,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
UnknownDevice = 0x1F
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ANSIVersions : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -184,6 +188,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
ANSI2008Version = 0x06
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ECMAVersions : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -196,6 +201,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
ECMA111 = 0x01
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ISOVersions : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -208,6 +214,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
ISO1995Version = 0x02
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum SPIClocking : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -228,6 +235,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
STandDT = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum TGPSValues : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -248,6 +256,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
Both = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ProtocolIdentifiers : byte
|
||||
{
|
||||
/// <summary>
|
||||
@@ -304,6 +313,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
NoProtocol = 15
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ScsiDefinitions : byte
|
||||
{
|
||||
Current = 0,
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
@@ -48,6 +49,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
/// RFC 7144
|
||||
/// ECMA-111
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class Inquiry
|
||||
{
|
||||
#region Public methods
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// T10/1675-D revision 4
|
||||
/// T10/1836-D revision 2g
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class AACS
|
||||
{
|
||||
public struct AACSVolumeIdentifier
|
||||
@@ -463,8 +468,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if(response.MaxLBAExtents == 0)
|
||||
if(response.DataLength > 2) sb.AppendLine("Drive can store 256 LBA Extents");
|
||||
else sb.AppendLine("Drive cannot store LBA Extents");
|
||||
sb.AppendLine(response.DataLength > 2
|
||||
? "Drive can store 256 LBA Extents"
|
||||
: "Drive cannot store LBA Extents");
|
||||
else sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine();
|
||||
|
||||
for(int i = 0; i < response.Extents.Length; i++)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// T10/1675-D revision 4
|
||||
/// T10/1836-D revision 2g
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class CPRM
|
||||
{
|
||||
public struct CPRMMediaKeyBlock
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// T10/1675-D revision 4
|
||||
/// T10/1836-D revision 2g
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class DiscInformation
|
||||
{
|
||||
public struct StandardDiscInformation
|
||||
@@ -279,8 +284,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
if((response[2] & 0xE0) != 0) return null;
|
||||
|
||||
StandardDiscInformation decoded = new StandardDiscInformation();
|
||||
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
|
||||
StandardDiscInformation decoded =
|
||||
new StandardDiscInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
|
||||
|
||||
if(decoded.DataLength + 2 != response.Length) return null;
|
||||
|
||||
@@ -417,8 +422,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
(decoded.LastPossibleLeadOutStartLBA & 0xFF00) >> 8,
|
||||
decoded.LastPossibleLeadOutStartLBA & 0xFF).AppendLine();
|
||||
|
||||
if(decoded.URU) sb.AppendLine("Disc is defined for unrestricted use");
|
||||
else sb.AppendLine("Disc is defined for restricted use");
|
||||
sb.AppendLine(decoded.URU ? "Disc is defined for unrestricted use" : "Disc is defined for restricted use");
|
||||
|
||||
if(decoded.DID_V) sb.AppendFormat("Disc ID: {0:X6}", decoded.DiscIdentification & 0x00FFFFFF).AppendLine();
|
||||
if(decoded.DBC_V) sb.AppendFormat("Disc barcode: {0:X16}", decoded.DiscBarcode).AppendLine();
|
||||
@@ -440,8 +444,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
if((response[2] & 0xE0) != 0x20) return null;
|
||||
|
||||
TrackResourcesInformation decoded = new TrackResourcesInformation();
|
||||
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
|
||||
TrackResourcesInformation decoded =
|
||||
new TrackResourcesInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
|
||||
|
||||
if(decoded.DataLength + 2 != response.Length) return null;
|
||||
|
||||
@@ -479,8 +483,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
if((response[2] & 0xE0) != 0x40) return null;
|
||||
|
||||
POWResourcesInformation decoded = new POWResourcesInformation();
|
||||
decoded.DataLength = (ushort)((response[0] << 8) + response[1]);
|
||||
POWResourcesInformation decoded =
|
||||
new POWResourcesInformation {DataLength = (ushort)((response[0] << 8) + response[1])};
|
||||
|
||||
if(decoded.DataLength + 2 != response.Length) return null;
|
||||
|
||||
|
||||
@@ -30,8 +30,12 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum FormatLayerTypeCodes : ushort
|
||||
{
|
||||
CDLayer = 0x0008,
|
||||
@@ -40,6 +44,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
HDDVDLayer = 0x0050
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum SessionStatusCodes : byte
|
||||
{
|
||||
Empty = 0x00,
|
||||
@@ -48,6 +54,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Complete = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum DiscStatusCodes : byte
|
||||
{
|
||||
Empty = 0x00,
|
||||
@@ -56,6 +64,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Others = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum BGFormatStatusCodes : byte
|
||||
{
|
||||
NoFormattable = 0x00,
|
||||
@@ -64,6 +74,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
FormatComplete = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum DiscTypeCodes : byte
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
@@ -41,6 +42,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// MMC Feature enumeration
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum FeatureNumber : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -285,6 +287,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// MMC Profile enumeration
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ProfileNumber : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -445,6 +448,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Unconforming = 0xFFFF
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PhysicalInterfaces : uint
|
||||
{
|
||||
/// <summary>
|
||||
@@ -489,6 +493,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Vendor = 0xFFFF
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Profile
|
||||
{
|
||||
public ProfileNumber Number;
|
||||
@@ -498,6 +505,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Profile List Feature (0000h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0000
|
||||
{
|
||||
/// <summary>
|
||||
@@ -521,6 +531,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Core Feature (0001h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0001
|
||||
{
|
||||
/// <summary>
|
||||
@@ -552,6 +565,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Morphing Feature (0002h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0002
|
||||
{
|
||||
/// <summary>
|
||||
@@ -580,6 +596,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Removable Medium Feature (0003h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0003
|
||||
{
|
||||
/// <summary>
|
||||
@@ -623,6 +642,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Write Protect Feature (0004h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0004
|
||||
{
|
||||
/// <summary>
|
||||
@@ -658,6 +680,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Random Readable Feature (0010h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0010
|
||||
{
|
||||
/// <summary>
|
||||
@@ -689,6 +714,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Multi-Read Feature (001Dh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_001D
|
||||
{
|
||||
/// <summary>
|
||||
@@ -708,6 +736,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD Read Feature (001Eh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_001E
|
||||
{
|
||||
/// <summary>
|
||||
@@ -739,6 +770,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD Read Feature (001Fh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_001F
|
||||
{
|
||||
/// <summary>
|
||||
@@ -770,6 +804,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Random Writable Feature (0020h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0020
|
||||
{
|
||||
/// <summary>
|
||||
@@ -805,6 +842,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Incremental Streaming Writable Feature (0021h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0021
|
||||
{
|
||||
/// <summary>
|
||||
@@ -844,6 +884,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Sector Erasable Feature (0022h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0022
|
||||
{
|
||||
/// <summary>
|
||||
@@ -863,6 +906,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Formattable Feature (0023h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0023
|
||||
{
|
||||
/// <summary>
|
||||
@@ -906,6 +952,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Hardware Defect Management Feature (0024h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0024
|
||||
{
|
||||
/// <summary>
|
||||
@@ -929,6 +978,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Write Once Feature (0025h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0025
|
||||
{
|
||||
/// <summary>
|
||||
@@ -960,6 +1012,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Restricted Overwrite Feature (0026h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0026
|
||||
{
|
||||
/// <summary>
|
||||
@@ -979,6 +1034,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD-RW CAV Write Feature (0027h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0027
|
||||
{
|
||||
/// <summary>
|
||||
@@ -998,6 +1056,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// MRW Feature (0028h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0028
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1029,6 +1090,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Enhanced Defect Reporting Feature (0029h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0029
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1060,6 +1124,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD+RW Feature (002Ah)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002A
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1091,6 +1158,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD+R Feature (002Bh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002B
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1114,6 +1184,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Rigid Restricted Overwrite Feature (002Ch)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002C
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1149,6 +1222,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD Track at Once Feature (002Dh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002D
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1196,6 +1272,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD Mastering (Session at Once) Feature (002Eh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002E
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1247,6 +1326,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD-R/-RW Write Feature (002Fh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_002F
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1282,6 +1364,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Double Density CD Read Feature (0030h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0030
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1301,6 +1386,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Double Density CD-R Write Feature (0031h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0031
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1324,6 +1412,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Double Density CD-RW Write Feature (0032h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0032
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1351,6 +1442,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Layer Jump Recording Feature (0033h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0033
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1371,6 +1465,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Stop Long Operation Feature (0035h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0035
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1390,6 +1487,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD-RW Media Write Support Feature (0037h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0037
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1413,6 +1513,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// BD-R Pseudo-Overwrite (POW) Feature (0038h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0038
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1432,6 +1535,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD+RW Dual Layer Feature (003Ah)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_003A
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1463,6 +1569,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD+R Dual Layer Feature (003Bh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_003B
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1494,6 +1603,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// BD Read Feature (0040h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0040
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1545,6 +1657,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// BD Write Feature (0041h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0041
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1588,6 +1703,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// TSR Feature (0042h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0042
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1607,6 +1725,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// HD DVD Read Feature (0050h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0050
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1634,6 +1755,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// HD DVD Write Feature (0051h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0051
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1661,6 +1785,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Hybrid Disc Feature (0080h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0080
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1684,6 +1811,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Power Management Feature (0100h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0100
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1703,6 +1833,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// S.M.A.R.T. Feature (0101h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0101
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1726,6 +1859,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Embedded Changer Feature (0102h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0102
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1757,6 +1893,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// CD Audio External Play Feature (0103h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0103
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1792,6 +1931,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Microcode Upgrade Feature (0104h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0104
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1815,6 +1957,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Time-Out Feature (0105h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0105
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1842,6 +1987,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD-CSS Feature (0106h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0106
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1865,6 +2013,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Real Time Streaming Feature (0107h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0107
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1908,6 +2059,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Drive serial number (0108h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0108
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1931,6 +2085,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Media Serial Number Feature (0109h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0109
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1950,6 +2107,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Disc Control Blocks Feature (010Ah)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_010A
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1970,6 +2130,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD CPRM Feature (010Bh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_010B
|
||||
{
|
||||
/// <summary>
|
||||
@@ -1993,6 +2156,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// Firmware Information Feature (010Ch)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_010C
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2019,6 +2185,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// AACS Feature (010Dh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_010D
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2070,6 +2239,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// DVD CSS Managed Recording Feature (010Eh)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_010E
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2093,6 +2265,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// SecurDisc Feature (0113h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0113
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2112,6 +2287,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// OSSC Feature (0142h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0142
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2144,6 +2322,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// <summary>
|
||||
/// VCPS Feature (0110h)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct Feature_0110
|
||||
{
|
||||
/// <summary>
|
||||
@@ -2184,8 +2365,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
List<Profile> listProfiles = new List<Profile>();
|
||||
while(offset < feature.Length)
|
||||
{
|
||||
Profile prof = new Profile();
|
||||
prof.Number = (ProfileNumber)((feature[offset] << 8) + feature[offset + 1]);
|
||||
Profile prof = new Profile {Number = (ProfileNumber)((feature[offset] << 8) + feature[offset + 1])};
|
||||
prof.Current |= (feature[offset + 2] & 0x01) == 0x01;
|
||||
listProfiles.Add(prof);
|
||||
offset += 4;
|
||||
@@ -3861,8 +4041,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
sb.AppendLine("MMC Morphing:");
|
||||
|
||||
if(ftr.Async) sb.AppendLine("\tDrive supports polling and asynchronous GET EVENT STATUS NOTIFICATION");
|
||||
else sb.AppendLine("\tDrive supports only polling GET EVENT STATUS NOTIFICATION");
|
||||
sb.AppendLine(ftr.Async
|
||||
? "\tDrive supports polling and asynchronous GET EVENT STATUS NOTIFICATION"
|
||||
: "\tDrive supports only polling GET EVENT STATUS NOTIFICATION");
|
||||
|
||||
if(ftr.OCEvent) sb.AppendLine("\tDrive supports operational change request / notification class events");
|
||||
|
||||
@@ -4159,8 +4340,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
sb.AppendLine("MMC Enhanced Defect Reporting Feature:");
|
||||
|
||||
if(ftr.DRTDM) sb.AppendLine("\tDrive supports DRT-DM mode");
|
||||
else sb.AppendLine("\tDrive supports Persistent-DM mode");
|
||||
sb.AppendLine(ftr.DRTDM ? "\tDrive supports DRT-DM mode" : "\tDrive supports Persistent-DM mode");
|
||||
|
||||
if(ftr.DBICacheZones > 0)
|
||||
sb.AppendFormat("\tDrive has {0} DBI cache zones", ftr.DBICacheZones).AppendLine();
|
||||
@@ -4181,8 +4361,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
sb.Append("Drive can read and write DVD+RW");
|
||||
if(ftr.Current) sb.AppendLine(" (current)");
|
||||
else sb.AppendLine();
|
||||
if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop");
|
||||
else sb.AppendLine("\tDrive supports both forms of background format stopping");
|
||||
sb.AppendLine(ftr.CloseOnly
|
||||
? "\tDrive supports only the read compatibility stop"
|
||||
: "\tDrive supports both forms of background format stopping");
|
||||
if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting");
|
||||
}
|
||||
else
|
||||
@@ -4226,8 +4407,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("MMC Rigid Restricted Overwrite");
|
||||
if(ftr.Current) sb.AppendLine(" (current):");
|
||||
else sb.AppendLine(":");
|
||||
sb.AppendLine(ftr.Current ? " (current):" : ":");
|
||||
|
||||
if(ftr.Blank) sb.AppendLine("\tDrive supports the BLANK command");
|
||||
if(ftr.Intermediate)
|
||||
@@ -4423,8 +4603,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
sb.Append("Drive can read and write DVD+RW DL");
|
||||
if(ftr.Current) sb.AppendLine(" (current)");
|
||||
else sb.AppendLine();
|
||||
if(ftr.CloseOnly) sb.AppendLine("\tDrive supports only the read compatibility stop");
|
||||
else sb.AppendLine("\tDrive supports both forms of background format stopping");
|
||||
sb.AppendLine(ftr.CloseOnly
|
||||
? "\tDrive supports only the read compatibility stop"
|
||||
: "\tDrive supports both forms of background format stopping");
|
||||
if(ftr.QuickStart) sb.AppendLine("\tDrive can do a quick start formatting");
|
||||
}
|
||||
else
|
||||
@@ -4468,8 +4649,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("MMC BD Read");
|
||||
if(ftr.Current) sb.AppendLine(" (current):");
|
||||
else sb.AppendLine(":");
|
||||
sb.AppendLine(ftr.Current ? " (current):" : ":");
|
||||
|
||||
if(ftr.OldROM) sb.AppendLine("\tDrive can read BD-ROM pre-1.0");
|
||||
if(ftr.ROM) sb.AppendLine("\tDrive can read BD-ROM Ver.1");
|
||||
@@ -4492,8 +4672,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("MMC BD Write");
|
||||
if(ftr.Current) sb.AppendLine(" (current):");
|
||||
else sb.AppendLine(":");
|
||||
sb.AppendLine(ftr.Current ? " (current):" : ":");
|
||||
|
||||
if(ftr.OldR) sb.AppendLine("\tDrive can write BD-R pre-1.0");
|
||||
if(ftr.R) sb.AppendLine("\tDrive can write BD-R Ver.1");
|
||||
@@ -4712,7 +4891,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
if(ftr.DCBs == null) return sb.ToString();
|
||||
|
||||
foreach(uint DCB in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", DCB).AppendLine();
|
||||
foreach(uint dcb in ftr.DCBs) sb.AppendFormat("Drive supports DCB {0:X8}h", dcb).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4738,35 +4917,32 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Feature_010C ftr = feature.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
string syear, smonth, sday, shour, sminute, ssecond;
|
||||
byte[] temp;
|
||||
|
||||
temp = new byte[4];
|
||||
byte[] temp = new byte[4];
|
||||
temp[0] = (byte)((ftr.Century & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Century & 0xFF);
|
||||
temp[2] = (byte)((ftr.Year & 0xFF00) >> 8);
|
||||
temp[3] = (byte)(ftr.Year & 0xFF);
|
||||
syear = Encoding.ASCII.GetString(temp);
|
||||
string syear = Encoding.ASCII.GetString(temp);
|
||||
temp = new byte[2];
|
||||
temp[0] = (byte)((ftr.Month & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Month & 0xFF);
|
||||
smonth = Encoding.ASCII.GetString(temp);
|
||||
string smonth = Encoding.ASCII.GetString(temp);
|
||||
temp = new byte[2];
|
||||
temp[0] = (byte)((ftr.Day & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Day & 0xFF);
|
||||
sday = Encoding.ASCII.GetString(temp);
|
||||
string sday = Encoding.ASCII.GetString(temp);
|
||||
temp = new byte[2];
|
||||
temp[0] = (byte)((ftr.Hour & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Hour & 0xFF);
|
||||
shour = Encoding.ASCII.GetString(temp);
|
||||
string shour = Encoding.ASCII.GetString(temp);
|
||||
temp = new byte[2];
|
||||
temp[0] = (byte)((ftr.Minute & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Minute & 0xFF);
|
||||
sminute = Encoding.ASCII.GetString(temp);
|
||||
string sminute = Encoding.ASCII.GetString(temp);
|
||||
temp = new byte[2];
|
||||
temp[0] = (byte)((ftr.Second & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Second & 0xFF);
|
||||
ssecond = Encoding.ASCII.GetString(temp);
|
||||
string ssecond = Encoding.ASCII.GetString(temp);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -4776,7 +4952,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
sb.AppendFormat("Drive firmware is dated {0}", fwDate).AppendLine();
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
|
||||
return sb.ToString();
|
||||
@@ -4834,8 +5013,7 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Feature_0110 ftr = feature.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if(ftr.Current) sb.AppendLine("Drive and currently inserted media support VCPS");
|
||||
else sb.AppendLine("Drive supports VCPS");
|
||||
sb.AppendLine(ftr.Current ? "Drive and currently inserted media support VCPS" : "Drive supports VCPS");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -4847,8 +5025,9 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
Feature_0113 ftr = feature.Value;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if(ftr.Current) sb.AppendLine("Drive and currently inserted media support SecurDisc");
|
||||
else sb.AppendLine("Drive supports SecurDisc");
|
||||
sb.AppendLine(ftr.Current
|
||||
? "Drive and currently inserted media support SecurDisc"
|
||||
: "Drive supports SecurDisc");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -5165,12 +5344,18 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
return Prettify_0142(Decode_0142(feature));
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct FeatureDescriptor
|
||||
{
|
||||
public ushort Code;
|
||||
public byte[] Data;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct SeparatedFeatures
|
||||
{
|
||||
public uint DataLength;
|
||||
@@ -5180,17 +5365,21 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
|
||||
public static SeparatedFeatures Separate(byte[] response)
|
||||
{
|
||||
SeparatedFeatures dec = new SeparatedFeatures();
|
||||
dec.DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]);
|
||||
dec.CurrentProfile = (ushort)((response[6] << 8) + response[7]);
|
||||
SeparatedFeatures dec = new SeparatedFeatures
|
||||
{
|
||||
DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]),
|
||||
CurrentProfile = (ushort)((response[6] << 8) + response[7])
|
||||
};
|
||||
uint offset = 8;
|
||||
List<FeatureDescriptor> descLst = new List<FeatureDescriptor>();
|
||||
|
||||
while(offset + 4 < response.Length)
|
||||
{
|
||||
FeatureDescriptor desc = new FeatureDescriptor();
|
||||
desc.Code = (ushort)((response[offset + 0] << 8) + response[offset + 1]);
|
||||
desc.Data = new byte[response[offset + 3] + 4];
|
||||
FeatureDescriptor desc = new FeatureDescriptor
|
||||
{
|
||||
Code = (ushort)((response[offset + 0] << 8) + response[offset + 1]),
|
||||
Data = new byte[response[offset + 3] + 4]
|
||||
};
|
||||
if(desc.Data.Length + offset > response.Length) desc.Data = new byte[response.Length - offset];
|
||||
Array.Copy(response, offset, desc.Data, 0, desc.Data.Length);
|
||||
offset += (uint)desc.Data.Length;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// T10/1675-D revision 4
|
||||
/// T10/1836-D revision 2g
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class Hybrid
|
||||
{
|
||||
public struct RecognizedFormatLayers
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
@@ -50,6 +51,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC
|
||||
/// T10/1675-D revision 4
|
||||
/// T10/1836-D revision 2g
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class WriteProtect
|
||||
{
|
||||
public struct WriteProtectionStatus
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x00: Drive Operation Mode page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x01: Read-write error recovery page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x01: Read error recovery page for MultiMedia Devices
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x02: Disconnect-reconnect page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x03: Format device page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x04: Rigid disk drive geometry page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x05: Flexible disk page
|
||||
@@ -263,18 +267,15 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
case 1:
|
||||
sb.Append("\tPin 34 indicates drive is ready when active ");
|
||||
if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
case 2:
|
||||
sb.Append("\tPin 34 indicates disk has changed when active ");
|
||||
if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tPin 34 indicates unknown function {0} when active ", page.Pin34 & 0x07);
|
||||
if((page.Pin34 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -285,23 +286,19 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
case 1:
|
||||
sb.Append("\tPin 4 indicates drive is in use when active ");
|
||||
if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
case 2:
|
||||
sb.Append("\tPin 4 indicates eject when active ");
|
||||
if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
case 3:
|
||||
sb.Append("\tPin 4 indicates head load when active ");
|
||||
if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tPin 4 indicates unknown function {0} when active ", page.Pin4 & 0x07);
|
||||
if((page.Pin4 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -312,8 +309,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tPin 2 indicates unknown function {0} when active ", page.Pin2 & 0x07);
|
||||
if((page.Pin2 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin2 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -324,13 +320,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
case 1:
|
||||
sb.Append("\tPin 1 indicates disk change reset when active ");
|
||||
if((page.Pin1 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tPin 1 indicates unknown function {0} when active ", page.Pin1 & 0x07);
|
||||
if((page.Pin1 & 0x08) == 0x08) sb.Append("high");
|
||||
else sb.Append("low");
|
||||
sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x06: Optical memory page
|
||||
|
||||
@@ -30,10 +30,15 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x07: Verify error recovery page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x07: Verify error recovery page for MultiMedia Devices
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x08: Caching page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x0A: Control mode page
|
||||
@@ -391,9 +395,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static ModePage_0A_S01? DecodeModePage_0A_S01(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if((pageResponse[0] & 0x40) != 0x40) return null;
|
||||
if((pageResponse?[0] & 0x40) != 0x40) return null;
|
||||
|
||||
if((pageResponse[0] & 0x3F) != 0x0A) return null;
|
||||
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x0B: Medium types supported page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x0D: CD-ROM parameteres page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x0E: CD-ROM audio control parameters page
|
||||
@@ -147,8 +151,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
sb.AppendLine("SCSI CD-ROM audio control parameters page:");
|
||||
|
||||
if(page.PS) sb.AppendLine("\tParameters can be saved");
|
||||
if(page.Immed) sb.AppendLine("\tDrive will return from playback command immediately");
|
||||
else sb.AppendLine("\tDrive will return from playback command when playback ends");
|
||||
sb.AppendLine(page.Immed
|
||||
? "\tDrive will return from playback command immediately"
|
||||
: "\tDrive will return from playback command when playback ends");
|
||||
if(page.SOTC) sb.AppendLine("\tDrive will stop playback on track end");
|
||||
|
||||
if(page.APRVal)
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x0F: Data compression page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x10: XOR control mode page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x10: Device configuration page
|
||||
@@ -237,8 +241,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.DBR)
|
||||
{
|
||||
sb.AppendLine("\tDrive supports recovering data from buffer");
|
||||
if(page.RBO) sb.AppendLine("\tRecovered buffer data comes in LIFO order");
|
||||
else sb.AppendLine("\tRecovered buffer data comes in FIFO order");
|
||||
sb.AppendLine(page.RBO
|
||||
? "\tRecovered buffer data comes in LIFO order"
|
||||
: "\tRecovered buffer data comes in FIFO order");
|
||||
}
|
||||
if(page.BIS) sb.AppendLine("\tMedium supports block IDs");
|
||||
if(page.RSmk) sb.AppendLine("\tDrive reports setmarks");
|
||||
@@ -313,8 +318,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.PRMWP) sb.AppendLine("\tPermanent write protect is enabled");
|
||||
|
||||
if(page.BAML)
|
||||
if(page.BAM) sb.AppendLine("\tDrive operates using explicit address mode");
|
||||
else sb.AppendLine("\tDrive operates using implicit address mode");
|
||||
sb.AppendLine(page.BAM
|
||||
? "\tDrive operates using explicit address mode"
|
||||
: "\tDrive operates using implicit address mode");
|
||||
|
||||
switch(page.RewindOnReset)
|
||||
{
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x11: Medium partition page (1)
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Pages 0x12, 0x13, 0x14: Medium partition page (2-4)
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x1A: Power condition page
|
||||
@@ -219,9 +223,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static ModePage_1A_S01? DecodeModePage_1A_S01(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if((pageResponse[0] & 0x40) != 0x40) return null;
|
||||
if((pageResponse?[0] & 0x40) != 0x40) return null;
|
||||
|
||||
if((pageResponse[0] & 0x3F) != 0x1A) return null;
|
||||
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x1B: Removable Block Access Capabilities page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x1C: Informational exceptions control page
|
||||
@@ -247,9 +251,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static ModePage_1C_S01? DecodeModePage_1C_S01(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null) return null;
|
||||
|
||||
if((pageResponse[0] & 0x40) != 0x40) return null;
|
||||
if((pageResponse?[0] & 0x40) != 0x40) return null;
|
||||
|
||||
if((pageResponse[0] & 0x3F) != 0x1C) return null;
|
||||
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x1C: Timer & Protect page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x1D: Medium Configuration Mode Page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Certance Mode Page 0x21: Drive Capabilities Control Mode page
|
||||
|
||||
@@ -30,10 +30,15 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Certance Mode Page 0x22: Interface Control Mode Page
|
||||
@@ -124,8 +129,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
break;
|
||||
}
|
||||
|
||||
if(page.StopBits) sb.AppendLine("Library interface transmits 2 stop bits per byte");
|
||||
else sb.AppendLine("Library interface transmits 1 stop bits per byte");
|
||||
sb.AppendLine(page.StopBits
|
||||
? "Library interface transmits 2 stop bits per byte"
|
||||
: "Library interface transmits 1 stop bits per byte");
|
||||
|
||||
switch(page.CmdFwd)
|
||||
{
|
||||
@@ -160,11 +166,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
.AppendLine();
|
||||
sb.AppendFormat("\tDrive jumpers choose SCSI ID {0}", page.JumperedSelectionID).AppendLine();
|
||||
|
||||
if(page.PortAEnabled) sb.AppendLine("\tSCSI port is enabled");
|
||||
else sb.AppendLine("\tSCSI port is disabled");
|
||||
sb.AppendLine(page.PortAEnabled ? "\tSCSI port is enabled" : "\tSCSI port is disabled");
|
||||
|
||||
if(page.PortAEnabledOnPower) sb.AppendLine("\tSCSI port will be enabled on next power up");
|
||||
else sb.AppendLine("\tSCSI port will be disabled on next power up");
|
||||
sb.AppendLine(page.PortAEnabledOnPower
|
||||
? "\tSCSI port will be enabled on next power up"
|
||||
: "\tSCSI port will be disabled on next power up");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region IBM Mode Page 0x24: Drive Capabilities Control Mode page
|
||||
|
||||
@@ -30,11 +30,16 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Mode Page 0x2A: CD-ROM capabilities page
|
||||
@@ -279,11 +284,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
for(int i = 0; i < descriptors; i++)
|
||||
{
|
||||
decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor();
|
||||
decoded.WriteSpeedPerformanceDescriptors[i].RotationControl =
|
||||
(byte)(pageResponse[1 + 32 + i * 4] & 0x07);
|
||||
decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed =
|
||||
(ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4]);
|
||||
decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor
|
||||
{
|
||||
RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07),
|
||||
WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4])
|
||||
};
|
||||
}
|
||||
|
||||
return decoded;
|
||||
@@ -345,14 +350,15 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(page.PreventJumper)
|
||||
{
|
||||
sb.AppendLine("\tDrive power ups locked");
|
||||
if(page.LockState) sb.AppendLine("\tDrive is locked, media cannot be ejected or inserted");
|
||||
else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted");
|
||||
sb.AppendLine(page.LockState
|
||||
? "\tDrive is locked, media cannot be ejected or inserted"
|
||||
: "\tDrive is not locked, media can be ejected and inserted");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(page.LockState)
|
||||
sb.AppendLine("\tDrive is locked, media cannot be ejected, but if empty, can be inserted");
|
||||
else sb.AppendLine("\tDrive is not locked, media can be ejected and inserted");
|
||||
sb.AppendLine(page.LockState
|
||||
? "\tDrive is locked, media cannot be ejected, but if empty, can be inserted"
|
||||
: "\tDrive is not locked, media can be ejected and inserted");
|
||||
}
|
||||
if(page.Eject) sb.AppendLine("\tDrive can eject media");
|
||||
|
||||
@@ -369,23 +375,19 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(page.ReadCDR)
|
||||
{
|
||||
if(page.WriteCDR) sb.AppendLine("\tDrive can read and write CD-R");
|
||||
else sb.AppendLine("\tDrive can read CD-R");
|
||||
sb.AppendLine(page.WriteCDR ? "\tDrive can read and write CD-R" : "\tDrive can read CD-R");
|
||||
|
||||
if(page.Method2) sb.AppendLine("\tDrive supports reading CD-R packet media");
|
||||
}
|
||||
|
||||
if(page.ReadCDRW)
|
||||
if(page.WriteCDRW) sb.AppendLine("\tDrive can read and write CD-RW");
|
||||
else sb.AppendLine("\tDrive can read CD-RW");
|
||||
sb.AppendLine(page.WriteCDRW ? "\tDrive can read and write CD-RW" : "\tDrive can read CD-RW");
|
||||
|
||||
if(page.ReadDVDROM) sb.AppendLine("\tDrive can read DVD-ROM");
|
||||
if(page.ReadDVDR)
|
||||
if(page.WriteDVDR) sb.AppendLine("\tDrive can read and write DVD-R");
|
||||
else sb.AppendLine("\tDrive can read DVD-R");
|
||||
sb.AppendLine(page.WriteDVDR ? "\tDrive can read and write DVD-R" : "\tDrive can read DVD-R");
|
||||
if(page.ReadDVDRAM)
|
||||
if(page.WriteDVDRAM) sb.AppendLine("\tDrive can read and write DVD-RAM");
|
||||
else sb.AppendLine("\tDrive can read DVD-RAM");
|
||||
sb.AppendLine(page.WriteDVDRAM ? "\tDrive can read and write DVD-RAM" : "\tDrive can read DVD-RAM");
|
||||
|
||||
if(page.Composite) sb.AppendLine("\tDrive can deliver a composite audio and video data stream");
|
||||
if(page.DigitalPort1) sb.AppendLine("\tDrive supports IEC-958 digital output on port 1");
|
||||
|
||||
@@ -30,10 +30,15 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region IBM Mode Page 0x2F: Behaviour Configuration Mode page
|
||||
@@ -66,22 +71,20 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(pageResponse.Length < 8) return null;
|
||||
|
||||
IBM_ModePage_2F decoded = new IBM_ModePage_2F();
|
||||
|
||||
decoded.PS |= (pageResponse[0] & 0x80) == 0x80;
|
||||
decoded.FenceBehaviour = pageResponse[2];
|
||||
decoded.CleanBehaviour = pageResponse[3];
|
||||
decoded.WORMEmulation = pageResponse[4];
|
||||
decoded.SenseDataBehaviour = pageResponse[5];
|
||||
decoded.CCDM |= (pageResponse[6] & 0x04) == 0x04;
|
||||
decoded.DDEOR |= (pageResponse[6] & 0x02) == 0x02;
|
||||
decoded.CLNCHK |= (pageResponse[6] & 0x01) == 0x01;
|
||||
decoded.FirmwareUpdateBehaviour = pageResponse[7];
|
||||
decoded.UOE_C = (byte)((pageResponse[8] & 0x30) >> 4);
|
||||
decoded.UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2);
|
||||
decoded.UOE_F = (byte)(pageResponse[8] & 0x03);
|
||||
|
||||
return decoded;
|
||||
return new IBM_ModePage_2F
|
||||
{
|
||||
PS = (pageResponse[0] & 0x80) == 0x80,
|
||||
FenceBehaviour = pageResponse[2],
|
||||
CleanBehaviour = pageResponse[3],
|
||||
WORMEmulation = pageResponse[4],
|
||||
SenseDataBehaviour = pageResponse[5],
|
||||
CCDM = (pageResponse[6] & 0x04) == 0x04,
|
||||
DDEOR = (pageResponse[6] & 0x02) == 0x02,
|
||||
CLNCHK = (pageResponse[6] & 0x01) == 0x01,
|
||||
FirmwareUpdateBehaviour = pageResponse[7],
|
||||
UOE_C = (byte)((pageResponse[8] & 0x30) >> 4),
|
||||
UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2)
|
||||
};
|
||||
}
|
||||
|
||||
public static string PrettifyIBMModePage_2F(byte[] pageResponse)
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Apple Mode Page 0x30: Apple OEM String
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region HP Mode Page 0x3B: Serial Number Override Mode page
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region HP Mode Page 0x3C: Device Time Mode page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region HP Mode Page 0x3D: Extended Reset Mode page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region IBM Mode Page 0x3D: Behaviour Configuration Mode page
|
||||
|
||||
@@ -31,10 +31,15 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region Fujitsu Mode Page 0x3E: Verify Control page
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
#region HP Mode Page 0x3E: CD-ROM Emulation/Disaster Recovery Mode page
|
||||
@@ -82,8 +86,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(page.PS) sb.AppendLine("\tParameters can be saved");
|
||||
|
||||
if(page.CDmode) sb.AppendLine("\tDrive is emulating a CD-ROM drive");
|
||||
else sb.AppendLine("\tDrive is not emulating a CD-ROM drive");
|
||||
sb.AppendLine(page.CDmode ? "\tDrive is emulating a CD-ROM drive" : "\tDrive is not emulating a CD-ROM drive");
|
||||
if(page.NonAuto) sb.AppendLine("\tDrive will not exit emulation automatically");
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -30,10 +30,14 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public static string GetMediumTypeDescription(MediumTypes type)
|
||||
|
||||
@@ -32,10 +32,14 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public static ModeHeader? DecodeModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType)
|
||||
@@ -50,8 +54,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(modeResponse.Length < modeLength) return null;
|
||||
|
||||
ModeHeader header = new ModeHeader();
|
||||
header.MediumType = (MediumTypes)modeResponse[2];
|
||||
ModeHeader header = new ModeHeader {MediumType = (MediumTypes)modeResponse[2]};
|
||||
|
||||
bool longLBA = (modeResponse[4] & 0x01) == 0x01;
|
||||
|
||||
@@ -61,8 +64,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
header.BlockDescriptors = new BlockDescriptor[blockDescLength / 16];
|
||||
for(int i = 0; i < header.BlockDescriptors.Length; i++)
|
||||
{
|
||||
header.BlockDescriptors[i] = new BlockDescriptor();
|
||||
header.BlockDescriptors[i].Density = DensityType.Default;
|
||||
header.BlockDescriptors[i] = new BlockDescriptor {Density = DensityType.Default};
|
||||
byte[] temp = new byte[8];
|
||||
temp[0] = modeResponse[7 + i * 16 + 8];
|
||||
temp[1] = modeResponse[6 + i * 16 + 8];
|
||||
@@ -134,8 +136,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
ModeHeader? hdr = DecodeModeHeader10(modeResponse, deviceType);
|
||||
if(!hdr.HasValue) return null;
|
||||
|
||||
DecodedMode decoded = new DecodedMode();
|
||||
decoded.Header = hdr.Value;
|
||||
DecodedMode decoded = new DecodedMode {Header = hdr.Value};
|
||||
bool longlba = (modeResponse[4] & 0x01) == 0x01;
|
||||
int offset;
|
||||
int blkDrLength = 0;
|
||||
@@ -199,18 +200,12 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
return decoded;
|
||||
}
|
||||
|
||||
public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType)
|
||||
{
|
||||
return EncodeModeHeader10(header, deviceType, false);
|
||||
}
|
||||
|
||||
public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType, bool longLBA)
|
||||
public static byte[] EncodeModeHeader10(ModeHeader header, PeripheralDeviceTypes deviceType, bool longLBA = false)
|
||||
{
|
||||
byte[] hdr;
|
||||
|
||||
if(header.BlockDescriptors != null)
|
||||
if(longLBA) hdr = new byte[8 + header.BlockDescriptors.Length * 16];
|
||||
else hdr = new byte[8 + header.BlockDescriptors.Length * 8];
|
||||
hdr = longLBA ? new byte[8 + header.BlockDescriptors.Length * 16] : new byte[8 + header.BlockDescriptors.Length * 8];
|
||||
else hdr = new byte[8];
|
||||
|
||||
hdr[2] = (byte)header.MediumType;
|
||||
|
||||
@@ -32,10 +32,14 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public static ModeHeader? DecodeModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType)
|
||||
@@ -43,8 +47,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
if(modeResponse == null || modeResponse.Length < 4 || modeResponse.Length < modeResponse[0] + 1)
|
||||
return null;
|
||||
|
||||
ModeHeader header = new ModeHeader();
|
||||
header.MediumType = (MediumTypes)modeResponse[1];
|
||||
ModeHeader header = new ModeHeader {MediumType = (MediumTypes)modeResponse[1]};
|
||||
|
||||
if(modeResponse[3] > 0)
|
||||
{
|
||||
@@ -94,8 +97,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
ModeHeader? hdr = DecodeModeHeader6(modeResponse, deviceType);
|
||||
if(!hdr.HasValue) return null;
|
||||
|
||||
DecodedMode decoded = new DecodedMode();
|
||||
decoded.Header = hdr.Value;
|
||||
DecodedMode decoded = new DecodedMode {Header = hdr.Value};
|
||||
int blkDrLength = 0;
|
||||
if(decoded.Header.BlockDescriptors != null) blkDrLength = decoded.Header.BlockDescriptors.Length;
|
||||
|
||||
@@ -158,10 +160,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static byte[] EncodeModeHeader6(ModeHeader header, PeripheralDeviceTypes deviceType)
|
||||
{
|
||||
byte[] hdr;
|
||||
|
||||
if(header.BlockDescriptors != null) hdr = new byte[4 + header.BlockDescriptors.Length * 8];
|
||||
else hdr = new byte[4];
|
||||
byte[] hdr = header.BlockDescriptors != null ? new byte[4 + header.BlockDescriptors.Length * 8] : new byte[4];
|
||||
|
||||
hdr[1] = (byte)header.MediumType;
|
||||
|
||||
|
||||
@@ -30,8 +30,13 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public struct BlockDescriptor
|
||||
|
||||
@@ -31,10 +31,14 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class BlockLimits
|
||||
{
|
||||
public struct BlockLimitsData
|
||||
@@ -55,17 +59,14 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
public static BlockLimitsData? Decode(byte[] response)
|
||||
{
|
||||
if(response == null) return null;
|
||||
if(response?.Length != 6) return null;
|
||||
|
||||
if(response.Length != 6) return null;
|
||||
|
||||
BlockLimitsData dec = new BlockLimitsData();
|
||||
|
||||
dec.granularity = (byte)(response[0] & 0x1F);
|
||||
dec.maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]);
|
||||
dec.minBlockLen = (ushort)((response[4] << 8) + response[5]);
|
||||
|
||||
return dec;
|
||||
return new BlockLimitsData
|
||||
{
|
||||
granularity = (byte)(response[0] & 0x1F),
|
||||
maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]),
|
||||
minBlockLen = (ushort)((response[4] << 8) + response[5])
|
||||
};
|
||||
}
|
||||
|
||||
public static string Prettify(BlockLimitsData? decoded)
|
||||
|
||||
@@ -32,10 +32,15 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class DensitySupport
|
||||
{
|
||||
public struct DensitySupportHeader
|
||||
@@ -99,26 +104,26 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
List<DensitySupportDescriptor> descriptors = new List<DensitySupportDescriptor>();
|
||||
int offset = 4;
|
||||
byte[] tmp;
|
||||
|
||||
while(offset < response.Length)
|
||||
{
|
||||
DensitySupportDescriptor descriptor = new DensitySupportDescriptor();
|
||||
descriptor.primaryCode = response[offset + 0];
|
||||
descriptor.secondaryCode = response[offset + 1];
|
||||
descriptor.writable |= (response[offset + 2] & 0x80) == 0x80;
|
||||
descriptor.duplicate |= (response[offset + 2] & 0x40) == 0x40;
|
||||
descriptor.defaultDensity |= (response[offset + 2] & 0x20) == 0x20;
|
||||
descriptor.reserved = (byte)((response[offset + 2] & 0x1E) >> 1);
|
||||
descriptor.lenvalid |= (response[offset + 2] & 0x01) == 0x01;
|
||||
descriptor.len = (ushort)((response[offset + 3] << 8) + response[offset + 4]);
|
||||
descriptor.bpmm =
|
||||
(uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]);
|
||||
descriptor.width = (ushort)((response[offset + 8] << 8) + response[offset + 9]);
|
||||
descriptor.tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]);
|
||||
descriptor.capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) +
|
||||
(response[offset + 14] << 8) + response[offset + 15]);
|
||||
tmp = new byte[8];
|
||||
DensitySupportDescriptor descriptor = new DensitySupportDescriptor
|
||||
{
|
||||
primaryCode = response[offset + 0],
|
||||
secondaryCode = response[offset + 1],
|
||||
writable = (response[offset + 2] & 0x80) == 0x80,
|
||||
duplicate = (response[offset + 2] & 0x40) == 0x40,
|
||||
defaultDensity = (response[offset + 2] & 0x20) == 0x20,
|
||||
reserved = (byte)((response[offset + 2] & 0x1E) >> 1),
|
||||
lenvalid = (response[offset + 2] & 0x01) == 0x01,
|
||||
len = (ushort)((response[offset + 3] << 8) + response[offset + 4]),
|
||||
bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]),
|
||||
width = (ushort)((response[offset + 8] << 8) + response[offset + 9]),
|
||||
tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]),
|
||||
capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) +
|
||||
(response[offset + 14] << 8) + response[offset + 15])
|
||||
};
|
||||
byte[] tmp = new byte[8];
|
||||
Array.Copy(response, offset + 16, tmp, 0, 8);
|
||||
descriptor.organization = StringHandlers.CToString(tmp).Trim();
|
||||
tmp = new byte[8];
|
||||
@@ -134,10 +139,12 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
descriptors.Add(descriptor);
|
||||
}
|
||||
|
||||
DensitySupportHeader decoded = new DensitySupportHeader();
|
||||
decoded.length = responseLen;
|
||||
decoded.reserved = (ushort)((response[2] << 8) + response[3] + 2);
|
||||
decoded.descriptors = descriptors.ToArray();
|
||||
DensitySupportHeader decoded = new DensitySupportHeader
|
||||
{
|
||||
length = responseLen,
|
||||
reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
descriptors = descriptors.ToArray()
|
||||
};
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -187,14 +194,15 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
|
||||
List<MediaTypeSupportDescriptor> descriptors = new List<MediaTypeSupportDescriptor>();
|
||||
int offset = 4;
|
||||
byte[] tmp;
|
||||
|
||||
while(offset < response.Length)
|
||||
{
|
||||
MediaTypeSupportDescriptor descriptor = new MediaTypeSupportDescriptor();
|
||||
descriptor.mediumType = response[offset + 0];
|
||||
descriptor.reserved1 = response[offset + 1];
|
||||
descriptor.len = (ushort)((response[offset + 2] << 8) + response[offset + 3]);
|
||||
MediaTypeSupportDescriptor descriptor = new MediaTypeSupportDescriptor
|
||||
{
|
||||
mediumType = response[offset + 0],
|
||||
reserved1 = response[offset + 1],
|
||||
len = (ushort)((response[offset + 2] << 8) + response[offset + 3])
|
||||
};
|
||||
if(descriptor.len != 52) return null;
|
||||
|
||||
descriptor.numberOfCodes = response[offset + 4];
|
||||
@@ -204,7 +212,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
descriptor.length = (ushort)((response[offset + 16] << 8) + response[offset + 17]);
|
||||
descriptor.reserved1 = response[offset + 18];
|
||||
descriptor.reserved1 = response[offset + 19];
|
||||
tmp = new byte[8];
|
||||
byte[] tmp = new byte[8];
|
||||
Array.Copy(response, offset + 20, tmp, 0, 8);
|
||||
descriptor.organization = StringHandlers.CToString(tmp).Trim();
|
||||
tmp = new byte[8];
|
||||
@@ -219,10 +227,12 @@ namespace DiscImageChef.Decoders.SCSI.SSC
|
||||
descriptors.Add(descriptor);
|
||||
}
|
||||
|
||||
MediaTypeSupportHeader decoded = new MediaTypeSupportHeader();
|
||||
decoded.length = responseLen;
|
||||
decoded.reserved = (ushort)((response[2] << 8) + response[3] + 2);
|
||||
decoded.descriptors = descriptors.ToArray();
|
||||
MediaTypeSupportHeader decoded = new MediaTypeSupportHeader
|
||||
{
|
||||
length = responseLen,
|
||||
reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
descriptors = descriptors.ToArray()
|
||||
};
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
101
SCSI/Sense.cs
101
SCSI/Sense.cs
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using DiscImageChef.Decoders.ATA;
|
||||
|
||||
@@ -48,6 +49,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
Unknown
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public struct StandardSense
|
||||
{
|
||||
/// <summary>
|
||||
@@ -140,6 +144,11 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
Completed = 0xF
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct FixedSense
|
||||
{
|
||||
/// <summary>
|
||||
@@ -195,6 +204,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public byte[] AdditionalSense;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct DescriptorSense
|
||||
{
|
||||
/// <summary>
|
||||
@@ -216,6 +228,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public Dictionary<byte, byte[]> Descriptors;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public struct AnotherProgressIndicationSenseDescriptor
|
||||
{
|
||||
public SenseKeys SenseKey;
|
||||
@@ -224,6 +239,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public ushort Progress;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class Sense
|
||||
{
|
||||
/// <summary>
|
||||
@@ -265,8 +281,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static FixedSense? DecodeFixed(byte[] sense)
|
||||
{
|
||||
string foo;
|
||||
return DecodeFixed(sense, out foo);
|
||||
return DecodeFixed(sense, out _);
|
||||
}
|
||||
|
||||
public static FixedSense? DecodeFixed(byte[] sense, out string senseDescription)
|
||||
@@ -276,16 +291,17 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(sense.Length < 8) return null;
|
||||
|
||||
FixedSense decoded = new FixedSense();
|
||||
|
||||
decoded.InformationValid |= (sense[0] & 0x80) == 0x80;
|
||||
decoded.SegmentNumber = sense[1];
|
||||
decoded.Filemark |= (sense[2] & 0x80) == 0x80;
|
||||
decoded.EOM |= (sense[2] & 0x40) == 0x40;
|
||||
decoded.ILI |= (sense[2] & 0x20) == 0x20;
|
||||
decoded.SenseKey = (SenseKeys)(sense[2] & 0x0F);
|
||||
decoded.Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]);
|
||||
decoded.AdditionalLength = sense[7];
|
||||
FixedSense decoded = new FixedSense
|
||||
{
|
||||
InformationValid = (sense[0] & 0x80) == 0x80,
|
||||
SegmentNumber = sense[1],
|
||||
Filemark = (sense[2] & 0x80) == 0x80,
|
||||
EOM = (sense[2] & 0x40) == 0x40,
|
||||
ILI = (sense[2] & 0x20) == 0x20,
|
||||
SenseKey = (SenseKeys)(sense[2] & 0x0F),
|
||||
Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]),
|
||||
AdditionalLength = sense[7]
|
||||
};
|
||||
|
||||
if(sense.Length >= 12)
|
||||
decoded.CommandSpecific = (uint)((sense[8] << 24) + (sense[9] << 16) + (sense[10] << 8) + sense[11]);
|
||||
@@ -311,8 +327,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
public static DescriptorSense? DecodeDescriptor(byte[] sense)
|
||||
{
|
||||
string foo;
|
||||
return DecodeDescriptor(sense, out foo);
|
||||
return DecodeDescriptor(sense, out _);
|
||||
}
|
||||
|
||||
public static DescriptorSense? DecodeDescriptor(byte[] sense, out string senseDescription)
|
||||
@@ -323,13 +338,15 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
if(sense.Length < 8) return null;
|
||||
|
||||
DescriptorSense decoded = new DescriptorSense();
|
||||
DescriptorSense decoded = new DescriptorSense
|
||||
{
|
||||
SenseKey = (SenseKeys)(sense[1] & 0x0F),
|
||||
ASC = sense[2],
|
||||
ASCQ = sense[3],
|
||||
Overflow = (sense[4] & 0x80) == 0x80,
|
||||
Descriptors = new Dictionary<byte, byte[]>()
|
||||
};
|
||||
|
||||
decoded.SenseKey = (SenseKeys)(sense[1] & 0x0F);
|
||||
decoded.ASC = sense[2];
|
||||
decoded.ASCQ = sense[3];
|
||||
decoded.Overflow |= (sense[4] & 0x80) == 0x80;
|
||||
decoded.Descriptors = new Dictionary<byte, byte[]>();
|
||||
senseDescription = GetSenseDescription(decoded.ASC, decoded.ASCQ);
|
||||
|
||||
int offset = 8;
|
||||
@@ -402,8 +419,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
case SenseKeys.IllegalRequest:
|
||||
{
|
||||
if((decoded.SenseKeySpecific & 0x400000) == 0x400000) sb.AppendLine("Illegal field in CDB");
|
||||
else sb.AppendLine("Illegal field in data parameters");
|
||||
sb.AppendLine((decoded.SenseKeySpecific & 0x400000) == 0x400000
|
||||
? "Illegal field in CDB"
|
||||
: "Illegal field in data parameters");
|
||||
|
||||
if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
|
||||
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
|
||||
@@ -533,14 +551,13 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
if(descriptor.Length != 8 || descriptor[0] != 0x0A) return null;
|
||||
|
||||
AnotherProgressIndicationSenseDescriptor decoded = new AnotherProgressIndicationSenseDescriptor();
|
||||
|
||||
decoded.SenseKey = (SenseKeys)descriptor[2];
|
||||
decoded.ASC = descriptor[3];
|
||||
decoded.ASCQ = descriptor[4];
|
||||
decoded.Progress = (ushort)((descriptor[6] << 8) + descriptor[7]);
|
||||
|
||||
return decoded;
|
||||
return new AnotherProgressIndicationSenseDescriptor
|
||||
{
|
||||
SenseKey = (SenseKeys)descriptor[2],
|
||||
ASC = descriptor[3],
|
||||
ASCQ = descriptor[4],
|
||||
Progress = (ushort)((descriptor[6] << 8) + descriptor[7])
|
||||
};
|
||||
}
|
||||
|
||||
public static void DecodeDescriptor04(byte[] descriptor)
|
||||
@@ -568,19 +585,18 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
throw new NotImplementedException("Check OSD");
|
||||
}
|
||||
|
||||
public static AtaErrorRegistersLBA48 DecodeDescriptor09(byte[] descriptor)
|
||||
public static AtaErrorRegistersLba48 DecodeDescriptor09(byte[] descriptor)
|
||||
{
|
||||
AtaErrorRegistersLBA48 errorRegisters = new AtaErrorRegistersLBA48();
|
||||
|
||||
errorRegisters.error = descriptor[3];
|
||||
errorRegisters.sectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]);
|
||||
errorRegisters.lbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]);
|
||||
errorRegisters.lbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]);
|
||||
errorRegisters.lbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]);
|
||||
errorRegisters.deviceHead = descriptor[12];
|
||||
errorRegisters.status = descriptor[13];
|
||||
|
||||
return errorRegisters;
|
||||
return new AtaErrorRegistersLba48
|
||||
{
|
||||
Error = descriptor[3],
|
||||
SectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]),
|
||||
LbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]),
|
||||
LbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]),
|
||||
LbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]),
|
||||
DeviceHead = descriptor[12],
|
||||
Status = descriptor[13]
|
||||
};
|
||||
}
|
||||
|
||||
public static void DecodeDescriptor0B(byte[] descriptor)
|
||||
@@ -626,6 +642,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public static string GetSenseDescription(byte ASC, byte ASCQ)
|
||||
{
|
||||
switch(ASC)
|
||||
|
||||
@@ -30,8 +30,11 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum MediumTypes : byte
|
||||
{
|
||||
Default = 0x00,
|
||||
@@ -585,6 +588,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
#endregion Medium Types found in vendor documents
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum DensityType : byte
|
||||
{
|
||||
Default = 0x00,
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
public static class VendorString
|
||||
{
|
||||
public static string Prettify(string SCSIVendorString)
|
||||
public static string Prettify(string scsiVendorString)
|
||||
{
|
||||
switch(SCSIVendorString)
|
||||
switch(scsiVendorString)
|
||||
{
|
||||
case "0B4C": return "MOOSIK Ltd.";
|
||||
case "13FE": return "PHISON";
|
||||
@@ -836,7 +836,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
case "ZETTA": return "Zetta Systems, Inc.";
|
||||
case "ZTE": return "ZTE Corporation";
|
||||
case "ZVAULT": return "Zetavault";
|
||||
default: return SCSIVendorString;
|
||||
default: return scsiVendorString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user