From 91611b43ae118fbbd88424b0613e4715b5b7de7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= Date: Sat, 13 Jan 2024 17:47:58 +0100 Subject: [PATCH] Add ModeSense page 0x25 (DEC unique page) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VAXServer 3100 (CPU KA41-E) console firmware issues ModeSense(6) page 0x25 when probing for disks. A disk won't be recognized if this returns an error. The DEC SCSI specification[1], section 8.5 documents this page. [1] https://manx-docs.org/collections/antonio/dec/dec-scsi.pdf Fixes #1410 Signed-off-by: Klaus Kämpf --- cpp/devices/scsihd.cpp | 24 ++++++++++++++++++++++++ cpp/devices/scsihd.h | 1 + 2 files changed, 25 insertions(+) diff --git a/cpp/devices/scsihd.cpp b/cpp/devices/scsihd.cpp index 51384c6a..6a2a8634 100644 --- a/cpp/devices/scsihd.cpp +++ b/cpp/devices/scsihd.cpp @@ -97,8 +97,32 @@ void SCSIHD::AddFormatPage(map>& pages, bool changeable) const EnrichFormatPage(pages, changeable, 1 << GetSectorSizeShiftCount()); } +// Page code 37 (25h) - DEC Unique Page + +void SCSIHD::AddDECUniquePage(map>& pages, bool changeable) const +{ + vector buf(25); + + // No changeable area + if (changeable) { + pages[0x25] = buf; + + return; + } + + buf[0] = static_cast (0x25 | 0x80); // page code, high bit set + buf[1] = static_cast (sizeof(buf) - 1); + buf[2] = static_cast (0x01); // drive does not auto-start + + pages[0x25] = buf; +} + void SCSIHD::AddVendorPage(map>& pages, int page, bool changeable) const { + // Page code 0x25: DEC unique + if (page == 0x25 || page == 0x3f) { + AddDECUniquePage(pages, changeable); + } // Page code 48 if (page == 0x30 || page == 0x3f) { AddAppleVendorModePage(pages, changeable); diff --git a/cpp/devices/scsihd.h b/cpp/devices/scsihd.h index 95ded11a..8f5c5121 100644 --- a/cpp/devices/scsihd.h +++ b/cpp/devices/scsihd.h @@ -40,6 +40,7 @@ public: void ModeSelect(scsi_defs::scsi_command, cdb_t, span, int) override; void AddFormatPage(map>&, bool) const override; + void AddDECUniquePage(map>&, bool) const; void AddVendorPage(map>&, int, bool) const override; private: