From 67165423839c7edf24acfa9ccd28deecb0499786 Mon Sep 17 00:00:00 2001 From: mjacob Date: Mon, 29 Sep 1997 01:41:30 +0000 Subject: [PATCH] A little cleanup and print more error messages. --- sys/dev/ic/isp.c | 48 +++++++++++++++++++++++++++++++++++++++++++- sys/dev/ic/ispmbox.h | 5 +++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/sys/dev/ic/isp.c b/sys/dev/ic/isp.c index d25c76963844..9030464bdbc1 100644 --- a/sys/dev/ic/isp.c +++ b/sys/dev/ic/isp.c @@ -1,4 +1,4 @@ -/* $NetBSD: isp.c,v 1.14 1997/09/13 05:18:30 mjacob Exp $ */ +/* $NetBSD: isp.c,v 1.15 1997/09/29 01:41:32 mjacob Exp $ */ /* * Machine Independent (well, as best as possible) @@ -96,6 +96,7 @@ static void isp_fibre_init __P((struct ispsoftc *)); static void isp_fw_state __P((struct ispsoftc *)); static void isp_dumpregs __P((struct ispsoftc *, const char *)); static void isp_setdparm __P((struct ispsoftc *)); +static void isp_prtstst __P((ispstatusreq_t *)); #define WATCHI (30 * hz) static void isp_watch __P((void *)); @@ -1166,6 +1167,12 @@ isp_parse_status(isp, sp, xs) printf("%s: incomplete, state %x\n", isp->isp_name, sp->req_state_flags); break; + + case RQCS_TRANSPORT_ERROR: + printf("%s: transport error\n", isp->isp_name); + isp_prtstst(sp); + break; + case RQCS_DATA_OVERRUN: if (isp->isp_type & ISP_HA_FC) { xs->resid = sp->req_resid; @@ -1829,3 +1836,42 @@ isp_watch(void *arg) (void) splx(s); timeout(isp_watch, arg, WATCHI); } + +static void +isp_prtstst(ispstatusreq_t *sp) +{ + printf("states->"); + if (sp->req_state_flags & RQSF_GOT_BUS) + printf("GOT_BUS "); + if (sp->req_state_flags & RQSF_GOT_TARGET) + printf("GOT_TGT "); + if (sp->req_state_flags & RQSF_SENT_CDB) + printf("SENT_CDB "); + if (sp->req_state_flags & RQSF_XFRD_DATA) + printf("XFRD_DATA "); + if (sp->req_state_flags & RQSF_GOT_STATUS) + printf("GOT_STS "); + if (sp->req_state_flags & RQSF_GOT_SENSE) + printf("GOT_SNS "); + if (sp->req_state_flags & RQSF_XFER_COMPLETE) + printf("XFR_CMPLT "); + printf("\n"); + printf("status->"); + if (sp->req_status_flags & RQSTF_DISCONNECT) + printf("Disconnect "); + if (sp->req_status_flags & RQSTF_SYNCHRONOUS) + printf("Sync_xfr "); + if (sp->req_status_flags & RQSTF_PARITY_ERROR) + printf("Parity "); + if (sp->req_status_flags & RQSTF_BUS_RESET) + printf("Bus_Reset "); + if (sp->req_status_flags & RQSTF_DEVICE_RESET) + printf("Device_Reset "); + if (sp->req_status_flags & RQSTF_ABORTED) + printf("Aborted "); + if (sp->req_status_flags & RQSTF_TIMEOUT) + printf("Timeout "); + if (sp->req_status_flags & RQSTF_NEGOTIATION) + printf("Negotiation "); + printf("\n"); +} diff --git a/sys/dev/ic/ispmbox.h b/sys/dev/ic/ispmbox.h index 6040a62e47ef..96b66b8f8b42 100644 --- a/sys/dev/ic/ispmbox.h +++ b/sys/dev/ic/ispmbox.h @@ -1,4 +1,4 @@ -/* $NetBSD: ispmbox.h,v 1.4 1997/09/10 02:17:22 mjacob Exp $ */ +/* $NetBSD: ispmbox.h,v 1.5 1997/09/29 01:41:30 mjacob Exp $ */ /* * Mailbox and Command Definitions for for Qlogic ISP SCSI adapters. @@ -331,9 +331,10 @@ typedef struct { #define RQSF_GOT_BUS 0x0100 #define RQSF_GOT_TARGET 0x0200 #define RQSF_SENT_CDB 0x0400 -#define RQSF_TRANFERRED_DATA 0x0800 +#define RQSF_XFRD_DATA 0x0800 #define RQSF_GOT_STATUS 0x1000 #define RQSF_GOT_SENSE 0x2000 +#define RQSF_XFER_COMPLETE 0x4000 /* * Status Flags (not applicable to 2100)