From 6e2a9880a01447859478e8ae86aac30b9b208c1f Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 17 Aug 2023 12:16:46 +0300 Subject: [PATCH] Post UNIT_ATTENTION condition after CD medium change (#247) Trying if this helps for hosts that do not detect medium change from a single "NO MEDIUM" message. Requires unit attention to be enabled in zuluscsi.ini by: [SCSI] EnableUnitAttention = 1 --- src/ZuluSCSI_cdrom.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ZuluSCSI_cdrom.cpp b/src/ZuluSCSI_cdrom.cpp index e0c2467d..b02abe2e 100644 --- a/src/ZuluSCSI_cdrom.cpp +++ b/src/ZuluSCSI_cdrom.cpp @@ -1157,6 +1157,12 @@ void cdromCloseTray(image_config_t &img) dbgmsg("------ CDROM close tray on ID ", (int)target); img.ejected = false; img.cdrom_events = 2; // New media + + if (scsiDev.boardCfg.flags & S2S_CFG_ENABLE_UNIT_ATTENTION) + { + dbgmsg("------ Posting UNIT ATTENTION after medium change"); + scsiDev.targets[target].unitAttention = NOT_READY_TO_READY_TRANSITION_MEDIUM_MAY_HAVE_CHANGED; + } } }