From d5a2f230fd6b5a0e84fac8b7d22990e271081e61 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Tue, 24 Aug 2021 12:17:55 +0200 Subject: [PATCH] Set block size in device info --- src/raspberrypi/rascsi.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index fd6c084e..cffa6fca 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -298,6 +298,30 @@ const PbDevices GetDevices() pbDevice->set_lockable(device->IsLockable()); pbDevice->set_locked(device->IsLocked()); + const Disk *disk = dynamic_cast(device); + if (disk) { + switch (disk->GetSectorSize()) { + case 9: + pbDevice->set_block_size(512); + break; + + case 10: + pbDevice->set_block_size(1024); + break; + + case 11: + pbDevice->set_block_size(2048); + break; + + case 12: + pbDevice->set_block_size(4096); + break; + + default: + break; + } + } + const FileSupport *fileSupport = dynamic_cast(device); if (fileSupport) { Filepath filepath;