mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-25 03:32:16 +00:00
All Sense/ASC/ASCQ data is cleared properly (#367)
* All Sense/ASC/ASCQ data is cleared properly * Forgot to guard the status clear for REQUEST SENSE Co-authored-by: Troy <jokker@gmail.com>
This commit is contained in:
parent
ac4abbbe73
commit
40432c9de0
@ -355,6 +355,12 @@ void SASIDEV::Execute()
|
||||
ctrl.blocks = 1;
|
||||
ctrl.execstart = SysTimer::GetTimerLow();
|
||||
|
||||
// Discard pending sense data from the previous command if the current command is not REQUEST SENSE
|
||||
if(SASIDEV::eCmdRequestSense != (SASIDEV::sasi_command)ctrl.cmd[0]) {
|
||||
ctrl.status = 0;
|
||||
ctrl.device->SetStatusCode(0);
|
||||
}
|
||||
|
||||
// Process by command
|
||||
// TODO This code does not belong here. Each device type needs such a dispatcher, which the controller has to call.
|
||||
switch ((SASIDEV::sasi_command)ctrl.cmd[0]) {
|
||||
|
@ -262,6 +262,11 @@ void SCSIDEV::Execute()
|
||||
|
||||
ctrl.device = ctrl.unit[lun];
|
||||
|
||||
// Discard pending sense data from the previous command
|
||||
if ((SCSIDEV::scsi_command)ctrl.cmd[0] != eCmdRequestSense) {
|
||||
ctrl.device->SetStatusCode(0);
|
||||
}
|
||||
|
||||
if (!ctrl.device->Dispatch(this)) {
|
||||
LOGTRACE("ID %d LUN %d received unsupported command: $%02X", GetSCSIID(), lun, (BYTE)ctrl.cmd[0]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user