Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions devices/common/ata/atapicdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ void AtapiCdrom::perform_packet_command() {
LOG_F(WARNING, "%s: doing_sector_areas reset", this->name.c_str());
}

// assume successful command execution
this->status_good();
// Assume successful command execution
if (this->cmd_pkt[0] == ScsiCommand::REQ_SENSE) {
// For REQ_SENSE we only set the status, status_good() also resets
// sense_key, which we'll need to return.
this->set_status(ScsiStatus::GOOD, 0);
} else {
this->status_good();
}

switch (this->cmd_pkt[0]) {
case ScsiCommand::READ_CD:
Expand Down
1 change: 1 addition & 0 deletions devices/common/ata/atapicdrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class AtapiCdrom : public AtapiBaseDevice, public ScsiCdromCmds {
}

bool is_device_ready() override { return this->is_ready; }
uint8_t not_ready_reason() override { return ScsiError::MEDIUM_NOT_PRESENT; }

int device_postinit() override;

Expand Down
Loading