From 70f35ac05209fcac4cada0f8b181a3aabc75b22e Mon Sep 17 00:00:00 2001 From: mycroft Date: Wed, 3 Apr 1996 09:45:45 +0000 Subject: [PATCH] Don't wait for a command complete interrupt when enabling mailbox out interrupts. --- sys/dev/isa/aha.c | 27 +++++++++++++++------------ sys/dev/isa/bt.c | 27 +++++++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/sys/dev/isa/aha.c b/sys/dev/isa/aha.c index 428c2560917f..153d422d06af 100644 --- a/sys/dev/isa/aha.c +++ b/sys/dev/isa/aha.c @@ -1,4 +1,4 @@ -/* $NetBSD: aha.c,v 1.5 1996/04/03 08:48:46 mycroft Exp $ */ +/* $NetBSD: aha.c,v 1.6 1996/04/03 09:45:45 mycroft Exp $ */ #define AHADIAG #define integrate @@ -221,7 +221,7 @@ aha_cmd(iobase, sc, icnt, ibuf, ocnt, obuf) * Wait for the adapter to go idle, unless it's one of * the commands which don't need this */ - if (opcode != AHA_MBX_INIT && opcode != AHA_MBO_INTR_EN) { + if (opcode != AHA_MBO_INTR_EN) { for (i = 20000; i; i--) { /* 1 sec? */ sts = inb(iobase + AHA_STAT_PORT); if (sts & AHA_STAT_IDLE) @@ -286,16 +286,19 @@ aha_cmd(iobase, sc, icnt, ibuf, ocnt, obuf) * We may get an extra interrupt for the HACC signal, but this is * unimportant. */ - for (i = 20000; i; i--) { /* 1 sec? */ - sts = inb(iobase + AHA_INTR_PORT); - /* XXX Need to save this in the interrupt handler? */ - if (sts & AHA_INTR_HACC) - break; - delay(50); - } - if (!i) { - printf("%s: aha_cmd, host not finished(0x%x)\n", name, sts); - return ENXIO; + if (opcode != AHA_MBO_INTR_EN) { + for (i = 20000; i; i--) { /* 1 sec? */ + sts = inb(iobase + AHA_INTR_PORT); + /* XXX Need to save this in the interrupt handler? */ + if (sts & AHA_INTR_HACC) + break; + delay(50); + } + if (!i) { + printf("%s: aha_cmd, host not finished(0x%x)\n", + name, sts); + return ENXIO; + } } outb(iobase + AHA_CTRL_PORT, AHA_CTRL_IRST); return 0; diff --git a/sys/dev/isa/bt.c b/sys/dev/isa/bt.c index abb7a7b41dda..c17ad4063808 100644 --- a/sys/dev/isa/bt.c +++ b/sys/dev/isa/bt.c @@ -1,4 +1,4 @@ -/* $NetBSD: bt.c,v 1.5 1996/04/03 08:48:48 mycroft Exp $ */ +/* $NetBSD: bt.c,v 1.6 1996/04/03 09:45:47 mycroft Exp $ */ #define BTDIAG #define integrate @@ -221,7 +221,7 @@ bt_cmd(iobase, sc, icnt, ibuf, ocnt, obuf) * Wait for the adapter to go idle, unless it's one of * the commands which don't need this */ - if (opcode != BT_MBX_INIT && opcode != BT_MBO_INTR_EN) { + if (opcode != BT_MBO_INTR_EN) { for (i = 20000; i; i--) { /* 1 sec? */ sts = inb(iobase + BT_STAT_PORT); if (sts & BT_STAT_IDLE) @@ -286,16 +286,19 @@ bt_cmd(iobase, sc, icnt, ibuf, ocnt, obuf) * We may get an extra interrupt for the HACC signal, but this is * unimportant. */ - for (i = 20000; i; i--) { /* 1 sec? */ - sts = inb(iobase + BT_INTR_PORT); - /* XXX Need to save this in the interrupt handler? */ - if (sts & BT_INTR_HACC) - break; - delay(50); - } - if (!i) { - printf("%s: bt_cmd, host not finished(0x%x)\n", name, sts); - return ENXIO; + if (opcode != BT_MBO_INTR_EN) { + for (i = 20000; i; i--) { /* 1 sec? */ + sts = inb(iobase + BT_INTR_PORT); + /* XXX Need to save this in the interrupt handler? */ + if (sts & BT_INTR_HACC) + break; + delay(50); + } + if (!i) { + printf("%s: bt_cmd, host not finished(0x%x)\n", + name, sts); + return ENXIO; + } } outb(iobase + BT_CTRL_PORT, BT_CTRL_IRST); return 0;