diff --git a/src/raspberrypi/controllers/scsidev_ctrl.cpp b/src/raspberrypi/controllers/scsidev_ctrl.cpp index bd14cc6b..82bbbbbb 100644 --- a/src/raspberrypi/controllers/scsidev_ctrl.cpp +++ b/src/raspberrypi/controllers/scsidev_ctrl.cpp @@ -247,7 +247,14 @@ void SCSIDEV::Execute() } try { - ctrl.device = ctrl.unit[GetLun()]; + // 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()); diff --git a/src/raspberrypi/devices/disk.cpp b/src/raspberrypi/devices/disk.cpp index 2b6a6aa5..5b008f63 100644 --- a/src/raspberrypi/devices/disk.cpp +++ b/src/raspberrypi/devices/disk.cpp @@ -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); diff --git a/src/raspberrypi/devices/disk.h b/src/raspberrypi/devices/disk.h index ddd56a82..0d9e8c48 100644 --- a/src/raspberrypi/devices/disk.h +++ b/src/raspberrypi/devices/disk.h @@ -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 *));