Added EVPD page B0h.

This commit is contained in:
2016-10-13 22:59:48 +01:00
parent 5799eb8a5e
commit 6491e59989
4 changed files with 93 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2016-10-13 Natalia Portillo <claunia@claunia.com>
* EVPD.cs: Added EVPD page B0h.
2016-10-13 Natalia Portillo <claunia@claunia.com> 2016-10-13 Natalia Portillo <claunia@claunia.com>
* EVPD.cs: * EVPD.cs:

View File

@@ -2113,6 +2113,81 @@ namespace DiscImageChef.Decoders.SCSI
#endregion EVPD Page 0xC1 (IBM): Drive Serial Numbers page #endregion EVPD Page 0xC1 (IBM): Drive Serial Numbers page
#region EVPD Page 0xB0: Sequential-access device capabilities page
/// <summary>
/// Sequential-access device capabilities page
/// Page code 0xB0
/// </summary>
public struct Page_B0
{
/// <summary>
/// The peripheral qualifier.
/// </summary>
public PeripheralQualifiers PeripheralQualifier;
/// <summary>
/// The type of the peripheral device.
/// </summary>
public PeripheralDeviceTypes PeripheralDeviceType;
/// <summary>
/// The page code.
/// </summary>
public byte PageCode;
/// <summary>
/// The length of the page.
/// </summary>
public ushort PageLength;
public bool WORM;
}
public static Page_B0? DecodePage_B0(byte[] pageResponse)
{
if(pageResponse == null)
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.WORM = (pageResponse[4] & 0x01) == 0x01;
return decoded;
}
public static string PrettifyPage_B0(byte[] pageResponse)
{
return PrettifyPage_B0(DecodePage_B0(pageResponse));
}
public static string PrettifyPage_B0(Page_B0? modePage)
{
if(!modePage.HasValue)
return null;
Page_B0 page = modePage.Value;
StringBuilder sb = new StringBuilder();
sb.AppendLine("SCSI Sequential-access Device Capabilities:");
if(page.WORM)
sb.AppendLine("\tDevice supports WORM media");
return sb.ToString();
}
#endregion EVPD Page 0xB0: Sequential-access device capabilities page
} }
} }

View File

@@ -1,3 +1,8 @@
2016-10-13 Natalia Portillo <claunia@claunia.com>
* Commands/DeviceInfo.cs:
Added EVPD page B0h.
2016-10-13 Natalia Portillo <claunia@claunia.com> 2016-10-13 Natalia Portillo <claunia@claunia.com>
* Commands/DeviceInfo.cs: * Commands/DeviceInfo.cs:

View File

@@ -301,6 +301,15 @@ namespace DiscImageChef.Commands
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
} }
} }
else if(page == 0xB0)
{
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(!sense)
{
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_B0(inqBuf));
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
}
}
else if(page == 0xC0 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "quantum") else if(page == 0xC0 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "quantum")
{ {
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);