summaryrefslogtreecommitdiff
path: root/sys/dev/ic/isp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ic/isp.c')
-rw-r--r--sys/dev/ic/isp.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/sys/dev/ic/isp.c b/sys/dev/ic/isp.c
index 66c3403a77e..ef4c101a4dd 100644
--- a/sys/dev/ic/isp.c
+++ b/sys/dev/ic/isp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp.c,v 1.17 2000/10/16 01:01:58 mjacob Exp $ */
+/* $OpenBSD: isp.c,v 1.18 2000/12/06 01:07:21 mjacob Exp $ */
/*
* Machine and OS Independent (well, as best as possible)
* code for the Qlogic ISP SCSI adapters.
@@ -89,7 +89,7 @@ static char *ldumped =
"Target %d (Loop ID 0x%x) Port 0x%x dumped after login info mismatch";
#endif
static char *notresp =
- "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d)";
+ "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d) nlooked %d";
static char *xact1 =
"HBA attempted queued transaction with disconnect not set for %d.%d.%d";
static char *xact2 =
@@ -376,6 +376,11 @@ isp_reset(isp)
}
/*
+ * Clear instrumentation
+ */
+ isp->isp_intcnt = isp->isp_intbogus = 0;
+
+ /*
* Do MD specific pre initialization
*/
ISP_RESET0(isp);
@@ -609,7 +614,7 @@ again:
mbs.param[1] = ISP_CODE_ORG;
isp_mboxcmd(isp, &mbs, MBLOGNONE);
/* give it a chance to start */
- USEC_DELAY(500);
+ USEC_SLEEP(isp, 500);
if (IS_SCSI(isp)) {
/*
@@ -1078,10 +1083,20 @@ isp_fibre_init(isp)
/*
* Prefer or force Point-To-Point instead Loop?
*/
- if (isp->isp_confopts & ISP_CFG_NPORT)
+ switch(isp->isp_confopts & ISP_CFG_PORT_PREF) {
+ case ISP_CFG_NPORT:
icbp->icb_xfwoptions = ICBXOPT_PTP_2_LOOP;
- else
+ break;
+ case ISP_CFG_NPORT_ONLY:
+ icbp->icb_xfwoptions = ICBXOPT_PTP_ONLY;
+ break;
+ case ISP_CFG_LPORT_ONLY:
+ icbp->icb_xfwoptions = ICBXOPT_LOOP_ONLY;
+ break;
+ default:
icbp->icb_xfwoptions = ICBXOPT_LOOP_2_PTP;
+ break;
+ }
}
icbp->icb_logintime = 60; /* 60 second login timeout */
@@ -1291,11 +1306,11 @@ isp_fclink_test(isp, usdelay)
count += 1000;
enano = (1000 * 1000) - enano;
while (enano > (u_int64_t) 4000000000U) {
- USEC_DELAY(4000000);
+ USEC_SLEEP(isp, 4000000);
enano -= (u_int64_t) 4000000000U;
}
wrk = enano;
- USEC_DELAY(wrk/1000);
+ USEC_SLEEP(isp, wrk/1000);
} else {
while (enano > (u_int64_t) 4000000000U) {
count += 4000000;
@@ -2487,7 +2502,9 @@ isp_intr(arg)
isp_prt(isp, ISP_LOGDEBUG3, "isp_intr isr %x sem %x", isr, sema);
isr &= INT_PENDING_MASK(isp);
sema &= BIU_SEMA_LOCK;
+ isp->isp_intcnt++;
if (isr == 0 && sema == 0) {
+ isp->isp_intbogus++;
return (0);
}
@@ -2622,7 +2639,12 @@ isp_intr(arg)
*/
if (sp->req_header.rqs_entry_type != RQSTYPE_REQUEST) {
isp_prt(isp, ISP_LOGERR, notresp,
- sp->req_header.rqs_entry_type, oop, optr);
+ sp->req_header.rqs_entry_type, oop, optr,
+ nlooked);
+ if (isp->isp_dblev & ISP_LOGDEBUG0) {
+ isp_print_bytes(isp, "Queue Entry",
+ QENTRY_LEN, sp);
+ }
MEMZERO(sp, sizeof (isphdr_t));
continue;
}
@@ -2850,6 +2872,9 @@ isp_parse_async(isp, mbox)
isp_prt(isp, ISP_LOGERR,
"Internal FW Error @ RISC Addr 0x%x", mbox);
isp_reinit(isp);
+#ifdef ISP_TARGET_MODE
+ isp_target_async(isp, bus, mbox);
+#endif
/* no point continuing after this */
return (-1);
@@ -3054,6 +3079,9 @@ isp_parse_async(isp, mbox)
case ISP_CONN_FATAL:
isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR");
isp_reinit(isp);
+#ifdef ISP_TARGET_MODE
+ isp_target_async(isp, bus, ASYNC_SYSTEM_ERROR);
+#endif
/* no point continuing after this */
return (-1);
@@ -3127,7 +3155,7 @@ isp_parse_status(isp, sp, xs)
if ((sp->req_state_flags & RQSF_GOT_TARGET) == 0) {
isp_prt(isp, ISP_LOGDEBUG1,
"Selection Timeout for %d.%d.%d",
- XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
+ XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
if (XS_NOERR(xs)) {
XS_SETERR(xs, HBA_SELTIMEOUT);
}
@@ -3996,12 +4024,6 @@ isp_mboxcmd(isp, mbp, logmask)
ISP_WRITE(isp, HCCR, HCCR_CMD_SET_HOST_INT);
/*
- * Give the f/w a chance to pick this up.
- */
- USEC_DELAY(250);
-
-
- /*
* While we haven't finished the command, spin our wheels here.
*/
MBOX_WAIT_COMPLETE(isp);