From 7dd0f6589b1e7392840a4a5467a63d804a565c43 Mon Sep 17 00:00:00 2001 From: mav Date: Mon, 30 Nov 2015 21:42:35 +0000 Subject: MFC r291144: Fix target mode with fabric for pre-24xx chips. For those chips we are not receiving login events, adding initiators based on ATIO requests. But there is no port ID in that structure, so in fabric mode we have to explicitly fetch it from firmware to be able to do normal scan after that. --- sys/dev/isp/isp_library.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/dev/isp/isp_library.c') diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index eccc781..80ed53f 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -2580,12 +2580,12 @@ isp_add_wwn_entry(ispsoftc_t *isp, int chan, uint64_t wwpn, uint64_t wwnn, * so log them verbosely and dump the whole port database. */ if ((VALID_INI(wwpn) && isp_find_pdb_by_wwpn(isp, chan, wwpn, &lp)) || - (s_id != PORT_NONE && isp_find_pdb_by_portid(isp, chan, s_id, &lp))) { + (VALID_PORT(s_id) && isp_find_pdb_by_portid(isp, chan, s_id, &lp))) { change = 0; lp->new_portid = lp->portid; lp->new_prli_word3 = lp->prli_word3; - if (s_id != PORT_NONE && lp->portid != s_id) { - if (lp->portid == PORT_NONE) { + if (VALID_PORT(s_id) && lp->portid != s_id) { + if (!VALID_PORT(lp->portid)) { isp_prt(isp, ISP_LOGTINFO, "Chan %d WWPN 0x%016llx handle 0x%x " "gets PortID 0x%06x", @@ -2804,13 +2804,13 @@ isp_del_wwn_entries(ispsoftc_t *isp, isp_notify_t *mp) return; } } - if (mp->nt_wwn != INI_ANY) { + if (VALID_INI(mp->nt_wwn)) { if (isp_find_pdb_by_wwpn(isp, mp->nt_channel, mp->nt_wwn, &lp)) { isp_del_wwn_entry(isp, mp->nt_channel, lp->port_wwn, lp->handle, lp->portid); return; } } - if (mp->nt_sid != PORT_ANY && mp->nt_sid != PORT_NONE) { + if (VALID_PORT(mp->nt_sid)) { if (isp_find_pdb_by_portid(isp, mp->nt_channel, mp->nt_sid, &lp)) { isp_del_wwn_entry(isp, mp->nt_channel, lp->port_wwn, lp->handle, lp->portid); return; -- cgit v1.1