summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1998-09-17 21:03:45 +0000
committermjacob <mjacob@FreeBSD.org>1998-09-17 21:03:45 +0000
commit4d3cd8e51f8765ea72377bfbdb7025382eaae1fd (patch)
treea7d7c799d1b2e9f801a2631112f348c233fb2e95 /sys/dev/isp
parent9dad24d2f65f5ecfa5dc2dab6a894f08edb25e35 (diff)
downloadFreeBSD-src-4d3cd8e51f8765ea72377bfbdb7025382eaae1fd.zip
FreeBSD-src-4d3cd8e51f8765ea72377bfbdb7025382eaae1fd.tar.gz
ISP_DMASETUP now returns a value to be possibly punted to outer layers.
Turn request queue overflow messages into debug messages. Ensure on isp_restarts that we nullify the xflist array.
Diffstat (limited to 'sys/dev/isp')
-rw-r--r--sys/dev/isp/isp.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index dcfeb5e..559b1d3 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -1,4 +1,4 @@
-/* $Id: isp.c,v 1.2 1998/09/15 08:42:55 gibbs Exp $ */
+/* $FreeBSD$ */
/*
* Machine and OS Independent (well, as best as possible)
* code for the Qlogic ISP SCSI adapters.
@@ -642,7 +642,7 @@ isp_init(isp)
/*
* Set up DMA for the request and result mailboxes.
*/
- if (ISP_MBOXDMASETUP(isp)) {
+ if (ISP_MBOXDMASETUP(isp) != 0) {
PRINTF("%s: can't setup dma mailboxes\n", isp->isp_name);
return;
}
@@ -708,7 +708,7 @@ isp_fibre_init(isp)
fcp = isp->isp_param;
- if (ISP_MBOXDMASETUP(isp)) {
+ if (ISP_MBOXDMASETUP(isp) != 0) {
PRINTF("%s: can't setup DMA for mailboxes\n", isp->isp_name);
return;
}
@@ -919,7 +919,7 @@ ispscsicmd(xs)
reqp = (ispreq_t *) ISP_QUEUE_ENTRY(isp->isp_rquest, iptr);
iptr = ISP_NXT_QENTRY(iptr, RQUEST_QUEUE_LEN);
if (iptr == optr) {
- PRINTF("%s: Request Queue Overflow\n", isp->isp_name);
+ IDPRINTF(2, ("%s: Request Queue Overflow\n", isp->isp_name));
XS_SETERR(xs, HBA_BOTCH);
return (CMD_EAGAIN);
}
@@ -938,14 +938,19 @@ ispscsicmd(xs)
isp->isp_sendmarker = 0;
+ /*
+ * Unconditionally update the input pointer anyway.
+ */
+ ISP_WRITE(isp, INMAILBOX4, iptr);
+ isp->isp_reqidx = iptr;
+
niptr = ISP_NXT_QENTRY(iptr, RQUEST_QUEUE_LEN);
if (niptr == optr) {
- ISP_WRITE(isp, INMAILBOX4, iptr);
- isp->isp_reqidx = iptr;
if (isp->isp_type & ISP_HA_FC) {
ENABLE_INTS(isp);
}
- PRINTF("%s: Request Queue Overflow+\n", isp->isp_name);
+ IDPRINTF(2, ("%s: Request Queue Overflow+\n",
+ isp->isp_name));
XS_SETERR(xs, HBA_BOTCH);
return (CMD_EAGAIN);
}
@@ -970,7 +975,7 @@ ispscsicmd(xs)
if (i == RQUEST_QUEUE_LEN) {
if (isp->isp_type & ISP_HA_FC)
ENABLE_INTS(isp);
- PRINTF("%s: ran out of xflist pointers?????\n", isp->isp_name);
+ IDPRINTF(2, ("%s: out of xflist pointers\n", isp->isp_name));
XS_SETERR(xs, HBA_BOTCH);
return (CMD_EAGAIN);
} else {
@@ -1022,11 +1027,15 @@ ispscsicmd(xs)
reqp->req_time = XS_TIME(xs) / 1000;
if (reqp->req_time == 0 && XS_TIME(xs))
reqp->req_time = 1;
- if (ISP_DMASETUP(isp, xs, reqp, &iptr, optr)) {
+ i = ISP_DMASETUP(isp, xs, reqp, &iptr, optr);
+ if (i != CMD_QUEUED) {
if (isp->isp_type & ISP_HA_FC)
ENABLE_INTS(isp);
- /* dmasetup sets actual error */
- return (CMD_COMPLETE);
+ /*
+ * dmasetup sets actual error in packet, and
+ * return what we were given to return.
+ */
+ return (i);
}
XS_SETERR(xs, HBA_NOERROR);
ISP_WRITE(isp, INMAILBOX4, iptr);
@@ -2618,6 +2627,7 @@ isp_restart(isp)
for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
tlist[i] = (ISP_SCSI_XFER_T *) isp->isp_xflist[i];
+ isp->isp_xflist[i] = NULL;
}
isp_reset(isp);
if (isp->isp_state == ISP_RESETSTATE) {
@@ -2632,11 +2642,13 @@ isp_restart(isp)
for (i = 0; i < RQUEST_QUEUE_LEN; i++) {
xs = tlist[i];
- if (XS_NULL(xs))
+ if (XS_NULL(xs)) {
continue;
+ }
isp->isp_nactive--;
- if (isp->isp_nactive < 0)
+ if (isp->isp_nactive < 0) {
isp->isp_nactive = 0;
+ }
XS_RESID(xs) = XS_XFRLEN(xs);
XS_SETERR(xs, HBA_BUSRESET);
XS_CMD_DONE(xs);
OpenPOWER on IntegriCloud