Changed the IOCtl implementation of READ TRACK INFORMATION so that it returns if it succeded or failed, so the ATAPI and SCSI controllers can then act accordingly.

This commit is contained in:
OBattler
2016-12-25 17:52:17 +01:00
parent 4d71ebaf67
commit 92c44cb89f
5 changed files with 42 additions and 7 deletions

View File

@@ -1159,6 +1159,7 @@ void SCSICDROM_ReadData(uint8_t id, uint8_t *cdb, uint8_t *data, int datalen)
int read_length = 0;
int max_length = 0;
int track = 0;
int ret = 0;
msf = cdb[1] & 2;
@@ -1567,7 +1568,19 @@ SCSIOut:
if (cdrom->read_track_information)
{
cdrom->read_track_information(SCSIDevices[id].Cdb, SCSIDevices[id].CmdBuffer);
ret = cdrom->read_track_information(SCSIDevices[id].Cdb, SCSIDevices[id].CmdBuffer);
if (!ret)
{
SCSIStatus = SCSI_STATUS_CHECK_CONDITION;
SCSISenseCodeError(SENSE_ILLEGAL_REQUEST, ASC_INV_FIELD_IN_CMD_PACKET, 0x00);
if (SCSISense.UnitAttention)
{
SCSISenseCodeError(SENSE_UNIT_ATTENTION, ASC_MEDIUM_MAY_HAVE_CHANGED, 0);
}
SCSICallback[id]=50*SCSI_TIME;
return;
}
datalen = SCSIDevices[id].CmdBuffer[0];
datalen <<= 8;