Enabled the LUN check for ATAPI MO, ZIP, and CD-ROM drives.

This commit is contained in:
OBattler
2022-09-28 04:01:19 +02:00
parent b2fb6dbeec
commit 7a7f87b532
3 changed files with 13 additions and 19 deletions

View File

@@ -1111,12 +1111,10 @@ mo_pre_execution_check(mo_t *dev, uint8_t *cdb)
{ {
int ready = 0; int ready = 0;
if (dev->drv->bus_type == MO_BUS_SCSI) { if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) { mo_log("MO %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
mo_log("MO %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7)); mo_invalid_lun(dev);
mo_invalid_lun(dev); return 0;
return 0;
}
} }
if (!(mo_command_flags[cdb[0]] & IMPLEMENTED)) { if (!(mo_command_flags[cdb[0]] & IMPLEMENTED)) {

View File

@@ -1182,12 +1182,10 @@ zip_pre_execution_check(zip_t *dev, uint8_t *cdb)
{ {
int ready = 0; int ready = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI) { if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) { zip_log("ZIP %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
zip_log("ZIP %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7)); zip_invalid_lun(dev);
zip_invalid_lun(dev); return 0;
return 0;
}
} }
if (!(zip_command_flags[cdb[0]] & IMPLEMENTED)) { if (!(zip_command_flags[cdb[0]] & IMPLEMENTED)) {

View File

@@ -1152,13 +1152,11 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, uint8_t *cdb)
{ {
int ready = 0; int ready = 0;
if (dev->drv->bus_type == CDROM_BUS_SCSI) { if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) { scsi_cdrom_log("CD-ROM %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n",
scsi_cdrom_log("CD-ROM %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
dev->id, ((dev->request_length >> 5) & 7)); scsi_cdrom_invalid_lun(dev);
scsi_cdrom_invalid_lun(dev); return 0;
return 0;
}
} }
if (!(scsi_cdrom_command_flags[cdb[0]] & IMPLEMENTED)) { if (!(scsi_cdrom_command_flags[cdb[0]] & IMPLEMENTED)) {