diff options
| author | Justin T. Gibbs <gibbs@FreeBSD.org> | 1998-12-13 00:05:04 +0000 |
|---|---|---|
| committer | Justin T. Gibbs <gibbs@FreeBSD.org> | 1998-12-13 00:05:04 +0000 |
| commit | 0aae7eb02e2238a9dd2abd2de212875def3e8baf (patch) | |
| tree | 8b0d4c3388c3af33ba6ed1e31918587cdb89c042 | |
| parent | 10fc9d90cefd1fdecd6f8b66085eea04482978a6 (diff) | |
Notes
| -rw-r--r-- | sys/dev/aha/aha.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index 0fe69c0c3aa8..82845c2f2b31 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -55,7 +55,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aha.c,v 1.13 1998/11/25 19:12:56 imp Exp $ + * $Id: aha.c,v 1.14 1998/12/04 22:54:44 archie Exp $ */ #include <sys/param.h> @@ -1181,7 +1181,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op); } else { - accb->hccb.opcode = INITIATOR_CCB_WRESID; + accb->hccb.opcode = INITIATOR_CCB; ahautoa24(0, accb->hccb.data_len); ahautoa24(0, accb->hccb.data_addr); } @@ -1547,11 +1547,13 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params, u_int intstat; u_int reply_buf_size; int s; + int cmd_complete; /* No data returned to start */ reply_buf_size = reply_len; reply_len = 0; intstat = 0; + cmd_complete = 0; aha->command_cmp = 0; /* @@ -1587,10 +1589,13 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params, status = aha_inb(aha, STATUS_REG); intstat = aha_inb(aha, INTSTAT_REG); if ((intstat & (INTR_PENDING|CMD_COMPLETE)) - == (INTR_PENDING|CMD_COMPLETE)) + == (INTR_PENDING|CMD_COMPLETE)) { + cmd_complete = 1; break; + } if (aha->command_cmp != 0) { status = aha->latched_status; + cmd_complete = 1; break; } if ((status & DATAIN_REG_READY) != 0) @@ -1610,7 +1615,7 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params, * For all other commands, we wait for any output data * and the final comand completion interrupt. */ - while (--cmd_timeout) { + while (cmd_complete == 0 && --cmd_timeout) { status = aha_inb(aha, STATUS_REG); intstat = aha_inb(aha, INTSTAT_REG); |
