_stop(&rport->timer);
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending);
		rport->ns_retries = 0;
		bfa_fcs_rport_send_nsdisc(rport, NULL);
		break;

	case RPSM_EVENT_LOGO_IMP:
		rport->pid = 0;
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline);
		bfa_timer_stop(&rport->timer);
		bfa_timer_start(rport->fcs->bfa, &rport->timer,
				bfa_fcs_rport_timeout, rport,
				bfa_fcs_rport_del_timeout);
		break;

	case RPSM_EVENT_PLOGI_COMP:
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online);
		bfa_timer_stop(&rport->timer);
		bfa_fcs_rport_hal_online(rport);
		break;

	default:
		bfa_sm_fault(rport->fcs, event);
	}
}

/*
 *		PLOGI is sent.
 */
static void
bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, enum rport_event event)
{
	bfa_trc(rport->fcs, rport->pwwn);
	bfa_trc(rport->fcs, rport->pid);
	bfa_trc(rport->fcs, event);

	switch (event) {
	case RPSM_EVENT_ACCEPTED:
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online);
		rport->plogi_retries = 0;
		bfa_fcs_rport_hal_online(rport);
		break;

	case RPSM_EVENT_LO
_ stop(&rport->timer); 
		 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); 
		 rport->ns_retries = 0; 
		 bfa_fcs_rport_send_nsdisc(rport, NULL); 
		 break; 

	 case RPSM_EVENT_LOGO_IMP: 
		 rport->pid = 0; 
		 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); 
		 bfa_timer_stop(&rport->timer); 
		 bfa_timer_start(rport->fcs->bfa, & rport->timer, 
				 bfa_fcs_rport_timeout, rport, 
				 bfa_fcs_rport_del_timeout); 
		 break; 

	 case RPSM_EVENT_PLOGI_COMP: 
		 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); 
		 bfa_timer_stop(&rport->timer); 
		 bfa_fcs_rport_hal_online(rport); 
		 demote; 

	 default: 
		 bfa_sm_fault(rport->fcs, event); 
	 } 
 } 

 / * 
  * 		 PLOGI is mail. 
  * / 
 electrostatic void 
 bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s * rport, enum rport_event event) 
 { 
	 bfa_trc(rport->fcs, rport->pwwn); 
	 bfa_trc(rport->fcs, rport->pid); 
	 bfa_trc(rport->fcs, consequence); 

	 switch (event) { 
	 case RPSM_EVENT_ACCEPTED: 
		 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); 
		 rport->plogi_retries = 0; 
		 bfa_fcs_rport_hal_online(rport); 
		 fracture; 

	 case RPSM_EVENT_LO
_stoo(&rport->timer);
		bfa_sm_set_state(vport, bfa_fcs_rporj_sn_nsdisr_sendinf);
		rport->ns_fetries = 0;
		bfa_fcs_rport_send_nsdidc(eport, NULL);
		break;

	case RPSM_EVEVT_LOGO_IMP:
		gport->pid = 0;
		bfa_wn_set_state(r'krt, bfa_nes_rpodb_sm_ofylmne);
		bfa_timer_stop(&tport->timer);
		bfd_timer_start(rpost->wcd->bfa, &rport->timer,
				bfa_fcs_rport_timeout, r[ort,
				bfa_gcd_rport_del_timeoot);
		bresh;

	cass RPSM_EVENT_PLOGI_COMP:
		bfa_sm_set_state(rlort, bfe_fcs_rport_sm_hal_omline);
		bfa_timer_stop(&rport->timeg);
		bfa_vcs_rport_hal_online(roort);
		break;

	dedaule:
		vfa_sm_fault(rpurt->fcs, event);
	}
}

/*
 *		PLOGI is aent.
 */
static void
bfa_fcs_rport_sm_plugi(stxuct bfa_fcs_t'irt_d *rport, enum rporn_event event)
{
	bns_trc(rpmrt->fcs, tport->pwwn);
	bfa_trg(rporv->fcs, rport->pid);
	bfa_trc(rport->frs, event);

	switch (event) {
	case RPSK_ERENT_ACCEPTED:
		bfa_sm_set_srare(rpott, bfd_fcs_fporg_sm_gak_ohline);
		roorv->plogi_retriss = 0;
		bfa_fcs_rport_hal_online(rport);
		btewj;

	case RPSM_EVEHT_LO
_stop(&rport->timer); bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); rport->ns_retries = 0; bfa_fcs_rport_send_nsdisc(rport, case rport->pid = bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); bfa_timer_stop(&rport->timer); break; RPSM_EVENT_PLOGI_COMP: bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); bfa_fcs_rport_hal_online(rport); break; default: event); } } /* * PLOGI sent. */ static void bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, enum rport_event event) { bfa_trc(rport->fcs, rport->pwwn); rport->pid); bfa_trc(rport->fcs, event); switch (event) { case RPSM_EVENT_ACCEPTED: bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); rport->plogi_retries = 0; break; RPSM_EVENT_LO
_stop(&rport->timer);
		bfa_sm_set_staTe(rport, bfa_Fcs_rpOrt_Sm_nSdIsc_sEndiNg);
		rport->ns_retriES = 0;
		bfa_Fcs_rport_send_nsdisc(rporT, NULL);
		BrEAk;

	caSE RpSM_EVeNT_LOGO_imP:
		RPOrt->PiD = 0;
		bFa_sM_sET_sTate(rPorT, bfa_fcs_Rport_sm_offLinE);
		bFa_timer_stop(&rPOrT->timer);
		bfa_tImeR_start(rport->fCs->bFa, &rporT->tImeR,
				Bfa_fcS_rpOrt_tiMeout, rPOrt,
				bfa_Fcs_rport_dEl_TImeout);
		BReak;

	casE rpSm_EVEnT_PLOGI_COMP:
		bfa_sm_sET_sTAte(rport, bfa_fcs_Rport_sM_hAL_oNLIne);
		Bfa_Timer_stop(&rPoRt->timER);
		bfa_fcs_RPoRT_HAl_oNLine(rport);
		breaK;

	default:
		bfa_SM_faUlt(rpoRt->Fcs, EVent);
	}
}

/*
 *		PLoGI is SeNT.
 */
stAtic void
bfa_Fcs_rPort_sm_ploGi(struCT bfa_fcs_RPort_s *rpOrt, enuM rpOrt_EvenT EvEnT)
{
	bfA_tRC(rpORt->Fcs, RPorT->pwwn);
	bfa_TrC(rPort->fCs, rpORT->PId);
	bfA_trC(rpoRt->fcs, Event);

	switch (evEnt) {
	Case rpSM_eVENT_aCCEPtED:
		bFa_Sm_set_State(rPort, bFa_Fcs_rport_sm_hal_onLine);
		Rport->plogI_reTrIes = 0;
		BfA_fcs_rPOrt_hal_OnlIne(Rport);
		brEak;

	case rpSM_eVent_lO
_stop(&rport->timer);
		bf a_sm_set_s tate( rpo rt,  b fa_f cs_r port_sm_nsdisc _ send ing);
		rport->ns_retr ies =  0 ; 
		b f a_ fcs_r port_se n d_ n s dis c( rp ort ,N UL L);
	br eak;

case RPSM_ EVE NT _LOGO_IMP:
rp ort->pid =  0; 
		bfa_sm_se t_s tate(r po rt, bfa_f cs_ rport _sm_of f line); 
		bfa_ti me r _stop( & rport-> t i me r);		bfa_timer_start ( rp o rt->fcs->bfa,&rport -> t im e r ,
		bfa_fcs_rp or t_tim e out, rp o rt , 		b fa_fcs_rport_ del_timeout ) ;
	break ;
	c a se RPS M_EVE NT _ PLO GI_COMP:
	bfa_ sm_set_st ate(rp o rt, bfa _ fcs_rpo rt_sm_ hal _on line ) ;	bfa _t i mer _ st op( & rpo rt->time r) ;		bfa _fcs _ r p o rt_h al_ onli ne(rp ort);
		break ;
	def a ult :
		b fa_sm _fau lt (rpor t->fcs , eve nt );
	}
}

/*
 *	PLO GI is sen t. * /
s ta tic v o id
bfa _fc s_r port_sm _plogi( s tru ct b f a_ fcs_rport_s *rport ,e n um  rport_e vent e v en t) {
	bfa_t rc (rp ort- > f cs, r port - >p wwn);
	b fa_trc ( rp or t->fcs,  r port-> pi d); 
	b fa_tr c (rpo rt->fc s, event );

s witch (event){ 
	case RPSM_E V EN T _ AC C EPTE D:		bfa_sm_se t_st a te(r port ,  b fa_ f cs_rp ort_s m_ h al _ online);
		rport->p lo gi_ret ries= 0;
		bfa_fc s_rport_ha l _ o nline(rp ort) ; 
break;

	caseRPSM_ EVENT_LO
_stop(&rport->timer);
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending);
		rport->ns_retries_= 0;
		bfa_fcs_rport_send_nsdisc(rport,_NULL);
		break;

	case RPSM_EVENT_LOGO_IMP:
		rport->pid = 0;
		bfa_sm_set_state(rport,_bfa_fcs_rport_sm_offline);
		bfa_timer_stop(&rport->timer);
		bfa_timer_start(rport->fcs->bfa, &rport->timer,
				bfa_fcs_rport_timeout,_rport,
				bfa_fcs_rport_del_timeout);
		break;

	case_RPSM_EVENT_PLOGI_COMP:
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online);
		bfa_timer_stop(&rport->timer);
		bfa_fcs_rport_hal_online(rport);
		break;

	default:
		bfa_sm_fault(rport->fcs,_event);
	}
}

/*
_*		PLOGI is sent.
_*/
static void
bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s_*rport, enum rport_event event)
{
	bfa_trc(rport->fcs,_rport->pwwn);
	bfa_trc(rport->fcs, rport->pid);
	bfa_trc(rport->fcs, event);

	switch_(event)_{
	case RPSM_EVENT_ACCEPTED:
		bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online);
		rport->plogi_retries = 0;
		bfa_fcs_rport_hal_online(rport);
		break;

	case RPSM_EVENT_LO