Remove two panic conditions.

XXX untested.
This commit is contained in:
tsubai 1999-12-28 13:49:20 +00:00
parent 2a69a62828
commit a1da0497d2

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesh.c,v 1.2 1999/09/30 23:01:11 thorpej Exp $ */
/* $NetBSD: mesh.c,v 1.3 1999/12/28 13:49:20 tsubai Exp $ */
/*-
* Copyright (C) 1999 Internet Research Institute, Inc.
@ -303,6 +303,7 @@ mesh_intr(arg)
{
struct mesh_softc *sc = arg;
struct mesh_scb *scb;
int fifocnt;
u_char intr, exception, error, status0, status1;
int i;
@ -337,8 +338,16 @@ mesh_intr(arg)
sc->sc_flags &= ~MESH_DMA_ACTIVE;
scb->resid = MESH_GET_XFER(sc);
if (mesh_read_reg(sc, MESH_FIFO_COUNT) != 0)
panic("mesh: FIFO != 0"); /* XXX */
fifocnt = mesh_read_reg(sc, MESH_FIFO_COUNT);
if (fifocnt != 0 && (scb->flags & MESH_READ)) {
char *cp = (char *)scb->daddr + scb->dlen - fifocnt;
while (fifocnt > 0) {
*cp++ = mesh_read_reg(sc, MESH_FIFO);
fifocnt--;
}
} else
mesh_set_reg(sc, MESH_SEQUENCE, MESH_CMD_FLUSH_FIFO);
}
if (intr & MESH_INTR_ERROR) {
@ -1026,8 +1035,14 @@ mesh_done(sc, scb)
}
if (scb->status == SCSI_CHECK) {
if (scb->flags & MESH_SENSE)
panic("SCSI_CHECK && MESH_SENSE?");
if (scb->flags & MESH_SENSE) {
printf("mesh: SCSI_CHECK && MESH_SENSE?\n");
xs->xs_status |= XS_STS_DONE;
xs->error = XS_DRIVER_STUFFUP;
scsipi_done(xs);
mesh_free_scb(sc, scb);
return;
}
xs->resid = scb->resid;
mesh_sense(sc, scb);
return;