diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-09-16 07:50:47 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-09-16 07:50:47 +0000 |
commit | 9243409c548edae3af3e78dd91df949d153846bc (patch) | |
tree | 63d6d9bdfbc2493be28d818ebef0fd28176fe98e /sys/dev/ic | |
parent | 0c66a6d841221b81034bc8795357ec5ac1c5391b (diff) |
rework the handling of the errors coming off the hardware at the bottom of
mpi_scsi_cmd_done. this makes it more appropriate for our midlayer.
ok beck@ deraadt@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/mpi.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 895b3812ebc..a71f2b90fd6 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.65 2006/08/24 14:08:43 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.66 2006/09/16 07:50:46 dlg Exp $ */ /* * Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org> @@ -1247,18 +1247,7 @@ mpi_scsi_cmd_done(struct mpi_ccb *ccb) xs->status = sie->scsi_status; switch (letoh16(sie->ioc_status)) { - case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: - xs->error = XS_DRIVER_STUFFUP; - break; - case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: - /* - * Yikes! Tagged queue full comes through this path! - * - * So we'll change it to a status error and anything - * that returns status should probably be a status - * error as well. - */ xs->resid = xs->datalen - letoh32(sie->transfer_count); if (sie->scsi_state & MPI_SCSIIO_ERR_STATE_NO_SCSI_STATUS) { xs->error = XS_DRIVER_STUFFUP; @@ -1277,16 +1266,11 @@ mpi_scsi_cmd_done(struct mpi_ccb *ccb) break; case SCSI_BUSY: + case SCSI_QUEUE_FULL: xs->error = XS_BUSY; break; - case SCSI_QUEUE_FULL: - xs->error = XS_TIMEOUT; - xs->retries++; - break; default: - printf("%s: invalid status code %d\n", - DEVNAME(sc), xs->status); xs->error = XS_DRIVER_STUFFUP; break; } @@ -1303,42 +1287,13 @@ mpi_scsi_cmd_done(struct mpi_ccb *ccb) xs->error = XS_SELTIMEOUT; break; - case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: - xs->error = XS_DRIVER_STUFFUP; - break; - - case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: - xs->error = XS_DRIVER_STUFFUP; - break; - - case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: - /* XXX */ - xs->error = XS_DRIVER_STUFFUP; - break; - - case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: - /* XXX */ - xs->error = XS_DRIVER_STUFFUP; - break; - - case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: - /* XXX This is a bus-reset */ - xs->error = XS_DRIVER_STUFFUP; - break; - default: - /* XXX unrecognized HBA error */ xs->error = XS_DRIVER_STUFFUP; break; } if (sie->scsi_state & MPI_SCSIIO_ERR_STATE_AUTOSENSE_VALID) bcopy(&mcb->mcb_sense, &xs->sense, sizeof(xs->sense)); - else if (sie->scsi_state & MPI_SCSIIO_ERR_STATE_AUTOSENSE_FAILED) { - /* This will cause the scsi layer to issue a REQUEST SENSE */ - if (xs->status == SCSI_CHECK) - xs->error = XS_BUSY; - } DNPRINTF(MPI_D_CMD, "%s: xs err: 0x%02x status: %d\n", DEVNAME(sc), xs->error, xs->status); |