diff options
author | mav <mav@FreeBSD.org> | 2016-05-18 16:15:09 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-05-18 16:15:09 +0000 |
commit | f849a66bf14afaa8084bef0cfd58196c970cc833 (patch) | |
tree | 873105c749578f40ef38db429c2a2b57a860ec25 /sys/dev/isp | |
parent | 7fc7d2ed6e06340ab861cd094a78db87215ecff3 (diff) | |
download | FreeBSD-src-f849a66bf14afaa8084bef0cfd58196c970cc833.zip FreeBSD-src-f849a66bf14afaa8084bef0cfd58196c970cc833.tar.gz |
Unify Multi ID target code by reusing isp_find_chan_by_did().
Diffstat (limited to 'sys/dev/isp')
-rw-r--r-- | sys/dev/isp/isp_target.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c index 07c9b59..702bcf9 100644 --- a/sys/dev/isp/isp_target.c +++ b/sys/dev/isp/isp_target.c @@ -775,18 +775,17 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep) 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; |