mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2024-12-23 04:29:44 +00:00
Fix onReadCapacity calculation
This commit is contained in:
parent
4dbba493d7
commit
52a0936fbc
@ -1000,15 +1000,17 @@ byte onRequestSense(SCSI_DEVICE *dev, const byte *cdb)
|
||||
*/
|
||||
byte onReadCapacity(SCSI_DEVICE *dev, const byte *cdb)
|
||||
{
|
||||
uint32_t blocksize = dev->m_blocksize;
|
||||
uint32_t blockcount = dev->m_fileSize / blocksize - 1; // Points to last LBA
|
||||
uint8_t buf[8] = {
|
||||
dev->m_blockcount >> 24,
|
||||
dev->m_blockcount >> 16,
|
||||
dev->m_blockcount >> 8,
|
||||
dev->m_blockcount - 1, // Points to last LBA
|
||||
dev->m_blocksize >> 24,
|
||||
dev->m_blocksize >> 16,
|
||||
dev->m_blocksize >> 8,
|
||||
dev->m_blocksize
|
||||
blockcount >> 24,
|
||||
blockcount >> 16,
|
||||
blockcount >> 8,
|
||||
blockcount,
|
||||
blocksize >> 24,
|
||||
blocksize >> 16,
|
||||
blocksize >> 8,
|
||||
blocksize
|
||||
};
|
||||
writeDataPhase(8, buf);
|
||||
return SCSI_STATUS_GOOD;
|
||||
|
Loading…
Reference in New Issue
Block a user