Rename MediaTek F1h command 06h subcommand.

This commit is contained in:
2021-01-17 17:16:44 +00:00
parent ac9d88d57f
commit 41d750cb06
4 changed files with 19 additions and 19 deletions

View File

@@ -1675,10 +1675,10 @@ namespace Aaru.Core.Devices.Report
if(triedLba0) if(triedLba0)
{ {
AaruConsole.WriteLine("Trying MediaTek command F1h subcommand 06h..."); AaruConsole.WriteLine("Trying MediaTek READ DRAM command...");
mediaTest.CanReadF1_06 = mediaTest.CanReadF1_06 =
!_dev.MediaTekReadCache(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _); !_dev.MediaTekReadDram(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _);
mediaTest.ReadF1_06Data = mediaTest.CanReadF1_06 == true ? buffer : senseBuffer; mediaTest.ReadF1_06Data = mediaTest.CanReadF1_06 == true ? buffer : senseBuffer;
@@ -1745,10 +1745,10 @@ namespace Aaru.Core.Devices.Report
if(triedLeadOut) if(triedLeadOut)
{ {
AaruConsole.WriteLine("Trying MediaTek command F1h subcommand 06h for Lead-Out..."); AaruConsole.WriteLine("Trying MediaTek READ DRAM command for Lead-Out...");
mediaTest.CanReadF1_06LeadOut = mediaTest.CanReadF1_06LeadOut =
!_dev.MediaTekReadCache(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _); !_dev.MediaTekReadDram(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _);
mediaTest.ReadF1_06LeadOutData = mediaTest.CanReadF1_06LeadOut == true ? buffer : senseBuffer; mediaTest.ReadF1_06LeadOutData = mediaTest.CanReadF1_06LeadOut == true ? buffer : senseBuffer;
@@ -1823,9 +1823,9 @@ namespace Aaru.Core.Devices.Report
firstSessionLeadOutTrack.PFRAME + 150); firstSessionLeadOutTrack.PFRAME + 150);
// Skip second session track pre-gap // Skip second session track pre-gap
uint secondSessionLeadInLba = (uint)(((secondSessionFirstTrack.PMIN * 60 * 75) + uint secondSessionLeadInLba = (uint)((secondSessionFirstTrack.PMIN * 60 * 75) +
(secondSessionFirstTrack.PSEC * 75) + (secondSessionFirstTrack.PSEC * 75) +
secondSessionFirstTrack.PFRAME) - 300); secondSessionFirstTrack.PFRAME - 300);
AaruConsole.WriteLine("Trying SCSI READ CD in first session Lead-Out..."); AaruConsole.WriteLine("Trying SCSI READ CD in first session Lead-Out...");

View File

@@ -36,22 +36,22 @@ namespace Aaru.Devices
{ {
public sealed partial class Device public sealed partial class Device
{ {
/// <summary>Reads from the drive's cache.</summary> /// <summary>Reads from the drive's DRAM.</summary>
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns> /// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
/// <param name="buffer">Buffer where the cache contents will be stored</param> /// <param name="buffer">Buffer where the DRAM contents will be stored</param>
/// <param name="senseBuffer">Sense buffer.</param> /// <param name="senseBuffer">Sense buffer.</param>
/// <param name="timeout">Timeout in seconds.</param> /// <param name="timeout">Timeout in seconds.</param>
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param> /// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
/// <param name="offset">Starting offset in cache memory.</param> /// <param name="offset">Starting offset in DRAM memory.</param>
/// <param name="length">How much data to retrieve from cache.</param> /// <param name="length">How much data to retrieve from DRAM.</param>
public bool MediaTekReadCache(out byte[] buffer, out byte[] senseBuffer, uint offset, uint length, uint timeout, public bool MediaTekReadDram(out byte[] buffer, out byte[] senseBuffer, uint offset, uint length, uint timeout,
out double duration) out double duration)
{ {
senseBuffer = new byte[32]; senseBuffer = new byte[32];
byte[] cdb = new byte[10]; byte[] cdb = new byte[10];
buffer = new byte[length]; buffer = new byte[length];
cdb[0] = (byte)ScsiCommands.MediaTekReadCache; cdb[0] = (byte)ScsiCommands.MediaTekVendorCommand;
cdb[1] = 0x06; cdb[1] = 0x06;
cdb[2] = (byte)((offset & 0xFF000000) >> 24); cdb[2] = (byte)((offset & 0xFF000000) >> 24);
cdb[3] = (byte)((offset & 0xFF0000) >> 16); cdb[3] = (byte)((offset & 0xFF0000) >> 16);
@@ -67,7 +67,7 @@ namespace Aaru.Devices
Error = LastError != 0; Error = LastError != 0;
AaruConsole.DebugWriteLine("SCSI Device", "MediaTek READ CACHE took {0} ms.", duration); AaruConsole.DebugWriteLine("SCSI Device", "MediaTek READ DRAM took {0} ms.", duration);
return sense; return sense;
} }

View File

@@ -1840,7 +1840,7 @@ namespace Aaru.Devices
#endregion #endregion
#region MediaTek vendor commands #region MediaTek vendor commands
MediaTekReadCache = 0xF1 MediaTekVendorCommand = 0xF1
#endregion #endregion
} }
#endregion SCSI Commands #endregion SCSI Commands
@@ -2885,7 +2885,7 @@ namespace Aaru.Devices
{ {
LogicalBlockAddress = 0, LogicalTrackNumber = 1, SessionNumber = 2 LogicalBlockAddress = 0, LogicalTrackNumber = 1, SessionNumber = 2
} }
public enum CssReportKeyFormat : byte public enum CssReportKeyFormat : byte
{ {
AgidForCssCppm = 0x00, ChallengeKey = 0x01, Key1 = 0x02, AgidForCssCppm = 0x00, ChallengeKey = 0x01, Key1 = 0x02,

View File

@@ -71,8 +71,8 @@ namespace Aaru.Tests.Devices
if(sense) if(sense)
AaruConsole.WriteLine("READ CD failed..."); AaruConsole.WriteLine("READ CD failed...");
AaruConsole.WriteLine("Sending MediaTek READ CACHE to the device..."); AaruConsole.WriteLine("Sending MediaTek READ DRAM to the device...");
sense = dev.MediaTekReadCache(out buffer, out senseBuffer, 0, 0xB00, dev.Timeout, out duration); sense = dev.MediaTekReadDram(out buffer, out senseBuffer, 0, 0xB00, dev.Timeout, out duration);
menu: menu:
AaruConsole.WriteLine("Device: {0}", devPath); AaruConsole.WriteLine("Device: {0}", devPath);