mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Store not only default, but current and changeable modes in SCSI device report.
This commit is contained in:
5
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
5
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
@@ -336,6 +336,8 @@
|
|||||||
<e p="20190102061236_AddMultisessionLeadTest.cs" t="Include" />
|
<e p="20190102061236_AddMultisessionLeadTest.cs" t="Include" />
|
||||||
<e p="20190102230036_AddOptimalReadMultipleCount.Designer.cs" t="Include" />
|
<e p="20190102230036_AddOptimalReadMultipleCount.Designer.cs" t="Include" />
|
||||||
<e p="20190102230036_AddOptimalReadMultipleCount.cs" t="Include" />
|
<e p="20190102230036_AddOptimalReadMultipleCount.cs" t="Include" />
|
||||||
|
<e p="20190108013456_AddChangeableScsiModes.Designer.cs" t="Include" />
|
||||||
|
<e p="20190108013456_AddChangeableScsiModes.cs" t="Include" />
|
||||||
<e p="DicContextModelSnapshot.cs" t="Include" />
|
<e p="DicContextModelSnapshot.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Models" t="Include">
|
<e p="Models" t="Include">
|
||||||
@@ -1864,6 +1866,9 @@
|
|||||||
<e p="201901030344456_AddOptimalReadMultipleCount.Designer.cs" t="Include" />
|
<e p="201901030344456_AddOptimalReadMultipleCount.Designer.cs" t="Include" />
|
||||||
<e p="201901030344456_AddOptimalReadMultipleCount.cs" t="Include" />
|
<e p="201901030344456_AddOptimalReadMultipleCount.cs" t="Include" />
|
||||||
<e p="201901030344456_AddOptimalReadMultipleCount.resx" t="Include" />
|
<e p="201901030344456_AddOptimalReadMultipleCount.resx" t="Include" />
|
||||||
|
<e p="201901081359499_AddChangeableScsiModes.Designer.cs" t="Include" />
|
||||||
|
<e p="201901081359499_AddChangeableScsiModes.cs" t="Include" />
|
||||||
|
<e p="201901081359499_AddChangeableScsiModes.resx" t="Include" />
|
||||||
<e p="Configuration.cs" t="Include" />
|
<e p="Configuration.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Models" t="Include">
|
<e p="Models" t="Include">
|
||||||
|
|||||||
@@ -562,19 +562,23 @@ namespace DiscImageChef.CommonTypes.Metadata
|
|||||||
public Inquiry.SCSIInquiry? Inquiry => Decoders.SCSI.Inquiry.Decode(InquiryData);
|
public Inquiry.SCSIInquiry? Inquiry => Decoders.SCSI.Inquiry.Decode(InquiryData);
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public byte[] InquiryData { get; set; }
|
public byte[] InquiryData { get; set; }
|
||||||
public virtual List<ScsiPage> EVPDPages { get; set; }
|
public virtual List<ScsiPage> EVPDPages { get; set; }
|
||||||
public bool SupportsModeSense6 { get; set; }
|
public bool SupportsModeSense6 { get; set; }
|
||||||
public bool SupportsModeSense10 { get; set; }
|
public bool SupportsModeSense10 { get; set; }
|
||||||
public bool SupportsModeSubpages { get; set; }
|
public bool SupportsModeSubpages { get; set; }
|
||||||
public virtual ScsiMode ModeSense { get; set; }
|
public virtual ScsiMode ModeSense { get; set; }
|
||||||
public virtual Mmc MultiMediaDevice { get; set; }
|
public virtual Mmc MultiMediaDevice { get; set; }
|
||||||
public virtual TestedMedia ReadCapabilities { get; set; }
|
public virtual TestedMedia ReadCapabilities { get; set; }
|
||||||
public virtual List<TestedMedia> RemovableMedias { get; set; }
|
public virtual List<TestedMedia> RemovableMedias { get; set; }
|
||||||
public virtual Ssc SequentialDevice { get; set; }
|
public virtual Ssc SequentialDevice { get; set; }
|
||||||
public byte[] ModeSense6Data { get; set; }
|
public byte[] ModeSense6Data { get; set; }
|
||||||
public byte[] ModeSense10Data { get; set; }
|
public byte[] ModeSense10Data { get; set; }
|
||||||
|
public byte[] ModeSense6CurrentData { get; set; }
|
||||||
|
public byte[] ModeSense10CurrentData { get; set; }
|
||||||
|
public byte[] ModeSense6ChangeableData { get; set; }
|
||||||
|
public byte[] ModeSense10ChangeableData { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScsiMode
|
public class ScsiMode
|
||||||
|
|||||||
@@ -150,6 +150,10 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
{
|
{
|
||||||
Modes.DecodedMode? decMode = null;
|
Modes.DecodedMode? decMode = null;
|
||||||
PeripheralDeviceTypes devType = dev.ScsiType;
|
PeripheralDeviceTypes devType = dev.ScsiType;
|
||||||
|
byte[] mode10Currentbuffer;
|
||||||
|
byte[] mode10Changeablebuffer;
|
||||||
|
byte[] mode6Currentbuffer;
|
||||||
|
byte[] mode6Changeablebuffer;
|
||||||
|
|
||||||
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)...");
|
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)...");
|
||||||
bool sense = dev.ModeSense10(out byte[] mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default,
|
bool sense = dev.ModeSense10(out byte[] mode10Buffer, out _, false, true, ScsiModeSensePageControl.Default,
|
||||||
@@ -164,6 +168,15 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
report.SCSI.SupportsModeSense10 = true;
|
report.SCSI.SupportsModeSense10 = true;
|
||||||
report.SCSI.SupportsModeSubpages = false;
|
report.SCSI.SupportsModeSubpages = false;
|
||||||
decMode = Modes.DecodeMode10(mode10Buffer, devType);
|
decMode = Modes.DecodeMode10(mode10Buffer, devType);
|
||||||
|
if(debug)
|
||||||
|
{
|
||||||
|
sense = dev.ModeSense10(out mode10Currentbuffer, out _, false, true,
|
||||||
|
ScsiModeSensePageControl.Current, 0x3F, 0x00, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer;
|
||||||
|
sense = dev.ModeSense10(out mode10Changeablebuffer, out _, false, true,
|
||||||
|
ScsiModeSensePageControl.Changeable, 0x3F, 0x00, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -171,6 +184,15 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
report.SCSI.SupportsModeSense10 = true;
|
report.SCSI.SupportsModeSense10 = true;
|
||||||
report.SCSI.SupportsModeSubpages = true;
|
report.SCSI.SupportsModeSubpages = true;
|
||||||
decMode = Modes.DecodeMode10(mode10Buffer, devType);
|
decMode = Modes.DecodeMode10(mode10Buffer, devType);
|
||||||
|
if(debug)
|
||||||
|
{
|
||||||
|
sense = dev.ModeSense10(out mode10Currentbuffer, out _, false, true,
|
||||||
|
ScsiModeSensePageControl.Current, 0x3F, 0xFF, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense10CurrentData = mode10Currentbuffer;
|
||||||
|
sense = dev.ModeSense10(out mode10Changeablebuffer, out _, false, true,
|
||||||
|
ScsiModeSensePageControl.Changeable, 0x3F, 0xFF, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense10ChangeableData = mode10Changeablebuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)...");
|
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)...");
|
||||||
@@ -186,8 +208,29 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
DicConsole.WriteLine("Querying SCSI MODE SENSE (6)...");
|
DicConsole.WriteLine("Querying SCSI MODE SENSE (6)...");
|
||||||
sense = dev.ModeSense(out mode6Buffer, out _, dev.Timeout, out _);
|
sense = dev.ModeSense(out mode6Buffer, out _, dev.Timeout, out _);
|
||||||
}
|
}
|
||||||
|
else if(debug)
|
||||||
|
{
|
||||||
|
sense = dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||||
|
0x00, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer;
|
||||||
|
sense = dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable,
|
||||||
|
0x3F, 0x00, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
report.SCSI.SupportsModeSubpages = true;
|
||||||
|
if(debug)
|
||||||
|
{
|
||||||
|
sense = dev.ModeSense6(out mode6Currentbuffer, out _, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||||
|
0xFF, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense6CurrentData = mode6Currentbuffer;
|
||||||
|
sense = dev.ModeSense6(out mode6Changeablebuffer, out _, false, ScsiModeSensePageControl.Changeable,
|
||||||
|
0x3F, 0xFF, dev.Timeout, out _);
|
||||||
|
if(!sense && !dev.Error) report.SCSI.ModeSense6ChangeableData = mode6Changeablebuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else report.SCSI.SupportsModeSubpages = true;
|
|
||||||
|
|
||||||
if(!sense && !dev.Error && !decMode.HasValue) decMode = Modes.DecodeMode6(mode6Buffer, devType);
|
if(!sense && !dev.Error && !decMode.HasValue) decMode = Modes.DecodeMode6(mode6Buffer, devType);
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,8 @@
|
|||||||
<Compile Include="Migrations\20190102061236_AddMultisessionLeadTest.Designer.cs" />
|
<Compile Include="Migrations\20190102061236_AddMultisessionLeadTest.Designer.cs" />
|
||||||
<Compile Include="Migrations\20190102230036_AddOptimalReadMultipleCount.cs" />
|
<Compile Include="Migrations\20190102230036_AddOptimalReadMultipleCount.cs" />
|
||||||
<Compile Include="Migrations\20190102230036_AddOptimalReadMultipleCount.Designer.cs" />
|
<Compile Include="Migrations\20190102230036_AddOptimalReadMultipleCount.Designer.cs" />
|
||||||
|
<Compile Include="Migrations\20190108013456_AddChangeableScsiModes.cs" />
|
||||||
|
<Compile Include="Migrations\20190108013456_AddChangeableScsiModes.Designer.cs" />
|
||||||
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
||||||
<Compile Include="Models\CdOffset.cs" />
|
<Compile Include="Models\CdOffset.cs" />
|
||||||
<Compile Include="Models\Command.cs" />
|
<Compile Include="Models\Command.cs" />
|
||||||
|
|||||||
1569
DiscImageChef.Database/Migrations/20190108013456_AddChangeableScsiModes.Designer.cs
generated
Normal file
1569
DiscImageChef.Database/Migrations/20190108013456_AddChangeableScsiModes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Database.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddChangeableScsiModes : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<byte[]>("ModeSense10ChangeableData", "Scsi", nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<byte[]>("ModeSense10CurrentData", "Scsi", nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<byte[]>("ModeSense6ChangeableData", "Scsi", nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<byte[]>("ModeSense6CurrentData", "Scsi", nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn("ModeSense10ChangeableData", "Scsi");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn("ModeSense10CurrentData", "Scsi");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn("ModeSense6ChangeableData", "Scsi");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn("ModeSense6CurrentData", "Scsi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "2.1.4-rtm-31024");
|
modelBuilder.HasAnnotation("ProductVersion", "2.2.0-rtm-35687");
|
||||||
|
|
||||||
modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Ata", b =>
|
modelBuilder.Entity("DiscImageChef.CommonTypes.Metadata.Ata", b =>
|
||||||
{
|
{
|
||||||
@@ -439,8 +439,16 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
|
|
||||||
b.Property<byte[]>("InquiryData");
|
b.Property<byte[]>("InquiryData");
|
||||||
|
|
||||||
|
b.Property<byte[]>("ModeSense10ChangeableData");
|
||||||
|
|
||||||
|
b.Property<byte[]>("ModeSense10CurrentData");
|
||||||
|
|
||||||
b.Property<byte[]>("ModeSense10Data");
|
b.Property<byte[]>("ModeSense10Data");
|
||||||
|
|
||||||
|
b.Property<byte[]>("ModeSense6ChangeableData");
|
||||||
|
|
||||||
|
b.Property<byte[]>("ModeSense6CurrentData");
|
||||||
|
|
||||||
b.Property<byte[]>("ModeSense6Data");
|
b.Property<byte[]>("ModeSense6Data");
|
||||||
|
|
||||||
b.Property<int?>("ModeSenseId");
|
b.Property<int?>("ModeSenseId");
|
||||||
|
|||||||
@@ -109,11 +109,15 @@ namespace DiscImageChef.Dto
|
|||||||
|
|
||||||
if(SCSI != null)
|
if(SCSI != null)
|
||||||
{
|
{
|
||||||
SCSI.EVPDPages = null;
|
SCSI.EVPDPages = null;
|
||||||
SCSI.InquiryData = null;
|
SCSI.InquiryData = null;
|
||||||
SCSI.ModeSense6Data = null;
|
SCSI.ModeSense6Data = null;
|
||||||
SCSI.ModeSense10Data = null;
|
SCSI.ModeSense10Data = null;
|
||||||
SCSI.ReadCapabilities = ClearBinaries(SCSI.ReadCapabilities);
|
SCSI.ModeSense6CurrentData = null;
|
||||||
|
SCSI.ModeSense10CurrentData = null;
|
||||||
|
SCSI.ModeSense6ChangeableData = null;
|
||||||
|
SCSI.ModeSense10ChangeableData = null;
|
||||||
|
SCSI.ReadCapabilities = ClearBinaries(SCSI.ReadCapabilities);
|
||||||
|
|
||||||
if(SCSI.ModeSense != null)
|
if(SCSI.ModeSense != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -265,6 +265,10 @@
|
|||||||
<Compile Include="Migrations\201901030344456_AddOptimalReadMultipleCount.Designer.cs">
|
<Compile Include="Migrations\201901030344456_AddOptimalReadMultipleCount.Designer.cs">
|
||||||
<DependentUpon>201901030344456_AddOptimalReadMultipleCount.cs</DependentUpon>
|
<DependentUpon>201901030344456_AddOptimalReadMultipleCount.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\201901081359499_AddChangeableScsiModes.cs" />
|
||||||
|
<Compile Include="Migrations\201901081359499_AddChangeableScsiModes.Designer.cs">
|
||||||
|
<DependentUpon>201901081359499_AddChangeableScsiModes.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Models\CdOffset.cs" />
|
<Compile Include="Models\CdOffset.cs" />
|
||||||
<Compile Include="Models\Command.cs" />
|
<Compile Include="Models\Command.cs" />
|
||||||
@@ -394,6 +398,9 @@
|
|||||||
<EmbeddedResource Include="Migrations\201901030344456_AddOptimalReadMultipleCount.resx">
|
<EmbeddedResource Include="Migrations\201901030344456_AddOptimalReadMultipleCount.resx">
|
||||||
<DependentUpon>201901030344456_AddOptimalReadMultipleCount.cs</DependentUpon>
|
<DependentUpon>201901030344456_AddOptimalReadMultipleCount.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\201901081359499_AddChangeableScsiModes.resx">
|
||||||
|
<DependentUpon>201901081359499_AddChangeableScsiModes.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
|
|||||||
29
DiscImageChef.Server/Migrations/201901081359499_AddChangeableScsiModes.Designer.cs
generated
Normal file
29
DiscImageChef.Server/Migrations/201901081359499_AddChangeableScsiModes.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace DiscImageChef.Server.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||||
|
public sealed partial class AddChangeableScsiModes : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddChangeableScsiModes));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "201901081359499_AddChangeableScsiModes"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Server.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddChangeableScsiModes : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.Scsis", "ModeSense6CurrentData", c => c.Binary());
|
||||||
|
AddColumn("dbo.Scsis", "ModeSense10CurrentData", c => c.Binary());
|
||||||
|
AddColumn("dbo.Scsis", "ModeSense6ChangeableData", c => c.Binary());
|
||||||
|
AddColumn("dbo.Scsis", "ModeSense10ChangeableData", c => c.Binary());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.Scsis", "ModeSense10ChangeableData");
|
||||||
|
DropColumn("dbo.Scsis", "ModeSense6ChangeableData");
|
||||||
|
DropColumn("dbo.Scsis", "ModeSense10CurrentData");
|
||||||
|
DropColumn("dbo.Scsis", "ModeSense6CurrentData");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user