Don't use LBA48 if we don't have to (that is, if the request is inside the

first 128GB). Tested by Andreas Johansson.
This commit is contained in:
bouyer 2003-06-29 19:28:16 +00:00
parent 679db94879
commit 7a5f4f28d0
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wd.c,v 1.255 2003/06/29 17:03:47 bouyer Exp $ */
/* $NetBSD: wd.c,v 1.256 2003/06/29 19:28:16 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.255 2003/06/29 17:03:47 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.256 2003/06/29 19:28:16 bouyer Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -711,7 +711,7 @@ __wdstart(wd, bp)
wd->sc_wdc_bio.flags = ATA_SINGLE;
else
wd->sc_wdc_bio.flags = 0;
if (wd->sc_flags & WDF_LBA48)
if (wd->sc_flags & WDF_LBA48 && wd->sc_wdc_bio.blkno > 0xffffff)
wd->sc_wdc_bio.flags |= ATA_LBA48;
if (wd->sc_flags & WDF_LBA)
wd->sc_wdc_bio.flags |= ATA_LBA;
@ -1543,7 +1543,7 @@ again:
wd->sc_wdc_bio.flags = ATA_POLL;
if (wddumpmulti == 1)
wd->sc_wdc_bio.flags |= ATA_SINGLE;
if (wd->sc_flags & WDF_LBA48)
if (wd->sc_flags & WDF_LBA48 && blkno > 0xffffff)
wd->sc_wdc_bio.flags |= ATA_LBA48;
if (wd->sc_flags & WDF_LBA)
wd->sc_wdc_bio.flags |= ATA_LBA;