ahcid: fix atapi capacity detection

This commit is contained in:
Ian Douglas Scott
2018-03-11 18:24:23 -07:00
parent a081f9e2ff
commit d893a73e1e
+2 -1
View File
@@ -63,7 +63,8 @@ impl DiskATAPI {
cmd[0] = SCSI_READ_CAPACITY;
self.port.packet(&cmd, 8, &mut self.clb, &mut self.ctbas, &mut self.buf)?;
let blk_count = BigEndian::read_u32(&self.buf[0..4]);
// Instead of a count, contains number of last LBA, so add 1
let blk_count = BigEndian::read_u32(&self.buf[0..4]) + 1;
let blk_size = BigEndian::read_u32(&self.buf[4..8]);
Ok((blk_count, blk_size))