Unverified Commit d893a73e authored by Ian Douglas Scott's avatar Ian Douglas Scott
Browse files

ahcid: fix atapi capacity detection

parent a081f9e2
......@@ -63,7 +63,8 @@ impl DiskATAPI {
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))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment