From eb93789fb3068630e009d6fb0f7cfa149985d2d6 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 12 Mar 2007 00:35:16 +0000 Subject: ata counts sectors from 1, scsi counts from 0. adjust the value in the read capacity completion to compensate. --- sys/dev/ata/atascsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/ata') 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 @@ -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)); -- cgit v1.2.3