mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-24 12:30:20 +00:00
SCSI interface updated, added Synchronize16
This commit is contained in:
parent
b0bc2d6261
commit
c08b1abfa9
@ -720,7 +720,7 @@ void SASIDEV::CmdFormat()
|
|||||||
LOGTRACE( "%s FORMAT UNIT Command ", __PRETTY_FUNCTION__);
|
LOGTRACE( "%s FORMAT UNIT Command ", __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
// Command processing on drive
|
// Command processing on drive
|
||||||
ctrl.device->Format(this);
|
ctrl.device->FormatUnit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -51,9 +51,8 @@ public:
|
|||||||
eCmdRead10 = 0x28,
|
eCmdRead10 = 0x28,
|
||||||
eCmdWrite10 = 0x2A,
|
eCmdWrite10 = 0x2A,
|
||||||
eCmdSeek10 = 0x2B,
|
eCmdSeek10 = 0x2B,
|
||||||
eCmdVerify10 = 0x2E,
|
eCmdVerify10 = 0x2F,
|
||||||
eCmdVerify = 0x2F,
|
eCmdSynchronizeCache10 = 0x35,
|
||||||
eCmdSynchronizeCache = 0x35,
|
|
||||||
eCmdReadDefectData10 = 0x37,
|
eCmdReadDefectData10 = 0x37,
|
||||||
eCmdReadToc = 0x43,
|
eCmdReadToc = 0x43,
|
||||||
eCmdPlayAudio10 = 0x45,
|
eCmdPlayAudio10 = 0x45,
|
||||||
@ -67,6 +66,7 @@ public:
|
|||||||
eCmdRead16 = 0x88,
|
eCmdRead16 = 0x88,
|
||||||
eCmdWrite16 = 0x8A,
|
eCmdWrite16 = 0x8A,
|
||||||
eCmdVerify16 = 0x8F,
|
eCmdVerify16 = 0x8F,
|
||||||
|
eCmdSynchronizeCache16 = 0x91,
|
||||||
eCmdReadCapacity16 = 0x9E,
|
eCmdReadCapacity16 = 0x9E,
|
||||||
eCmdReportLuns = 0xA0
|
eCmdReportLuns = 0xA0
|
||||||
};
|
};
|
||||||
|
@ -26,18 +26,27 @@ public:
|
|||||||
virtual void TestUnitReady(SASIDEV *) override = 0;
|
virtual void TestUnitReady(SASIDEV *) override = 0;
|
||||||
virtual void Inquiry(SASIDEV *) override = 0;
|
virtual void Inquiry(SASIDEV *) override = 0;
|
||||||
virtual void ReportLuns(SASIDEV *) override = 0;
|
virtual void ReportLuns(SASIDEV *) override = 0;
|
||||||
virtual void Format(SASIDEV *) = 0;
|
virtual void FormatUnit(SASIDEV *) = 0;
|
||||||
virtual void ReadCapacity10(SASIDEV *) = 0;
|
virtual void ReadCapacity10(SASIDEV *) = 0;
|
||||||
virtual void ReadCapacity16(SASIDEV *) = 0;
|
virtual void ReadCapacity16(SASIDEV *) = 0;
|
||||||
virtual void Read10(SASIDEV *) = 0;
|
virtual void Read10(SASIDEV *) = 0;
|
||||||
virtual void Read16(SASIDEV *) = 0;
|
virtual void Read16(SASIDEV *) = 0;
|
||||||
virtual void Write10(SASIDEV *) = 0;
|
virtual void Write10(SASIDEV *) = 0;
|
||||||
virtual void Write16(SASIDEV *) = 0;
|
virtual void Write16(SASIDEV *) = 0;
|
||||||
|
|
||||||
virtual void RequestSense(SASIDEV *) override = 0;
|
virtual void RequestSense(SASIDEV *) override = 0;
|
||||||
|
|
||||||
|
// Implemented optional commands
|
||||||
|
virtual void Verify10(SASIDEV *) = 0;
|
||||||
|
// virtual void Verify16(SASIDEV *) = 0;
|
||||||
virtual void ModeSense(SASIDEV *) override = 0;
|
virtual void ModeSense(SASIDEV *) override = 0;
|
||||||
virtual void ModeSense10(SASIDEV *) override = 0;
|
virtual void ModeSense10(SASIDEV *) override = 0;
|
||||||
virtual void ModeSelect(SASIDEV *) override = 0;
|
virtual void ModeSelect(SASIDEV *) override = 0;
|
||||||
|
virtual void ModeSelect10(SASIDEV *) override = 0;
|
||||||
|
virtual void ReassignBlocks(SASIDEV *) = 0;
|
||||||
|
virtual void SendDiagnostic(SASIDEV *) = 0;
|
||||||
|
virtual void StartStopUnit(SASIDEV *) = 0;
|
||||||
|
virtual void SynchronizeCache10(SASIDEV *) = 0;
|
||||||
|
virtual void SynchronizeCache16(SASIDEV *) = 0;
|
||||||
|
|
||||||
// TODO Add the other optional commands currently implemented
|
// TODO Add the other optional commands currently implemented
|
||||||
};
|
};
|
||||||
|
@ -402,7 +402,7 @@ void Disk::RequestSense(SASIDEV *controller)
|
|||||||
controller->DataIn();
|
controller->DataIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Disk::Format(SASIDEV *controller)
|
void Disk::FormatUnit(SASIDEV *controller)
|
||||||
{
|
{
|
||||||
bool status = Format(ctrl->cmd);
|
bool status = Format(ctrl->cmd);
|
||||||
if (!status) {
|
if (!status) {
|
||||||
@ -654,7 +654,7 @@ void Disk::Write16(SASIDEV *controller)
|
|||||||
// VERIFY
|
// VERIFY
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
void Disk::Verify(SASIDEV *controller)
|
void Disk::Verify10(SASIDEV *controller)
|
||||||
{
|
{
|
||||||
// Get record number and block number
|
// Get record number and block number
|
||||||
uint64_t record;
|
uint64_t record;
|
||||||
@ -819,7 +819,7 @@ void Disk::PreventAllowRemoval(SASIDEV *controller)
|
|||||||
controller->Status();
|
controller->Status();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Disk::SynchronizeCache(SASIDEV *controller)
|
void Disk::SynchronizeCache10(SASIDEV *controller)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
|
|
||||||
@ -827,6 +827,11 @@ void Disk::SynchronizeCache(SASIDEV *controller)
|
|||||||
controller->Status();
|
controller->Status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Disk::SynchronizeCache16(SASIDEV *controller)
|
||||||
|
{
|
||||||
|
return SynchronizeCache10(controller);
|
||||||
|
}
|
||||||
|
|
||||||
void Disk::ReadDefectData10(SASIDEV *controller)
|
void Disk::ReadDefectData10(SASIDEV *controller)
|
||||||
{
|
{
|
||||||
ctrl->length = ReadDefectData10(ctrl->cmd, ctrl->buffer);
|
ctrl->length = ReadDefectData10(ctrl->cmd, ctrl->buffer);
|
||||||
@ -1161,7 +1166,7 @@ Disk::Disk(const std::string id) : BlockDevice(id)
|
|||||||
AddCommand(SCSIDEV::eCmdTestUnitReady, "CmdTestUnitReady", &Disk::TestUnitReady);
|
AddCommand(SCSIDEV::eCmdTestUnitReady, "CmdTestUnitReady", &Disk::TestUnitReady);
|
||||||
AddCommand(SCSIDEV::eCmdRezero, "CmdRezero", &Disk::Rezero);
|
AddCommand(SCSIDEV::eCmdRezero, "CmdRezero", &Disk::Rezero);
|
||||||
AddCommand(SCSIDEV::eCmdRequestSense, "CmdRequestSense", &Disk::RequestSense);
|
AddCommand(SCSIDEV::eCmdRequestSense, "CmdRequestSense", &Disk::RequestSense);
|
||||||
AddCommand(SCSIDEV::eCmdFormat, "CmdFormat", &Disk::Format);
|
AddCommand(SCSIDEV::eCmdFormat, "CmdFormat", &Disk::FormatUnit);
|
||||||
AddCommand(SCSIDEV::eCmdReassign, "CmdReassign", &Disk::ReassignBlocks);
|
AddCommand(SCSIDEV::eCmdReassign, "CmdReassign", &Disk::ReassignBlocks);
|
||||||
AddCommand(SCSIDEV::eCmdRead6, "CmdRead6", &Disk::Read6);
|
AddCommand(SCSIDEV::eCmdRead6, "CmdRead6", &Disk::Read6);
|
||||||
AddCommand(SCSIDEV::eCmdWrite6, "CmdWrite6", &Disk::Write6);
|
AddCommand(SCSIDEV::eCmdWrite6, "CmdWrite6", &Disk::Write6);
|
||||||
@ -1179,8 +1184,9 @@ Disk::Disk(const std::string id) : BlockDevice(id)
|
|||||||
AddCommand(SCSIDEV::eCmdWrite10, "CmdWrite10", &Disk::Write10);
|
AddCommand(SCSIDEV::eCmdWrite10, "CmdWrite10", &Disk::Write10);
|
||||||
AddCommand(SCSIDEV::eCmdVerify10, "CmdVerify10", &Disk::Write10);
|
AddCommand(SCSIDEV::eCmdVerify10, "CmdVerify10", &Disk::Write10);
|
||||||
AddCommand(SCSIDEV::eCmdSeek10, "CmdSeek10", &Disk::Seek10);
|
AddCommand(SCSIDEV::eCmdSeek10, "CmdSeek10", &Disk::Seek10);
|
||||||
AddCommand(SCSIDEV::eCmdVerify, "CmdVerify", &Disk::Verify);
|
AddCommand(SCSIDEV::eCmdVerify10, "CmdVerify10", &Disk::Verify10);
|
||||||
AddCommand(SCSIDEV::eCmdSynchronizeCache, "CmdSynchronizeCache", &Disk::SynchronizeCache);
|
AddCommand(SCSIDEV::eCmdSynchronizeCache10, "CmdSynchronizeCache10", &Disk::SynchronizeCache10);
|
||||||
|
AddCommand(SCSIDEV::eCmdSynchronizeCache16, "CmdSynchronizeCache16", &Disk::SynchronizeCache16);
|
||||||
AddCommand(SCSIDEV::eCmdReadDefectData10, "CmdReadDefectData10", &Disk::ReadDefectData10);
|
AddCommand(SCSIDEV::eCmdReadDefectData10, "CmdReadDefectData10", &Disk::ReadDefectData10);
|
||||||
AddCommand(SCSIDEV::eCmdModeSelect10, "CmdModeSelect10", &Disk::ModeSelect10);
|
AddCommand(SCSIDEV::eCmdModeSelect10, "CmdModeSelect10", &Disk::ModeSelect10);
|
||||||
AddCommand(SCSIDEV::eCmdReserve10, "CmdReserve10", &Disk::Reserve10);
|
AddCommand(SCSIDEV::eCmdReserve10, "CmdReserve10", &Disk::Reserve10);
|
||||||
@ -1188,7 +1194,7 @@ Disk::Disk(const std::string id) : BlockDevice(id)
|
|||||||
AddCommand(SCSIDEV::eCmdModeSense10, "CmdModeSense10", &Disk::ModeSense10);
|
AddCommand(SCSIDEV::eCmdModeSense10, "CmdModeSense10", &Disk::ModeSense10);
|
||||||
AddCommand(SCSIDEV::eCmdRead16, "CmdRead16", &Disk::Read16);
|
AddCommand(SCSIDEV::eCmdRead16, "CmdRead16", &Disk::Read16);
|
||||||
AddCommand(SCSIDEV::eCmdWrite16, "CmdWrite16", &Disk::Write16);
|
AddCommand(SCSIDEV::eCmdWrite16, "CmdWrite16", &Disk::Write16);
|
||||||
AddCommand(SCSIDEV::eCmdVerify16, "CmdVerify16", &Disk::Write16);
|
//AddCommand(SCSIDEV::eCmdVerify16, "CmdVerify16", &Disk::Verify16);
|
||||||
AddCommand(SCSIDEV::eCmdReadCapacity16, "CmdReadCapacity16", &Disk::ReadCapacity16);
|
AddCommand(SCSIDEV::eCmdReadCapacity16, "CmdReadCapacity16", &Disk::ReadCapacity16);
|
||||||
AddCommand(SCSIDEV::eCmdReportLuns, "CmdReportLuns", &Disk::ReportLuns);
|
AddCommand(SCSIDEV::eCmdReportLuns, "CmdReportLuns", &Disk::ReportLuns);
|
||||||
}
|
}
|
||||||
|
@ -172,12 +172,13 @@ public:
|
|||||||
void ModeSense(SASIDEV *);
|
void ModeSense(SASIDEV *);
|
||||||
void ModeSense10(SASIDEV *);
|
void ModeSense10(SASIDEV *);
|
||||||
void Rezero(SASIDEV *);
|
void Rezero(SASIDEV *);
|
||||||
void Format(SASIDEV *) override;
|
void FormatUnit(SASIDEV *) override;
|
||||||
void ReassignBlocks(SASIDEV *);
|
void ReassignBlocks(SASIDEV *);
|
||||||
void StartStopUnit(SASIDEV *);
|
void StartStopUnit(SASIDEV *);
|
||||||
void SendDiagnostic(SASIDEV *);
|
void SendDiagnostic(SASIDEV *);
|
||||||
void PreventAllowRemoval(SASIDEV *);
|
void PreventAllowRemoval(SASIDEV *);
|
||||||
void SynchronizeCache(SASIDEV *);
|
void SynchronizeCache10(SASIDEV *);
|
||||||
|
void SynchronizeCache16(SASIDEV *);
|
||||||
void ReadDefectData10(SASIDEV *);
|
void ReadDefectData10(SASIDEV *);
|
||||||
void Read6(SASIDEV *);
|
void Read6(SASIDEV *);
|
||||||
void Read10(SASIDEV *) override;
|
void Read10(SASIDEV *) override;
|
||||||
@ -185,6 +186,7 @@ public:
|
|||||||
void Write6(SASIDEV *);
|
void Write6(SASIDEV *);
|
||||||
void Write10(SASIDEV *) override;
|
void Write10(SASIDEV *) override;
|
||||||
void Write16(SASIDEV *) override;
|
void Write16(SASIDEV *) override;
|
||||||
|
void Verify10(SASIDEV *) override;
|
||||||
void Seek(SASIDEV *);
|
void Seek(SASIDEV *);
|
||||||
void Seek6(SASIDEV *);
|
void Seek6(SASIDEV *);
|
||||||
void Seek10(SASIDEV *);
|
void Seek10(SASIDEV *);
|
||||||
@ -197,7 +199,6 @@ public:
|
|||||||
void Release10(SASIDEV *);
|
void Release10(SASIDEV *);
|
||||||
|
|
||||||
// Command helpers
|
// Command helpers
|
||||||
void Verify(SASIDEV *); // VERIFY command
|
|
||||||
virtual int Inquiry(const DWORD *cdb, BYTE *buf) = 0; // INQUIRY command
|
virtual int Inquiry(const DWORD *cdb, BYTE *buf) = 0; // INQUIRY command
|
||||||
virtual int WriteCheck(DWORD block); // WRITE check
|
virtual int WriteCheck(DWORD block); // WRITE check
|
||||||
virtual bool Write(const DWORD *cdb, const BYTE *buf, DWORD block); // WRITE command
|
virtual bool Write(const DWORD *cdb, const BYTE *buf, DWORD block); // WRITE command
|
||||||
|
@ -32,4 +32,5 @@ public:
|
|||||||
virtual void ModeSense(SASIDEV *) = 0;
|
virtual void ModeSense(SASIDEV *) = 0;
|
||||||
virtual void ModeSense10(SASIDEV *) = 0;
|
virtual void ModeSense10(SASIDEV *) = 0;
|
||||||
virtual void ModeSelect(SASIDEV *) = 0;
|
virtual void ModeSelect(SASIDEV *) = 0;
|
||||||
|
virtual void ModeSelect10(SASIDEV *) = 0;
|
||||||
};
|
};
|
||||||
|
@ -1612,7 +1612,7 @@ BUS::phase_t GPIOBUS::GetPhaseRaw(DWORD raw_data)
|
|||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
int GPIOBUS::GetCommandByteCount(BYTE opcode) {
|
int GPIOBUS::GetCommandByteCount(BYTE opcode) {
|
||||||
if (opcode == 0x88 || opcode == 0x8A || opcode == 0x8F || opcode == 0x9E) {
|
if (opcode == 0x88 || opcode == 0x8A || opcode == 0x8F || opcode == 0x91 || opcode == 0x9E) {
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
else if (opcode == 0xA0) {
|
else if (opcode == 0xA0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user