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.
This commit is contained in:
joevt 2024-03-10 03:52:48 -07:00 committed by dingusdev
parent f1abb66f9a
commit a48851888f

View File

@ -179,11 +179,15 @@ bool ScsiHardDisk::prepare_data() {
} else { } else {
this->data_buf[0] = ScsiStatus::CHECK_CONDITION; 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; break;
case ScsiPhase::MESSAGE_IN: case ScsiPhase::MESSAGE_IN:
this->data_buf[0] = this->msg_code; 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; break;
default: default:
LOG_F(WARNING, "%s: unexpected phase in prepare_data", this->name.c_str()); LOG_F(WARNING, "%s: unexpected phase in prepare_data", this->name.c_str());