From 285f8809474ef89dec537b3b4c39c14d080002d1 Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Thu, 28 Oct 1999 19:59:28 +0000 Subject: Downgrade to mode 2 first if we were udma > 2; from NetBSD. costa@ ok. --- sys/dev/ic/wdc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 270ebaff974..620c74a9ec7 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc.c,v 1.10 1999/10/09 03:42:04 csapuntz Exp $ */ +/* $OpenBSD: wdc.c,v 1.11 1999/10/28 19:59:27 fgsch Exp $ */ /* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */ @@ -1044,6 +1044,16 @@ wdc_downgrade_mode(drvp) (cf_flags & ATA_CONFIG_UDMA_SET)) return 0; + /* + * If we were using Ultra-DMA mode > 2, downgrade to mode 2 first. + * Maybe we didn't properly notice the cable type + */ + if ((drvp->drive_flags & DRIVE_UDMA) && drvp->UDMA_mode > 2) { + drvp->UDMA_mode = 2; + printf("%s: transfer error, downgrading to DMA mode %d\n", + drv_dev->dv_xname, drvp->UDMA_mode); + } + /* * If we were using ultra-DMA, don't downgrade to multiword DMA * if we noticed a CRC error. It has been noticed that CRC errors -- cgit v1.2.3