Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Add a callback (*irqack), for controllers that need ...
details: https://anonhg.NetBSD.org/src/rev/e21bb169c494
branches: trunk
changeset: 487773:e21bb169c494
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Jun 12 21:10:40 2000 +0000
description:
Add a callback (*irqack), for controllers that need special action to ack
the interrupt once it has been ack'd on the drive.
diffstat:
sys/dev/ata/ata_wdc.c | 14 +++++++++++++-
sys/dev/ic/wdc.c | 4 +++-
sys/dev/ic/wdcvar.h | 6 +++++-
sys/dev/scsipi/atapi_wdc.c | 9 ++++++++-
4 files changed, 29 insertions(+), 4 deletions(-)
diffs (145 lines):
diff -r 816d0088618e -r e21bb169c494 sys/dev/ata/ata_wdc.c
--- a/sys/dev/ata/ata_wdc.c Mon Jun 12 21:04:08 2000 +0000
+++ b/sys/dev/ata/ata_wdc.c Mon Jun 12 21:10:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_wdc.c,v 1.27 2000/05/15 08:32:07 bouyer Exp $ */
+/* $NetBSD: ata_wdc.c,v 1.28 2000/06/12 21:10:40 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -457,6 +457,8 @@
wdc_ata_bio_done(chp, xfer);
return 1;
}
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
drv_err = wdc_ata_err(drvp, ata_bio);
@@ -654,6 +656,8 @@
errstring = "recal";
if (wdcwait(chp, WDCS_DRDY, WDCS_DRDY, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto error;
/* fall through */
@@ -674,6 +678,8 @@
errstring = "piomode";
if (wdcwait(chp, WDCS_DRDY, WDCS_DRDY, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto error;
/* fall through */
@@ -694,6 +700,8 @@
errstring = "dmamode";
if (wdcwait(chp, WDCS_DRDY, WDCS_DRDY, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto error;
/* fall through */
@@ -714,6 +722,8 @@
errstring = "geometry";
if (wdcwait(chp, WDCS_DRDY, WDCS_DRDY, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto error;
/* fall through */
@@ -731,6 +741,8 @@
errstring = "setmulti";
if (wdcwait(chp, WDCS_DRDY, WDCS_DRDY, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto error;
/* fall through */
diff -r 816d0088618e -r e21bb169c494 sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c Mon Jun 12 21:04:08 2000 +0000
+++ b/sys/dev/ic/wdc.c Mon Jun 12 21:10:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc.c,v 1.90 2000/06/11 17:09:34 bouyer Exp $ */
+/* $NetBSD: wdc.c,v 1.91 2000/06/12 21:10:41 bouyer Exp $ */
/*
@@ -1323,6 +1323,8 @@
__wdccommand_done(chp, xfer);
return 1;
}
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (wdc_c->flags & AT_READ) {
if (chp->ch_drive[xfer->drive].drive_flags & DRIVE_CAP32) {
bus_space_read_multi_4(chp->data32iot, chp->data32ioh,
diff -r 816d0088618e -r e21bb169c494 sys/dev/ic/wdcvar.h
--- a/sys/dev/ic/wdcvar.h Mon Jun 12 21:04:08 2000 +0000
+++ b/sys/dev/ic/wdcvar.h Mon Jun 12 21:10:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdcvar.h,v 1.24 2000/04/01 14:32:22 bouyer Exp $ */
+/* $NetBSD: wdcvar.h,v 1.25 2000/06/12 21:10:41 bouyer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -98,6 +98,7 @@
#define WDC_CAPABILITY_ATAPI_NOSTREAM 0x0080 /* Don't use stream f on ATAPI */
#define WDC_CAPABILITY_NO_EXTRA_RESETS 0x0100 /* only reset once */
#define WDC_CAPABILITY_PREATA 0x0200 /* ctrl can be a pre-ata one */
+#define WDC_CAPABILITY_IRQACK 0x0400 /* callback to ack interrupt */
u_int8_t PIO_cap; /* highest PIO mode supported */
u_int8_t DMA_cap; /* highest DMA mode supported */
u_int8_t UDMA_cap; /* highest UDMA mode supported */
@@ -129,6 +130,9 @@
/* if WDC_CAPABILITY_MODE set in 'cap' */
void (*set_modes) __P((struct channel_softc *));
+
+ /* if WDC_CAPABILITY_IRQACK set in 'cap' */
+ void (*irqack) __P((struct channel_softc *));
};
/*
diff -r 816d0088618e -r e21bb169c494 sys/dev/scsipi/atapi_wdc.c
--- a/sys/dev/scsipi/atapi_wdc.c Mon Jun 12 21:04:08 2000 +0000
+++ b/sys/dev/scsipi/atapi_wdc.c Mon Jun 12 21:10:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atapi_wdc.c,v 1.35 2000/05/15 08:48:25 bouyer Exp $ */
+/* $NetBSD: atapi_wdc.c,v 1.36 2000/06/12 21:10:40 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -467,6 +467,9 @@
wdc_atapi_reset(chp, xfer);
return 1;
}
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
+
/* If we missed an IRQ and were using DMA, flag it as a DMA error */
if ((xfer->c_flags & C_TIMEOU) && (xfer->c_flags & C_DMA)) {
ata_dmaerr(drvp);
@@ -847,6 +850,8 @@
errstring = "piomode";
if (wait_for_unbusy(chp, delay))
goto timeout;
+ 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;
@@ -873,6 +878,8 @@
errstring = "dmamode";
if (wait_for_unbusy(chp, delay))
goto timeout;
+ if (chp->wdc->cap & WDC_CAPABILITY_IRQACK)
+ chp->wdc->irqack(chp);
if (chp->ch_status & WDCS_ERR)
goto error;
/* fall through */
Home |
Main Index |
Thread Index |
Old Index