diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2003-02-13 20:55:00 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2003-02-13 20:55:00 +0000 |
commit | aff8f744de4ee8056413b4ee36da58323bd88341 (patch) | |
tree | fef4b20f53f9b31c907d47a349d2b517d708de5a /sys/dev/atapiscsi | |
parent | 945cc3da40222406080f980358ef9da71b546fc8 (diff) |
Don't force all ATAPI devices to PIO mode 3, there are
devices which only support PIO mode 2 or less. Use
atap_oldpiotiming to obtain supported mode for such devices.
Also use SET FEATURES only for PIO mode > 2.
Work by Alec Skelly <alec@dtkco.com> with my little help.
ok costa@
Diffstat (limited to 'sys/dev/atapiscsi')
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index 3260aa9b482..192a470c5f9 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.62 2002/12/19 16:32:59 grange Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.63 2003/02/13 20:54:59 grange Exp $ */ /* * This code is derived from code with the copyright below. @@ -1448,13 +1448,15 @@ wdc_atapi_ctrl(chp, xfer, timeout, ret) } case ATAPI_PIOMODE_STATE: -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; + /* SET FEATURES 0x08 is only for PIO mode > 2 */ + if (drvp->PIO_mode <= 2) + goto ready; wdccommand(chp, drvp->drive, SET_FEATURES, 0, 0, 0, 0x08 | drvp->PIO_mode, WDSF_SET_MODE); drvp->state = ATAPI_PIOMODE_WAIT_STATE; @@ -1465,14 +1467,7 @@ piomode: 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; - } - /* - * All ATAPI drives are supposed to support - * PIO mode 3 or greater. - */ + /* Downgrade straight to PIO mode 3 */ drvp->PIO_mode = 3; chp->wdc->set_modes(chp); } |