diff options
author | mdodd <mdodd@FreeBSD.org> | 1999-08-01 22:57:09 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 1999-08-01 22:57:09 +0000 |
commit | c790088cf6511de19be83cd5a1ca24ad896d2be1 (patch) | |
tree | 62ea067550649b36861238bc9f0b86abd784376b /sys/dev/ahb | |
parent | 6a572156072aa10677fe402b5b7995b0754131d6 (diff) | |
download | FreeBSD-src-c790088cf6511de19be83cd5a1ca24ad896d2be1.zip FreeBSD-src-c790088cf6511de19be83cd5a1ca24ad896d2be1.tar.gz |
Move the specification of EDGE/LEVEL triggered interrupts to
eisa_add_intr() which now takes an additional arguement (one of
EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE).
The flag RR_SHAREABLE has no effect when passed to
bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as
the eisa_alloc_resource() call (bus_alloc_resource method) now deals
with this flag directly, depending on the device ivars.
This change does nothing more than move all the 'shared = inb(foo + iobsse)'
nonesense to the device probe methods rather than the device attach.
Also, print out 'edge' or 'level' in the IRQ announcement message.
Reviewed by: dfr
Diffstat (limited to 'sys/dev/ahb')
-rw-r--r-- | sys/dev/ahb/ahb.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index 86ba09b..7ae7bd1 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ahb.c,v 1.11 1999/05/06 20:16:31 ken Exp $ + * $Id: ahb.c,v 1.12 1999/05/08 21:59:17 dfr Exp $ */ #include "eisa.h" @@ -206,6 +206,7 @@ ahbprobe(device_t dev) u_int32_t iobase; u_int32_t irq; u_int8_t intdef; + int shared; desc = ahbmatch(eisa_get_id(dev)); if (!desc) @@ -247,7 +248,10 @@ ahbprobe(device_t dev) if (irq == 0) return ENXIO; - eisa_add_intr(dev, irq); + shared = (inb(INTDEF + iobase) & INTLEVEL) ? + EISA_TRIGGER_LEVEL : EISA_TRIGGER_EDGE; + + eisa_add_intr(dev, irq, shared); return 0; } @@ -262,7 +266,7 @@ ahbattach(device_t dev) struct ecb* next_ecb; struct resource *io = 0; struct resource *irq = 0; - int shared, rid; + int rid; void *ih; rid = 0; @@ -280,10 +284,9 @@ ahbattach(device_t dev) if (ahbreset(ahb) != 0) goto error_exit; - shared = (ahb_inb(ahb, INTDEF) & INTLEVEL) ? RF_SHAREABLE : 0; rid = 0; irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, shared | RF_ACTIVE); + 0, ~0, 1, RF_ACTIVE); if (!irq) { device_printf(dev, "Can't allocate interrupt\n"); goto error_exit; @@ -746,10 +749,14 @@ ahbprocesserror(struct ahb_softc *ahb, struct ecb *ecb, union ccb *ccb) case HS_SCSI_RESET_INCOMING: ccb->ccb_h.status = CAM_SCSI_BUS_RESET; break; + case HS_INVALID_ECB_PARAM: + printf("ahb%ld: opcode 0x%02x, flag_word1 0x%02x, flag_word2 0x%02x\n", + ahb->unit, hecb->opcode, hecb->flag_word1, hecb->flag_word2); + ccb->ccb_h.status = CAM_SCSI_BUS_RESET; + break; case HS_DUP_TCB_RECEIVED: case HS_INVALID_OPCODE: case HS_INVALID_CMD_LINK: - case HS_INVALID_ECB_PARAM: case HS_PROGRAM_CKSUM_ERROR: panic("ahb%ld: Can't happen host status %x occurred", ahb->unit, status->ha_status); |