Add support for MD DATA drives in media info command.

This commit is contained in:
2020-05-14 03:59:47 +01:00
parent 94511a75d3
commit 45fc95aea3
3 changed files with 38 additions and 7 deletions

View File

@@ -268,6 +268,19 @@ namespace Aaru.Core.Media.Info
DataFile.WriteTo("Media-Info command", outputPrefix, "_scsi_readattribute.bin", "SCSI READ ATTRIBUTE", seqBuf);
}
*/
break;
case PeripheralDeviceTypes.BridgingExpander
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
sense = dev.ReadCapacity(out cmdBuf, out senseBuf, dev.Timeout, out _);
if(!sense)
{
ReadCapacity = cmdBuf;
Blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
BlockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]);
}
break;
}
@@ -1390,17 +1403,15 @@ namespace Aaru.Core.Media.Info
totalSize);
ulong middleZone =
(totalSize -
((PFI.Decode(cmdBuf).Value.Layer0EndPSN -
PFI.Decode(cmdBuf).Value.DataAreaStartPSN) + 1) - gameSize) + 1;
(totalSize - ((PFI.Decode(cmdBuf).Value.Layer0EndPSN -
PFI.Decode(cmdBuf).Value.DataAreaStartPSN) + 1) - gameSize) + 1;
totalSize = l0Video + l1Video + (middleZone * 2) + gameSize;
ulong layerBreak = l0Video + middleZone + (gameSize / 2);
XgdInfo = new XgdInfo
{
L0Video = l0Video, L1Video = l1Video, MiddleZone = middleZone,
GameSize = gameSize,
L0Video = l0Video, L1Video = l1Video, MiddleZone = middleZone, GameSize = gameSize,
TotalSize = totalSize, LayerBreak = layerBreak
};
}