summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2003-09-13 01:55:44 +0000
committermjacob <mjacob@FreeBSD.org>2003-09-13 01:55:44 +0000
commit9108ce23f947cca0f57a813228b2652ddf28beee (patch)
treedbab35c3703349d53996f8b06e58554cf638c42f /sys/dev/isp
parent019aab94778c7a992e8d5ac7bc6ad6f4a4a7877c (diff)
downloadFreeBSD-src-9108ce23f947cca0f57a813228b2652ddf28beee.zip
FreeBSD-src-9108ce23f947cca0f57a813228b2652ddf28beee.tar.gz
On reset, make sure that we have some parameters set correctly. This
fixes a longstanding issue WRT resetting the chip after startup- it would fail if we were connected as an F-port to a switch. If we were connected as an F-port, we got assigned a hard loop ID of 255, which is really a bogus loop id. Then when we turned around to reset ourselves, the firmware would reject the ICB_INIT request because the loop id was bogus. *sputter* Minor fixlet from somebody in NetBSD with too much time on their hands (dma -> DMA).
Diffstat (limited to 'sys/dev/isp')
-rw-r--r--sys/dev/isp/isp.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index e234e60..878b67c8 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -1249,6 +1249,17 @@ isp_fibre_init(struct ispsoftc *isp)
icbp->icb_retry_delay = fcp->isp_retry_delay;
icbp->icb_retry_count = fcp->isp_retry_count;
icbp->icb_hardaddr = loopid;
+ if (icbp->icb_hardaddr >= 125) {
+ /*
+ * We end up with a Loop ID of 255 for F-Port topologies
+ */
+ if (icbp->icb_hardaddr != 255) {
+ isp_prt(isp, ISP_LOGERR,
+ "bad hard address %u- resetting to zero",
+ icbp->icb_hardaddr);
+ }
+ icbp->icb_hardaddr = 0;
+ }
/*
* Right now we just set extended options to prefer point-to-point
* over loop based upon some soft config options.
@@ -1371,7 +1382,13 @@ isp_fibre_init(struct ispsoftc *isp)
icbp->icb_fwoptions &= ~(ICBOPT_BOTH_WWNS|ICBOPT_FULL_LOGIN);
}
icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp);
+ if (icbp->icb_rqstqlen < 1) {
+ isp_prt(isp, ISP_LOGERR, "bad request queue length");
+ }
icbp->icb_rsltqlen = RESULT_QUEUE_LEN(isp);
+ if (icbp->icb_rsltqlen < 1) {
+ isp_prt(isp, ISP_LOGERR, "bad result queue length");
+ }
icbp->icb_rqstaddr[RQRSP_ADDR0015] = DMA_WD0(isp->isp_rquest_dma);
icbp->icb_rqstaddr[RQRSP_ADDR1631] = DMA_WD1(isp->isp_rquest_dma);
icbp->icb_rqstaddr[RQRSP_ADDR3247] = DMA_WD2(isp->isp_rquest_dma);
@@ -3859,7 +3876,7 @@ again:
}
/*
- * Free any dma resources. As a side effect, this may
+ * Free any DMA resources. As a side effect, this may
* also do any cache flushing necessary for data coherence. */
if (XS_XFRLEN(xs)) {
ISP_DMAFREE(isp, xs, sp->req_handle);
OpenPOWER on IntegriCloud