summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/ata.c8
-rw-r--r--sys/dev/ic/wdc.c14
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c
index c9e1f08a95e..82a1afafa89 100644
--- a/sys/dev/ata/ata.c
+++ b/sys/dev/ata/ata.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ata.c,v 1.21 2003/10/16 11:58:15 grange Exp $ */
+/* $OpenBSD: ata.c,v 1.22 2003/11/17 21:50:14 grange Exp $ */
/* $NetBSD: ata.c,v 1.9 1999/04/15 09:41:09 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -81,12 +81,12 @@ ata_get_params(drvp, flags, prms)
if (drvp->drive_flags & DRIVE_ATA) {
wdc_c.r_command = WDCC_IDENTIFY;
wdc_c.r_st_bmask = WDCS_DRDY;
- wdc_c.r_st_pmask = WDCS_DRQ;
+ wdc_c.r_st_pmask = 0;
wdc_c.timeout = 3000; /* 3s */
} else if (drvp->drive_flags & DRIVE_ATAPI) {
wdc_c.r_command = ATAPI_IDENTIFY_DEVICE;
wdc_c.r_st_bmask = 0;
- wdc_c.r_st_pmask = WDCS_DRQ;
+ wdc_c.r_st_pmask = 0;
wdc_c.timeout = 10000; /* 10s */
} else {
return CMD_ERR;
@@ -168,7 +168,7 @@ ata_set_mode(drvp, mode, flags)
wdc_c.r_st_pmask = 0;
wdc_c.r_precomp = WDSF_SET_MODE;
wdc_c.r_count = mode;
- wdc_c.flags = AT_READ | flags;
+ wdc_c.flags = flags;
wdc_c.timeout = 1000; /* 1s */
if (wdc_exec_command(drvp, &wdc_c) != WDC_COMPLETE)
return CMD_AGAIN;
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index 77e01c68609..876e876a746 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.77 2003/11/13 23:29:14 grange Exp $ */
+/* $OpenBSD: wdc.c,v 1.78 2003/11/17 21:50:13 grange Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -1813,17 +1813,19 @@ __wdccommand_intr(chp, xfer, irq)
if (irq && (xfer->c_flags & C_TIMEOU) == 0)
return 0; /* IRQ was not for us */
wdc_c->flags |= AT_TIMEOU;
- __wdccommand_done(chp, xfer);
- WDCDEBUG_PRINT(("__wdccommand_intr returned\n"), DEBUG_INTR);
- return 1;
+ goto out;
}
if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
chp->wdc->irqack(chp);
-
- if ((wdc_c->flags & AT_READ) && (chp->ch_status & WDCS_DRQ)) {
+ if (wdc_c->flags & AT_READ) {
+ if ((chp->ch_status & WDCS_DRQ) == 0) {
+ wdc_c->flags |= AT_TIMEOU;
+ goto out;
+ }
wdc_input_bytes(drvp, data, bcount);
/* Should we wait for device to indicate idle? */
}
+out:
__wdccommand_done(chp, xfer);
WDCDEBUG_PRINT(("__wdccommand_intr returned\n"), DEBUG_INTR);
return 1;