Updated delegation for TEST UNIT READY and REZERO

This commit is contained in:
Uwe Seimet 2021-08-23 12:36:35 +02:00
parent bc0f419530
commit a79fdc0f67
3 changed files with 5 additions and 33 deletions

View File

@ -668,15 +668,7 @@ void SASIDEV::CmdTestUnitReady()
LOGTRACE("%s TEST UNIT READY Command ", __PRETTY_FUNCTION__);
// Command processing on drive
bool status = ((Disk *)ctrl.device)->TestUnitReady(ctrl.cmd);
if (!status) {
// Failure (Error)
Error();
return;
}
// status phase
Status();
ctrl.device->TestUnitReady(this);
}
//---------------------------------------------------------------------------
@ -689,15 +681,7 @@ void SASIDEV::CmdRezero()
LOGTRACE( "%s REZERO UNIT Command ", __PRETTY_FUNCTION__);
// Command processing on drive
bool status = ctrl.device->Rezero(ctrl.cmd);
if (!status) {
// Failure (Error)
Error();
return;
}
// status phase
Status();
ctrl.device->Rezero(this);
}
//---------------------------------------------------------------------------

View File

@ -355,7 +355,7 @@ BOOL DiskTrack::Read(BYTE *buf, int sec) const
void Disk::TestUnitReady(SASIDEV *controller)
{
bool status = TestUnitReady(ctrl->cmd);
bool status = CheckReady();
if (!status) {
// Failure (Error)
controller->Error();
@ -368,7 +368,7 @@ void Disk::TestUnitReady(SASIDEV *controller)
void Disk::Rezero(SASIDEV *controller)
{
bool status = Rezero(ctrl->cmd);
bool status = CheckReady();
if (!status) {
// Failure (Error)
controller->Error();
@ -1974,17 +1974,6 @@ bool Disk::TestUnitReady(const DWORD* /*cdb*/)
return CheckReady();
}
//---------------------------------------------------------------------------
//
// REZERO UNIT
//
//---------------------------------------------------------------------------
bool Disk::Rezero(const DWORD* /*cdb*/)
{
// Status check
return CheckReady();
}
//---------------------------------------------------------------------------
//
// FORMAT UNIT

View File

@ -227,9 +227,8 @@ public:
void SetBlockCount(DWORD);
bool GetStartAndCount(SASIDEV *, uint64_t&, uint32_t&, bool);
// TODO Try to get rid of these methods, which are currently used by SASIDEV
// TODO Try to get rid of these methods
virtual bool TestUnitReady(const DWORD *cdb); // TEST UNIT READY command
bool Rezero(const DWORD *cdb); // REZERO command
virtual int RequestSense(const DWORD *cdb, BYTE *buf); // REQUEST SENSE command
virtual bool ModeSelect(const DWORD *cdb, const BYTE *buf, int length);// MODE SELECT command
virtual int ModeSense(const DWORD *cdb, BYTE *buf); // MODE SENSE command