summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/wd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index 0cc70814c7a..97c52e29b0f 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.40 2004/03/03 17:16:03 tedu Exp $ */
+/* $OpenBSD: wd.c,v 1.41 2004/07/06 00:38:38 aaron Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -104,6 +104,8 @@
#include "locators.h"
#endif
+#define LBA48_THRESHOLD (0xfffffff) /* 128GB / DEV_BSIZE */
+
#define WDIORETRIES_SINGLE 4 /* number of retries before single-sector */
#define WDIORETRIES 5 /* number of retries before giving up */
#define RECOVERYTIME hz/2 /* time to wait before retrying a cmd */
@@ -561,7 +563,8 @@ __wdstart(struct wd_softc *wd, struct buf *bp)
nblks = bp->b_bcount / wd->sc_dk.dk_label->d_secsize;
if ((wd->sc_flags & WDF_LBA48) &&
/* use LBA48 only if really need */
- ((wd->sc_wdc_bio.blkno + nblks - 1 > 0xfffffff) || (nblks > 0xff)))
+ ((wd->sc_wdc_bio.blkno + nblks - 1 > LBA48_THRESHOLD) ||
+ (nblks > 0xff)))
wd->sc_wdc_bio.flags |= ATA_LBA48;
if (wd->sc_flags & WDF_LBA)
wd->sc_wdc_bio.flags |= ATA_LBA;