Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi If setting to pio mode < 3 fails, try to set ...
details: https://anonhg.NetBSD.org/src/rev/2c742b548604
branches: trunk
changeset: 471931:2c742b548604
user: bouyer <bouyer%NetBSD.org@localhost>
date: Thu Apr 15 16:21:27 1999 +0000
description:
If setting to pio mode < 3 fails, try to set pio mode 3 before returning
EIO. The spec says ATAPI devices should support "PIO 3 or better".
They are supposed to support less as well. Setting the device to a highter
mode than the controller shoul'nt be a problem, and this is likely what
happens with legaty ISA controllers.
Solve problem reported by Ruey-Shyang Guo.
diffstat:
sys/dev/scsipi/atapi_wdc.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r 4725713feafd -r 2c742b548604 sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c Thu Apr 15 15:30:46 1999 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c Thu Apr 15 16:21:27 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.21 1999/04/08 11:29:01 bouyer Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.22 1999/04/15 16:21:27 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -702,6 +702,7 @@
WDSD_IBM | (xfer->drive << 4));
switch (drvp->state) {
case PIOMODE:
+piomode:
/* Don't try to set mode if controller can't be adjusted */
if ((chp->wdc->cap & WDC_CAPABILITY_MODE) == 0)
goto ready;
@@ -716,8 +717,14 @@
errstring = "piomode";
if (wait_for_unbusy(chp, delay))
goto timeout;
- if (chp->ch_status & WDCS_ERR)
- goto error;
+ if (chp->ch_status & WDCS_ERR) {
+ if (drvp->PIO_mode < 3) {
+ drvp->PIO_mode = 3;
+ goto piomode;
+ } else {
+ goto error;
+ }
+ }
/* fall through */
case DMAMODE:
Home |
Main Index |
Thread Index |
Old Index