* DiscImageChef.Devices/Enums.cs:

* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
	* DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs:
	  Added vendor commands for Archive Corporation Viper 2060S,
	  2125S and 2150S.

	* DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs:
	  Corrected documentation typo.
This commit is contained in:
2016-01-13 05:57:35 +00:00
parent 9389d4bb3e
commit 6d2b9089eb
5 changed files with 148 additions and 3 deletions

View File

@@ -1,3 +1,14 @@
2016-01-13 Natalia Portillo <claunia@claunia.com>
* Enums.cs:
* DiscImageChef.Devices.csproj:
* Device/ScsiCommands/ArchiveCorp.cs:
Added vendor commands for Archive Corporation Viper 2060S,
2125S and 2150S.
* Device/ScsiCommands/Adaptec.cs:
Corrected documentation typo.
2016-01-13 Natalia Portillo <claunia@claunia.com>
* Enums.cs:

View File

@@ -47,7 +47,7 @@ namespace DiscImageChef.Devices
/// </summary>
/// <param name="buffer">Buffer.</param>
/// <param name="senseBuffer">Sense buffer.</param>
/// <param name="lba">SCSI.</param>
/// <param name="lba">SCSI Logical Block Address.</param>
/// <param name="timeout">Timeout.</param>
/// <param name="duration">Duration.</param>
public bool AdaptecTranslate(out byte[] buffer, out byte[] senseBuffer, uint lba, uint timeout, out double duration)
@@ -61,7 +61,7 @@ namespace DiscImageChef.Devices
/// <param name="buffer">Buffer.</param>
/// <param name="senseBuffer">Sense buffer.</param>
/// <param name="drive1">If set to <c>true</c> request the data from drive 1.</param>
/// <param name="lba">SCSI.</param>
/// <param name="lba">SCSI Logical Block Address.</param>
/// <param name="timeout">Timeout.</param>
/// <param name="duration">Duration.</param>
public bool AdaptecTranslate(out byte[] buffer, out byte[] senseBuffer, bool drive1, uint lba, uint timeout, out double duration)

View File

@@ -0,0 +1,113 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : ArchiveCorp.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Archive Corp. vendor commands
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
using DiscImageChef.Console;
namespace DiscImageChef.Devices
{
public partial class Device
{
/// <summary>
/// Gets the underlying drive cylinder, head and index bytes for the specified SCSI LBA.
/// </summary>
/// <param name="buffer">Buffer.</param>
/// <param name="senseBuffer">Sense buffer.</param>
/// <param name="timeout">Timeout.</param>
/// <param name="duration">Duration.</param>
public bool ArchiveCorpRequestBlockAddress(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
buffer = new byte[3];
byte[] cdb = new byte[6];
senseBuffer = new byte[32];
bool sense;
cdb[0] = (byte)ScsiCommands.Archive_RequestBlockAddress;
cdb[4] = 3;
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
DicConsole.DebugWriteLine("SCSI Device", "ARCHIVE CORP. REQUEST BLOCK ADDRESS took {0} ms.", duration);
return sense;
}
/// <summary>
/// Gets the underlying drive cylinder, head and index bytes for the specified SCSI LBA.
/// </summary>
/// <param name="senseBuffer">Sense buffer.</param>
/// <param name="lba">Logical Block Address, starting from 1.</param>
/// <param name="timeout">Timeout.</param>
/// <param name="duration">Duration.</param>
public bool ArchiveCorpSeekBlock(out byte[] senseBuffer, uint lba, uint timeout, out double duration)
{
return ArchiveCorpSeekBlock(out senseBuffer, false, lba, timeout, out duration);
}
/// <summary>
/// Positions the tape at the specified block address
/// </summary>
/// <param name="senseBuffer">Sense buffer.</param>
/// <param name="immediate">If set to <c>true</c>, return from the command immediately.</param>
/// <param name="lba">Logical Block Address, starting from 1.</param>
/// <param name="timeout">Timeout.</param>
/// <param name="duration">Duration.</param>
public bool ArchiveCorpSeekBlock(out byte[] senseBuffer, bool immediate, uint lba, uint timeout, out double duration)
{
byte[] buffer = new byte[0];
byte[] cdb = new byte[6];
senseBuffer = new byte[32];
bool sense;
cdb[0] = (byte)ScsiCommands.Archive_SeekBlock;
cdb[1] = (byte)((lba & 0x1F0000) >> 16);
cdb[2] = (byte)((lba & 0xFF00) >> 8);
cdb[3] = (byte)(lba & 0xFF);
if (immediate)
cdb[1] += 0x01;
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.None, out duration, out sense);
error = lastError != 0;
DicConsole.DebugWriteLine("SCSI Device", "ARCHIVE CORP. SEEK BLOCK took {0} ms.", duration);
return sense;
}
}
}

View File

@@ -60,6 +60,7 @@
<Compile Include="Device\ScsiCommands\SSC.cs" />
<Compile Include="Device\ScsiCommands\SMC.cs" />
<Compile Include="Device\ScsiCommands\Adaptec.cs" />
<Compile Include="Device\ScsiCommands\ArchiveCorp.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@@ -2607,12 +2607,32 @@ namespace DiscImageChef.Devices
#endregion NEC vendor commands
#region Adaptec vendor commands
/// <summary>
/// Translates a SCSI LBA to a drive's CHS
/// </summary>
Adaptec_Translate = 0x0F,
/// <summary>
/// Configures Adaptec controller error threshold
/// </summary>
Adaptec_SetErrorThreshold = 0x10,
/// <summary>
/// Reads and resets error and statistical counters
/// </summary>
Adaptec_ReadCounters = 0x11,
/// <summary>
/// Writes to controller's RAM
/// </summary>
Adaptec_WriteBuffer = 0x13,
Adaptec_ReadBuffer = 0x14
/// <summary>
/// Reads controller's RAM
/// </summary>
Adaptec_ReadBuffer = 0x14,
#endregion Adaptec vendor commands
#region Archive Corp. vendor commands
Archive_RequestBlockAddress = 0x02,
Archive_SeekBlock = 0x0C
#endregion Archive Corp. vendor commands
}
#endregion SCSI Commands