mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2024-12-22 12:30:12 +00:00
Fix onReadCapacity calculation
This commit is contained in:
parent
4dbba493d7
commit
52a0936fbc
@ -999,16 +999,18 @@ byte onRequestSense(SCSI_DEVICE *dev, const byte *cdb)
|
||||
* READ CAPACITY command processing.
|
||||
*/
|
||||
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