Start vendor-specific SCSI commands

This commit is contained in:
dingusdev
2026-01-12 22:11:11 -07:00
parent 742a810624
commit e3839bdea6
2 changed files with 21 additions and 0 deletions
+6
View File
@@ -143,6 +143,12 @@ enum ScsiCommand : uint8_t {
READ_TOC = 0x43,
SET_CD_SPEED = 0xBB,
READ_CD = 0xBE,
// vendor specific commands
VENDOR_09 = 0x09,
EJECT = 0xC0,
READ_CDDA = 0xD8, //TOSHIBA
READ_CDDA_MSF = 0xD9, //TOSHIBA
};
enum ScsiSense : int {
+15
View File
@@ -45,6 +45,8 @@ void ScsiCdrom::process_command()
{
uint32_t lba;
uint32_t cdda_start, cdda_end, cdda_len;
this->pre_xfer_action = nullptr;
this->post_xfer_action = nullptr;
@@ -98,6 +100,19 @@ void ScsiCdrom::process_command()
this->switch_phase(ScsiPhase::DATA_IN);
}
break;
case ScsiCommand::READ_CDDA:
lba = READ_DWORD_BE_U(&cmd[2]);
cdda_len = READ_DWORD_BE_U(&cmd[6]);
this->read(lba, cdda_len, 12);
break;
case ScsiCommand::READ_CDDA_MSF:
cdda_start = (cmd[3] * 60 * 75) + (cmd[4] * 75) + cmd[5];
cdda_end = (cmd[7] * 60 * 75) + (cmd[8] * 75) + cmd[9];
cdda_len = (cdda_end > cdda_start) ? (cdda_end - cdda_start) : 0;
this->read(cdda_start, cdda_len, 12);
break;
default:
LOG_F(ERROR, "%s: unsupported command 0x%X", this->name.c_str(), cmd[0]);
this->illegal_command(cmd);