scsicdrom: Move mode_select_6.

Make it a separate method like scsihd. It also checks the incoming param size. If it's zero then the phase is not switched. Is that wrong? Still probably unfinished.
This commit is contained in:
joevt 2024-03-10 00:13:38 -08:00 committed by dingusdev
parent e17a96f5ec
commit a79f07e4dc
2 changed files with 16 additions and 2 deletions

View File

@ -84,8 +84,7 @@ void ScsiCdrom::process_command()
this->illegal_command(cmd);
break;
case ScsiCommand::MODE_SELECT_6:
this->incoming_size = cmd[4];
this->switch_phase(ScsiPhase::DATA_OUT);
this->mode_select_6(cmd[4]);
break;
case ScsiCommand::RELEASE_UNIT:
this->illegal_command(cmd);
@ -281,6 +280,19 @@ void ScsiCdrom::mode_sense_6()
this->switch_phase(ScsiPhase::DATA_IN);
}
int ScsiCdrom::mode_select_6(uint8_t param_len)
{
if (param_len == 0) {
return 0x0;
}
else {
LOG_F(ERROR, "Mode Select calling for param length of: %d", param_len);
this->incoming_size = param_len;
this->switch_phase(ScsiPhase::DATA_OUT);
return param_len;
}
}
void ScsiCdrom::read_toc()
{
int tot_tracks;

View File

@ -45,6 +45,8 @@ protected:
int test_unit_ready();
void read(uint32_t lba, uint16_t nblocks, uint8_t cmd_len);
void inquiry();
int mode_select_6(uint8_t param_len);
void mode_sense_6();
void read_toc();
void read_capacity_10();