diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-02-02 09:02:16 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-02-02 09:02:16 +0000 |
commit | ecee52fbe9c8cab203b4061815cbacee68ef2da9 (patch) | |
tree | f327f8ef84765d64e8a8f871047663da46b26c6f | |
parent | 01caaf4329dd320db9f84f7662214a8afc9a5747 (diff) | |
download | FreeBSD-src-ecee52fbe9c8cab203b4061815cbacee68ef2da9.zip FreeBSD-src-ecee52fbe9c8cab203b4061815cbacee68ef2da9.tar.gz |
Make sure we don't pick up a loopid that's larger than our
current portdb max (MAX_FC_TARG == 256) now that we support
2K Login f/w.
MFC after: 3 days
-rw-r--r-- | sys/dev/isp/isp.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index a9666e9..a1f4ac0 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -1688,6 +1688,12 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay) return (-1); } fcp->isp_loopid = mbs.param[1]; + if (fcp->isp_loopid == 0xffff) { /* happens with 2k login f/w */ + fcp->isp_loopid = MAX_FC_TARG-1; + } else if (fcp->isp_loopid >= MAX_FC_TARG) { + isp_prt(isp, ISP_LOGWARN, "bad initiator loopid (0x%x)", fcp->isp_loopid); + fcp->isp_loopid = MAX_FC_TARG-1; + } if (IS_2200(isp) || IS_23XX(isp)) { int topo = (int) mbs.param[6]; if (topo < TOPO_NL_PORT || topo > TOPO_PTP_STUB) @@ -1697,10 +1703,9 @@ isp_fclink_test(struct ispsoftc *isp, int usdelay) fcp->isp_topo = TOPO_NL_PORT; } /* - * XXX: We can get the AL_PA (low 8 bits) from here. - * XXX: Where do we get the upper 16 bits? + * Get the port id. */ - fcp->isp_portid = mbs.param[2] & 0xff; + fcp->isp_portid = mbs.param[2] | (mbs.param[3] << 16); /* * Check to see if we're on a fabric by trying to see if we @@ -2064,6 +2069,10 @@ isp_pdb_sync(struct ispsoftc *isp) */ if (mbs.param[1] != 0) { loopid = mbs.param[1]; + if (loopid >= MAX_FC_TARG) { + loopid = MAX_FC_TARG; + break; + } isp_prt(isp, ISP_LOGINFO, retained, loopid, (int) (lp - fcp->portdb), lp->portid); |