mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Merge branch 'master' of https://github.com/claunia/DiscImageChef
This commit is contained in:
@@ -171,6 +171,19 @@ namespace DiscImageChef.Devices
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((command == (MmcCommands)SecureDigitalCommands.SendOperatingCondition ||
|
||||
command == MmcCommands.SendOpCond) && cachedOcr != null)
|
||||
{
|
||||
System.DateTime start = System.DateTime.Now;
|
||||
buffer = new byte[cachedOcr.Length];
|
||||
System.Array.Copy(cachedOcr, buffer, buffer.Length);
|
||||
response = new uint[4];
|
||||
sense = false;
|
||||
System.DateTime end = System.DateTime.Now;
|
||||
duration = (end - start).TotalMilliseconds;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Command.SendMmcCommand(platformID, fd, command, write, isApplication, flags, argument, blockSize, blocks,
|
||||
ref buffer, out response, out duration, out sense, timeout);
|
||||
}
|
||||
|
||||
@@ -211,6 +211,12 @@ namespace DiscImageChef.Devices
|
||||
if(len == 0)
|
||||
cachedScr = null;
|
||||
}
|
||||
if(System.IO.File.Exists("/sys/block/" + devPath + "/device/ocr"))
|
||||
{
|
||||
int len = ConvertFromHexASCII("/sys/block/" + devPath + "/device/ocr", out cachedOcr);
|
||||
if(len == 0)
|
||||
cachedOcr = null;
|
||||
}
|
||||
|
||||
if(cachedCid != null)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,13 @@ namespace DiscImageChef.Devices
|
||||
error = lastError != 0;
|
||||
|
||||
if(transferLength > 1)
|
||||
{
|
||||
byte[] foo = new byte[0];
|
||||
SendMmcCommand(MmcCommands.StopTransmission, false, false, MmcFlags.Response_R1b | MmcFlags.ResponseSPI_R1b | MmcFlags.CommandAC,
|
||||
0, 0, 0, ref foo, out uint[] responseStop, out double stopDuration, out bool stopSense, timeout);
|
||||
duration += stopDuration;
|
||||
DicConsole.DebugWriteLine("MMC Device", "READ_MULTIPLE_BLOCK took {0} ms.", duration);
|
||||
}
|
||||
else
|
||||
DicConsole.DebugWriteLine("MMC Device", "READ_SINGLE_BLOCK took {0} ms.", duration);
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace DiscImageChef.Devices
|
||||
readonly byte[] cachedCsd;
|
||||
readonly byte[] cachedCid;
|
||||
readonly byte[] cachedScr;
|
||||
readonly byte[] cachedOcr;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Platform ID for this device
|
||||
|
||||
Reference in New Issue
Block a user