From 752ab9a8587b6cc446cde857f5bb2361eed5c846 Mon Sep 17 00:00:00 2001 From: gibbs Date: Mon, 19 Apr 1999 21:26:08 +0000 Subject: cam_periph.c: Move handling of CAM_AUTOSENSE_FAIL into block dealing with all other scsi status errors. cam_queue.c: cam_queue.h: Fix 'off by one' heap bug in a more efficient manner. Since heap algorithms like to deal with indexes started from 1, offset our heap array pointer at allocation time to make this so for a C environment. This makes the implementation of the algorithm a bit more efficient. cam_xpt.c: Use macros for accessing the head of the heap so that code is isolated from implementation details of the heap. --- sys/cam/cam_periph.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/cam/cam_periph.c') diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 4ba2630..02c8785 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cam_periph.c,v 1.10 1999/01/21 08:29:02 dillon Exp $ + * $Id: cam_periph.c,v 1.11 1999/04/06 03:05:36 peter Exp $ */ #include @@ -1047,6 +1047,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, ccb->ccb_h.retry_count--; error = 0; break; + case CAM_AUTOSENSE_FAIL: case CAM_SCSI_STATUS_ERROR: switch (ccb->csio.scsi_status) { @@ -1354,7 +1355,8 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, err_action); } } else if (ccb->csio.scsi_status == - SCSI_STATUS_CHECK_COND) { + SCSI_STATUS_CHECK_COND + && status != CAM_AUTOSENSE_FAIL) { /* no point in decrementing the retry count */ panic("cam_periph_error: scsi status of " "CHECK COND returned but no sense " @@ -1459,7 +1461,6 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, } break; case CAM_REQ_CMP_ERR: - case CAM_AUTOSENSE_FAIL: case CAM_CMD_TIMEOUT: case CAM_UNEXP_BUSFREE: case CAM_UNCOR_PARITY: -- cgit v1.1