Date: Tue, 24 May 2016 07:14:24 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300582 - stable/10/sys/dev/isp Message-ID: <201605240714.u4O7EO5V076428@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue May 24 07:14:24 2016 New Revision: 300582 URL: https://svnweb.freebsd.org/changeset/base/300582 Log: MFC r300157: Unify Multi ID target code by reusing isp_find_chan_by_did(). Modified: stable/10/sys/dev/isp/isp_target.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_target.c ============================================================================== --- stable/10/sys/dev/isp/isp_target.c Tue May 24 07:13:42 2016 (r300581) +++ stable/10/sys/dev/isp/isp_target.c Tue May 24 07:14:24 2016 (r300582) @@ -775,18 +775,17 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_en notify.nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); notify.nt_lreserved = aep; sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | (aep->at_hdr.s_id[2]); - - /* Channel has to derived from D_ID */ did = (aep->at_hdr.d_id[0] << 16) | (aep->at_hdr.d_id[1] << 8) | aep->at_hdr.d_id[2]; - for (chan = 0; chan < isp->isp_nchan; chan++) { - if (FCPARAM(isp, chan)->isp_portid == did) { - break; + if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { + /* Channel has to be derived from D_ID */ + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); + /* just drop on the floor */ + return; } - } - if (chan == isp->isp_nchan) { - isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - /* just drop on the floor */ - return; + } else { + chan = 0; } notify.nt_nphdl = NIL_HANDLE; /* unknown here */ notify.nt_sid = sid;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605240714.u4O7EO5V076428>