Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/dev/scsipi pull up 1.37->1.38 (approved by thorpej):
details: https://anonhg.NetBSD.org/src/rev/150608e3419b
branches: netbsd-1-5
changeset: 488871:150608e3419b
user: bouyer <bouyer%NetBSD.org@localhost>
date: Fri Aug 04 09:43:53 2000 +0000
description:
pull up 1.37->1.38 (approved by thorpej):
If the SET_FEATURE for piomode is rejected, fallback to mode 0 instead of
reporting an error. This fixes the "piomode error (0x4)" problem with some
ATAPI ZIP drives reported on port-i386.
diffstat:
sys/dev/scsipi/atapi_wdc.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diffs (53 lines):
diff -r f046664e6173 -r 150608e3419b sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c Fri Aug 04 05:34:29 2000 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c Fri Aug 04 09:43:53 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.36 2000/06/12 21:10:40 bouyer Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.36.2.1 2000/08/04 09:43:53 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -835,13 +835,12 @@
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;
/* Also don't try if the drive didn't report its mode */
if ((drvp->drive_flags & DRIVE_MODE) == 0)
- goto ready;;
+ goto ready;
wdccommand(chp, drvp->drive, SET_FEATURES, 0, 0, 0,
0x08 | drvp->PIO_mode, WDSF_SET_MODE);
drvp->state = PIOMODE_WAIT;
@@ -853,12 +852,23 @@
if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
chp->wdc->irqack(chp);
if (chp->ch_status & WDCS_ERR) {
- if (drvp->PIO_mode < 3) {
- drvp->PIO_mode = 3;
- goto piomode;
- } else {
- goto error;
+ if (chp->ch_error == WDCE_ABRT) {
+ /*
+ * some ATAPI drives rejects pio settings.
+ * all we can do here is fall back to PIO 0
+ */
+ drvp->drive_flags &= ~DRIVE_MODE;
+ drvp->drive_flags &= ~(DRIVE_DMA|DRIVE_UDMA);
+ drvp->PIO_mode = 0;
+ drvp->DMA_mode = 0;
+ printf("%s:%d:%d: pio setting rejected, "
+ "falling back to PIO mode 0\n",
+ chp->wdc->sc_dev.dv_xname,
+ chp->channel, xfer->drive);
+ chp->wdc->set_modes(chp);
+ goto ready;
}
+ goto error;
}
/* fall through */
Home |
Main Index |
Thread Index |
Old Index