summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-08-01 12:58:48 +0000
committermav <mav@FreeBSD.org>2017-08-01 12:58:48 +0000
commit2fc541e724a8cd81d0f37dd1c202b888b327e9b6 (patch)
treea3c43cb950a74f8aaa485965b6859e8658a81a30
parentc1d6a4e9d2c040ce00f5eba80c7c5e1a9c7b6a5d (diff)
downloadFreeBSD-src-2fc541e724a8cd81d0f37dd1c202b888b327e9b6.zip
FreeBSD-src-2fc541e724a8cd81d0f37dd1c202b888b327e9b6.tar.gz
MFC r320492: Polish target_id/target_lun setting for ATIOs/INOTs.
For ATIOs it is pointless to report isp_loopid to CAM, since in other places it operates with port database record IDs, not with loop IDs. For INOTs target_id/target_lun seems were never set, so wildcard INOTs probably were not working correctly when LUN IDs were important.
-rw-r--r--sys/dev/isp/isp_freebsd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index 4b9e0b3..9e904da 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -1608,7 +1608,7 @@ isp_target_putback_atio(union ccb *ccb)
}
at->at_status = CT_OK;
at->at_rxid = cso->tag_id;
- at->at_iid = cso->ccb_h.target_id;
+ at->at_iid = cso->init_id;
if (isp_target_put_entry(isp, at)) {
callout_reset(&PISP_PCMD(ccb)->wdog, 10,
isp_refire_putback_atio, ccb);
@@ -1693,7 +1693,7 @@ isp_handle_platform_atio2(ispsoftc_t *isp, at2_entry_t *aep)
atp->state = ATPD_STATE_ATIO;
SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle);
ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n");
- atiop->ccb_h.target_id = fcp->isp_loopid;
+ atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp);
atiop->ccb_h.target_lun = lun;
/*
@@ -1872,7 +1872,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t *aep)
SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle);
ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n");
atiop->init_id = FC_PORTDB_TGT(isp, chan, lp);
- atiop->ccb_h.target_id = FCPARAM(isp, chan)->isp_loopid;
+ atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp);
atiop->ccb_h.target_lun = lun;
atiop->sense_len = 0;
cdbxlen = aep->at_cmnd.fcp_cmnd_alen_datadir >> FCP_CMND_ADDTL_CDBLEN_SHIFT;
@@ -2357,6 +2357,8 @@ isp_handle_platform_target_tmf(ispsoftc_t *isp, isp_notify_t *notify)
goto bad;
}
+ inot->ccb_h.target_id = ISP_MAX_TARGETS(isp);
+ inot->ccb_h.target_lun = lun;
if (isp_find_pdb_by_portid(isp, notify->nt_channel, notify->nt_sid, &lp) == 0 &&
isp_find_pdb_by_handle(isp, notify->nt_channel, notify->nt_nphdl, &lp) == 0) {
inot->initiator_id = CAM_TARGET_WILDCARD;
OpenPOWER on IntegriCloud