summaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-03-12 00:35:16 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-03-12 00:35:16 +0000
commiteb93789fb3068630e009d6fb0f7cfa149985d2d6 (patch)
treed18b4edac5dfaf9c37ba59c4caa79a50dc85d390 /sys/dev/ata
parent569a51d364f71abf2a1d3788c0ae086c9662a836 (diff)
ata counts sectors from 1, scsi counts from 0. adjust the value in the
read capacity completion to compensate.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/atascsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index e3f3ee3d4ef..323263448a2 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.13 2007/03/12 00:33:09 dlg Exp $ */
+/* $OpenBSD: atascsi.c,v 1.14 2007/03/12 00:35:15 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -501,7 +501,7 @@ atascsi_disk_capacity_done(struct ata_xfer *xa)
capacity += id.addrsec[0];
}
- _lto4b(capacity, rcd.addr);
+ _lto4b(capacity - 1, rcd.addr);
_lto4b(512, rcd.length);
bcopy(&rcd, xs->data, MIN(sizeof(rcd), xs->datalen));