From 18871057748ec86e4463395976e83f9c37a4f143 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Tue, 24 Aug 2021 14:14:45 +0200 Subject: [PATCH] Code review --- src/raspberrypi/controllers/sasidev_ctrl.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/raspberrypi/controllers/sasidev_ctrl.cpp b/src/raspberrypi/controllers/sasidev_ctrl.cpp index 7ea356da..ca0f45a3 100644 --- a/src/raspberrypi/controllers/sasidev_ctrl.cpp +++ b/src/raspberrypi/controllers/sasidev_ctrl.cpp @@ -412,10 +412,13 @@ void SASIDEV::Execute() CmdReleaseUnit(); return; - // SPECIFY + // SPECIFY (SASI only) + // This doesn't exist in the SCSI Spec, but was in the original RaSCSI code. + // leaving it here for now.... case SASIDEV::eCmdInvalid: CmdSpecify(); return; + default: break; } @@ -455,6 +458,8 @@ void SASIDEV::Status() SysTimer::SleepUsec(5); } + LOGTRACE("%s Status phase", __PRETTY_FUNCTION__); + // Phase Setting ctrl.phase = BUS::status; @@ -680,15 +685,8 @@ void SASIDEV::CmdRequestSense() { LOGTRACE( "%s REQUEST SENSE Command ", __PRETTY_FUNCTION__); - // Logical Unit - DWORD lun = (ctrl.cmd[1] >> 5) & 0x07; - if (!ctrl.unit[lun]) { - Error(); - return; - } - // Command processing on drive - ctrl.unit[lun]->RequestSense(this); + ctrl.device->RequestSense(this); } //--------------------------------------------------------------------------- @@ -775,9 +773,6 @@ void SASIDEV::CmdRead6() // Command processing on drive ctrl.length = ctrl.device->Read(ctrl.cmd, ctrl.buffer, record); - LOGTRACE("%s ctrl.length is %d", __PRETTY_FUNCTION__, (int)ctrl.length); - - // The DaynaPort will respond a status of 0x02 when a read of size 1 occurs. if (ctrl.length <= 0) { // Failure (Error) Error();