Skip to content

Commit

Permalink
Add ModeSense page 37
Browse files Browse the repository at this point in the history
VAXServer 3100 (CPU KA41-E) console firmware issues ModeSense(6) page 37
when probing for disks. A disk won't be recognized if this returns an
error.

Fixes PiSCSI#1410

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
  • Loading branch information
kkaempf committed Jan 13, 2024
1 parent ad5eae9 commit 36824a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cpp/devices/scsihd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,32 @@ void SCSIHD::AddFormatPage(map<int, vector<byte>>& pages, bool changeable) const
EnrichFormatPage(pages, changeable, 1 << GetSectorSizeShiftCount());
}

// Page code 37 (25h) - DEC Vendor Mode Page
// returns 25 (19h) bytes
// Needed for SCHD for VAXServer 3100 (KA41-E)
void SCSIHD::AddDECVendorModePage(map<int, vector<byte>>& pages, bool changeable) const
{
vector<byte> buf(25);

// No changeable area
if (changeable) {
pages[37] = buf;

return;
}

SetInt16(buf, 0, 0x17a5);
SetInt16(buf, 2, 0x1);

pages[37] = buf;
}

void SCSIHD::AddVendorPage(map<int, vector<byte>>& pages, int page, bool changeable) const
{
// Page code 37
if (page == 0x25 || page == 0x3f) {
AddDECVendorModePage(pages, changeable);
}
// Page code 48
if (page == 0x30 || page == 0x3f) {
AddAppleVendorModePage(pages, changeable);
Expand Down
1 change: 1 addition & 0 deletions cpp/devices/scsihd.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class SCSIHD : public Disk
void ModeSelect(scsi_defs::scsi_command, cdb_t, span<const uint8_t>, int) const override;

void AddFormatPage(map<int, vector<byte>>&, bool) const override;
void AddDECVendorModePage(map<int, vector<byte>>&, bool) const;
void AddVendorPage(map<int, vector<byte>>&, int, bool) const override;

private:
Expand Down

0 comments on commit 36824a4

Please sign in to comment.