REQUEST SENSE now correctly delays the reporting of UNIT ATTENTION if another error is pending, unless the error is not ready and the REQUEST SENSE is a standalone command;
The SCSI-specific auto-REQUEST SENSE now no longer advances UNIT ATTENTION phase, making sure the next command will report UNIT ATTENTION.
This commit is contained in:
@@ -1637,7 +1637,7 @@ static void BuslogicSenseBufferFree(BuslogicRequests_t *BuslogicRequests, int Co
|
||||
{
|
||||
BuslogicLog("BuslogicSenseBufferFree(): Writing %i bytes at %08X\n", SenseLength, SenseBufferAddress);
|
||||
DMAPageWrite(SenseBufferAddress, temp_sense, SenseLength);
|
||||
BuslogicLog("First 8 bytes of written sense data: %02X %02X %02X\n", temp_sense[2], temp_sense[12], temp_sense[13]);
|
||||
BuslogicLog("Sense data written to buffer: %02X %02X %02X\n", temp_sense[2], temp_sense[12], temp_sense[13]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
src/cdrom.c
16
src/cdrom.c
@@ -1590,7 +1590,7 @@ void cdrom_request_sense(uint8_t id, uint8_t *buffer, uint8_t alloc_length)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cdrom[id].unit_attention)
|
||||
if (cdrom[id].unit_attention && (cdrom_sense_key == 0))
|
||||
{
|
||||
buffer[2]=SENSE_UNIT_ATTENTION;
|
||||
buffer[12]=ASC_MEDIUM_MAY_HAVE_CHANGED;
|
||||
@@ -1631,13 +1631,7 @@ void cdrom_request_sense_for_scsi(uint8_t id, uint8_t *buffer, uint8_t alloc_len
|
||||
cdrom[id].unit_attention = 0;
|
||||
}
|
||||
|
||||
/* If the UNIT ATTENTION condition is set and the command does not allow
|
||||
execution under it, error out and report the condition. */
|
||||
if (cdrom[id].unit_attention == 1)
|
||||
{
|
||||
// cdrom_log("CD-ROM %i: Unit attention now 2\n", id);
|
||||
cdrom[id].unit_attention = 2;
|
||||
}
|
||||
/* Do *NOT* advance the unit attention phase. */
|
||||
|
||||
cdrom_request_sense(id, buffer, alloc_length);
|
||||
}
|
||||
@@ -1736,6 +1730,12 @@ void cdrom_command(uint8_t id, uint8_t *cdb)
|
||||
break;
|
||||
|
||||
case GPCMD_REQUEST_SENSE:
|
||||
/* If there's a unit attention condition and there's a buffered not ready, a standalone REQUEST SENSE
|
||||
should forget about the not ready, and report unit attention straight away. */
|
||||
if (cdrom[id].unit_attention && (cdrom_sense_key == 2))
|
||||
{
|
||||
cdrom_sense_key = cdrom_asc = cdrom_ascq = 0;
|
||||
}
|
||||
cdrom_request_sense(id, cdbufferb, cdb[4]);
|
||||
cdrom_data_command_finish(id, 18, 18, cdb[4], 0);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user