aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_target.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2017-03-19 13:46:11 +0000
committerAlexander Motin <mav@FreeBSD.org>2017-03-19 13:46:11 +0000
commit9c81a61ee16ef5e146e0e0e77dbb5aacbd41633e (patch)
treecb1e34925f622217991d37c09c15cfa4ff9df6b7 /sys/dev/isp/isp_target.c
parente2a658cb0c04b0d1cbc17777e6a8fdae5627c904 (diff)
Notes
Diffstat (limited to 'sys/dev/isp/isp_target.c')
-rw-r--r--sys/dev/isp/isp_target.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c
index ac65b12314dd..f7a7efa3399c 100644
--- a/sys/dev/isp/isp_target.c
+++ b/sys/dev/isp/isp_target.c
@@ -688,8 +688,11 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep)
/* 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);
- isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0);
+ isp_prt(isp, ISP_LOGWARN,
+ "%s: D_ID 0x%x not found on any channel",
+ __func__, did);
+ isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN,
+ ECMD_TERMINATE, 0);
return;
}
} else {
@@ -891,17 +894,23 @@ isp_handle_abts(ispsoftc_t *isp, abts_t *abts)
nt->nt_did = did;
nt->nt_nphdl = abts->abts_nphdl;
nt->nt_sid = sid;
- isp_find_chan_by_did(isp, did, &chan);
- if (chan == ISP_NOCHAN) {
- nt->nt_tgt = TGT_ANY;
- } else {
- nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn;
- if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) {
- nt->nt_wwn = lp->port_wwn;
- } else {
- nt->nt_wwn = INI_ANY;
+ 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);
+ isp_acknak_abts(isp, abts, ENXIO);
+ return;
}
- }
+ } else
+ chan = 0;
+ nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn;
+ if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp))
+ nt->nt_wwn = lp->port_wwn;
+ else
+ nt->nt_wwn = INI_ANY;
nt->nt_lun = LUN_ANY;
nt->nt_need_ack = 1;
nt->nt_tagval = abts->abts_rxid_task;