Update isp_tgt_map and send new arrival notification if target that departed

earlier has returned.  Previously that code worked only once, confusing CTL.

MFC after:	1 month
This commit is contained in:
Alexander Motin 2014-10-11 07:59:15 +00:00
parent dc5362fde9
commit 829485ba7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272936

View File

@ -2540,6 +2540,10 @@ isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint3
isp_prt(isp, ISP_LOGWARN, "Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x reentered", chan,
(unsigned long long) lp->port_wwn, lp->handle, lp->portid);
}
if (fcp->isp_tgt_map[nphdl] == 0) {
fcp->isp_tgt_map[nphdl] = i + 1;
goto notify;
}
return;
}
@ -2573,6 +2577,7 @@ isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t ini, uint16_t nphdl, uint3
isp_prt(isp, ISP_LOGTINFO, "Chan %d IID 0x%016llx N-Port Handle 0x%04x Port ID 0x%06x vtgt %d %s added", chan,
(unsigned long long) ini, nphdl, s_id, fcp->isp_tgt_map[nphdl] - 1, buf);
notify:
ISP_MEMZERO(&nt, sizeof (nt));
nt.nt_hba = isp;
nt.nt_wwn = ini;