From a48851888fb01dd31379ca6bcdc9acf54f21a59a Mon Sep 17 00:00:00 2001 From: joevt Date: Sun, 10 Mar 2024 03:52:48 -0700 Subject: [PATCH] scsihd: Setup data_ptr for STATUS and MESSAGE_IN. bytes_out is used instead of the removed cur_buf_cnt. data_ptr is setup by prepare_data instead of process_command. Not sure why scsicdrom doesn't set bytes_out in prepare_data. --- devices/common/scsi/scsihd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devices/common/scsi/scsihd.cpp b/devices/common/scsi/scsihd.cpp index 9a3d06d..90226a4 100644 --- a/devices/common/scsi/scsihd.cpp +++ b/devices/common/scsi/scsihd.cpp @@ -179,11 +179,15 @@ bool ScsiHardDisk::prepare_data() { } else { this->data_buf[0] = ScsiStatus::CHECK_CONDITION; } - this->data_size = 1; + this->bytes_out = 1; + this->data_ptr = (uint8_t*)this->data_buf; + this->data_size = this->bytes_out; break; case ScsiPhase::MESSAGE_IN: this->data_buf[0] = this->msg_code; - this->data_size = 1; + this->bytes_out = 1; + this->data_ptr = (uint8_t*)this->data_buf; + this->data_size = this->bytes_out; break; default: LOG_F(WARNING, "%s: unexpected phase in prepare_data", this->name.c_str());