Updated LUN handling

This commit is contained in:
Uwe Seimet 2021-08-22 19:54:46 +02:00
parent 81f11b6dc2
commit fcedbf1e1d
3 changed files with 8 additions and 5 deletions

View File

@ -247,8 +247,15 @@ void SCSIDEV::Execute()
}
try {
// TODO Verify LUN handling
if ((SCSIDEV::scsi_command)ctrl.cmd[0] == eCmdInquiry) {
// Use LUN0 for INQUIRY because LUN0 is assumbed to be always available
ctrl.device = ctrl.unit[0];
}
else {
ctrl.device = ctrl.unit[GetLun()];
}
}
catch (const lun_exception& e) {
LOGINFO("%s Invalid LUN %d for ID %d", __PRETTY_FUNCTION__, e.getlun(), GetSCSIID());

View File

@ -1185,9 +1185,6 @@ Disk::Disk(const std::string id) : BlockDevice(id)
disk.dcache = NULL;
disk.imgoffset = 0;
// Other
cache_wb = TRUE;
AddCommand(SCSIDEV::eCmdTestUnitReady, "CmdTestUnitReady", &Disk::TestUnitReady);
AddCommand(SCSIDEV::eCmdRezero, "CmdRezero", &Disk::Rezero);
AddCommand(SCSIDEV::eCmdRequestSense, "CmdRequestSense", &Disk::RequestSense);

View File

@ -248,7 +248,6 @@ protected:
// Internal data
disk_t disk; // Internal disk data
BOOL cache_wb; // Cache mode
private:
void AddCommand(SCSIDEV::scsi_command, const char*, void (Disk::*)(SASIDEV *));