The REQUEST SENSE command now correctly returns as non-data if cdb[4] = 0.

This commit is contained in:
OBattler
2018-10-09 16:30:19 +02:00
parent 3b8d5f6b87
commit 6c7ff6b30a
3 changed files with 29 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
*
* Emulation of SCSI fixed disks.
*
* Version: @(#)scsi_disk.c 1.0.23 2018/10/07
* Version: @(#)scsi_disk.c 1.0.24 2018/10/09
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -663,6 +663,14 @@ scsi_disk_command(scsi_disk_t *dev, uint8_t *cdb)
/* 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. */
len = cdb[4];
if (!len) {
scsi_disk_set_phase(dev, SCSI_PHASE_STATUS);
dev->packet_status = CDROM_PHASE_COMPLETE;
dev->callback = 20 * SCSI_TIME;
break;
}
scsi_disk_set_buf_len(dev, BufLen, &len);
if (*BufLen < cdb[4])