FreeBSD/sys/dev/isp/isp.c
/*
 * Fix port IDs for logged-in initiators on pre-2400 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.
 */
Fix port IDs for logged-in initiators on pre-2400 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.
Fix port IDs for logged - in initiators on pre - 2400 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 .
static void
isp_fix_portids(ispsoftc_t *isp, int chan)
{
	fcparam *fcp = FCPARAM(isp, chan);
	isp_pdb_t pdb;
	uint64_t wwpn;
	int i, r;
	for (i = 0; i < MAX_FC_TARG; i++) {
		fcportdb_t *lp = &fcp->portdb[i];
		if (lp->state == FC_PORTDB_STATE_NIL ||
		    lp->state == FC_PORTDB_STATE_ZOMBIE)
			continue;
		if (VALID_PORT(lp->portid))
			continue;
		r = isp_getpdb(isp, chan, lp->handle, &pdb);
		if (fcp->isp_loopstate < LOOP_SCANNING_LOOP)
			return;
		if (r != 0) {
			isp_prt(isp, ISP_LOGDEBUG1,
			    "Chan %d FC Scan Loop handle %d returned %x",
			    chan, lp->handle, r);
			continue;
		}
		MAKE_WWN_FROM_NODE_NAME(wwpn, pdb.portname);
		if (lp->port_wwn != wwpn)
			continue;
		lp->portid = lp->new_portid = pdb.portid;
		isp_prt(isp, ISP_LOG_SANCFG,
		    "Chan %d Port 0x%06x@0x%04x is fixed",
		    chan, pdb.portid, pdb.handle);
	}
}
static void isp_fix_portids ( ispsoftc_t * isp , int chan ) { fcparam * fcp = FCPARAM ( isp , chan ) ; isp_pdb_t pdb ; uint64_t wwpn ; int i , r ; for ( i = 0 ; i < MAX_FC_TARG ; i ++ ) { fcportdb_t * lp = & fcp -> portdb [ i ] ; if ( lp -> state == FC_PORTDB_STATE_NIL || lp -> state == FC_PORTDB_STATE_ZOMBIE ) continue ; if ( VALID_PORT ( lp -> portid ) ) continue ; r = isp_getpdb ( isp , chan , lp -> handle , & pdb ) ; if ( fcp -> isp_loopstate < LOOP_SCANNING_LOOP ) return ; if ( r != 0 ) { isp_prt ( isp , ISP_LOGDEBUG1 , " " , chan , lp -> handle , r ) ; continue ; } MAKE_WWN_FROM_NODE_NAME ( wwpn , pdb . portname ) ; if ( lp -> port_wwn != wwpn ) continue ; lp -> portid = lp -> new_portid = pdb . portid ; isp_prt ( isp , ISP_LOG_SANCFG , " " , chan , pdb . portid , pdb . handle ) ; } }
Fix port IDs for logged-in initiators on pre-2400 chips.
Fix port IDs for logged - in initiators on pre - 2400 chips .