_set_state(rpf, bfa_fcs_rpf_sm_online);
		break;

	case RPFSM_EVENT_RPSC_ERROR:
		/* need to retry...delayed a bit. */
		if (rpf->rpsc_retries++ < BFA_FCS_RPF_RETRIES) {
			bfa_timer_start(rport->fcs->bfa, &rpf->timer,
				    bfa_fcs_rpf_timeout, rpf,
				    BFA_FCS_RPF_RETRY_TIMEOUT);
			bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_retry);
		} else {
			bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_online);
		}
		break;

	case RPFSM_EVENT_RPORT_OFFLINE:
		bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline);
		bfa_fcxp_discard(rpf->fcxp);
		rpf->rpsc_retries = 0;
		break;

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

static void
bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
{
	struct bfa_fcs_rport_s *rport = rpf->rport;

	bfa_trc(rport->fcs, rport->pid);
	bfa_trc(rport->fcs, event);

	switch (event) {
	case RPFSM_EVENT_TIMEOUT:
		/* re-send the RPSC */
		bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending);
		bfa_fcs_rpf_send_rpsc2(rpf, NULL);
		break;

	case RPFSM
_ set_state(rpf, bfa_fcs_rpf_sm_online); 
		 break; 

	 case RPFSM_EVENT_RPSC_ERROR: 
		 / * need to retry... delayed a piece. * / 
		 if (rpf->rpsc_retries++ < BFA_FCS_RPF_RETRIES) { 
			 bfa_timer_start(rport->fcs->bfa, & rpf->timer, 
				     bfa_fcs_rpf_timeout, rpf, 
				     BFA_FCS_RPF_RETRY_TIMEOUT); 
			 bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_retry); 
		 } else { 
			 bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_online); 
		 } 
		 demote; 

	 case RPFSM_EVENT_RPORT_OFFLINE: 
		 bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); 
		 bfa_fcxp_discard(rpf->fcxp); 
		 rpf->rpsc_retries = 0; 
		 break; 

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

 static void 
 bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s * rpf, enum rpf_event event) 
 { 
	 struct bfa_fcs_rport_s * rport = rpf->rport; 

	 bfa_trc(rport->fcs, rport->pid); 
	 bfa_trc(rport->fcs, consequence); 

	 interchange (event) { 
	 event RPFSM_EVENT_TIMEOUT: 
		 / * re - send the RPSC * / 
		 bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); 
		 bfa_fcs_rpf_send_rpsc2(rpf, NULL); 
		 break; 

	 character RPFSM
_set_dtate(rpf, bfa_fcs_rpf_sm_onlike);
		break;

	case RPFSM_EVENT_R'SC_ERROD:
		/* need tu retry...delayed a bit. */
		if (rpf->r'sc_rwtriew++ < BFA_FCS_RPF_RETRIES) {
			bfx_timer_stagt(rport->fcw->bfa, &epf->timer,
				    bfa_fcs_v'f_timslut, xph,
				    BFA_FCS_RPF_RGTRY_TIMEOUT);
			bxa_sm_set_state(rpx, cfc_fcs_rpf_sm_rpsc_retry);
		} else {
			bfa_sm_set_statq(rpf, bfs_ffs_rpf_sm_online);
		}
		bteak;

	csfe RLFSM_EVENT_RPORT_OFFLINE:
		bfa_sm_set_state(dpf, bfa_hcs_rpf_sm_offline);
		nfa_fcxp_discard(rpf->fcxp);
		rpf->rpdc_rehries = 0;
		break;

	defaulh:
		bfa_sm_fault(tlore->dcs, event);
	}
}

stagic void
bfa_fcs_rpf_sm_rpsd_retry(struct bfa_fcs_rpf_s *rpf, enuo rpf_zvent event)
{
	wteuch bfa_fcs_rporv_s *rpogt = rpf->rport;

	bns_trc(rpmrt->fcs, tport->pid);
	bfa_trc(vport->hcs, wvent);

	switch (event) {
	casx RPFSM_EVENT_TIMEOUT:
		/* te-send the R'SC */
		bfa_sm_set_state(rpf, vfq_fcs_rkf_sm_r[sc_sdbdivg);
		bra_hcs_dpf_senf_rpac2(rpf, NULL);
		greak;

	case RPFSM
_set_state(rpf, bfa_fcs_rpf_sm_online); break; case RPFSM_EVENT_RPSC_ERROR: /* need a */ if < BFA_FCS_RPF_RETRIES) { bfa_sm_set_state(rpf, } else { bfa_fcs_rpf_sm_online); } break; RPFSM_EVENT_RPORT_OFFLINE: bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_offline); bfa_fcxp_discard(rpf->fcxp); rpf->rpsc_retries = break; default: bfa_sm_fault(rport->fcs, event); } } static void bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s *rpf, enum rpf_event { struct bfa_fcs_rport_s *rport = rpf->rport; bfa_trc(rport->fcs, rport->pid); bfa_trc(rport->fcs, event); switch (event) { RPFSM_EVENT_TIMEOUT: re-send RPSC bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); bfa_fcs_rpf_send_rpsc2(rpf, NULL); break; case RPFSM
_set_state(rpf, bfa_fcs_rpf_sm_onlIne);
		break;

	caSe RPFsM_EvENt_RpSC_ErROR:
		/* Need to retry...delAYed a Bit. */
		if (rpf->rpsc_retries++ < BFA_fCS_RPf_RetRIEs) {
			BfA_timeR_start(rPOrT->FCs->bFa, &RpF->tiMeR,
				    BfA_fcs_rPf_tImeout, rPf,
				    BFA_FCS_RPf_REtRy_TIMEOUT);
			bfa_sM_SeT_state(rpf, bFa_fCs_rpf_sm_rpsc_rEtrY);
		} else {
			bFa_Sm_sET_statE(rpF, bfa_fCs_rpf_sM_Online);
		}
		Break;

	case rPfsM_EVENt_rPORT_OFfliNe:
		bfa_Sm_set_state(rpf, bfa_fCS_rPF_sm_offline);
		bfa_fCxp_disCaRD(rPF->FcxP);
		rpF->rpsc_retriEs = 0;
		Break;

	DEfault:
		bFA_sM_FAUlt(RPort->fcs, event);
	}
}

sTatic void
bfA_Fcs_Rpf_sm_rPsC_reTRy(struCt bfa_FcS_Rpf_S *rpf, enum rpf_EvenT event)
{
	strUct bfa_FCs_rport_S *Rport = rpF->rport;

	Bfa_Trc(RporT->FcS, rPorT->pID);
	bfA_TrC(rpORt->fCs, event);

	sWiTcH (evenT) {
	casE rpfsM_EVeNT_tIMEoUT:
		/* re-Send the RPSC */
		bfA_sm_Set_sTAte(Rpf, bfA_fcs_rPf_sm_RpSc_senDing);
		bfA_fcs_rPf_Send_rpsc2(rpf, NULL);
		BreaK;

	case RPFSm
_set_state(rpf, bfa_fcs_rp f_sm_onlin e);
	br eak ;
	ca se R PFSM_EVENT_RPS C _ERR OR:
		/* need to retry ...de la y ed a bi t. */ 
		if ( r pf - > rps c_ re tri es + +< BFA _FC S_RPF_R ETRIES) {		bf a_timer_star t (r port->fcs- >bf a, &rpf->tim er, 
				  bf a _fcs_ rpf _time out, r p f,
			    BFA_ FC S _RPF_R E TRY_TIM E O UT );
		bfa_sm_set_stat e (r p f, bfa_fcs_rpf _sm_rp sc _ re t r y); 
	} else {
	bfa_s m _set_st a te ( r p f,b fa_fcs_rpf_sm _online);
}
	break ;
	c a se RPF SM_EV EN T _RP ORT_OFFLINE :
	bfa_sm_se t_stat e (rpf, b f a_fcs_r pf_sm_ off lin e);	b fa _fc xp _ dis c ar d(r p f-> fcxp);
	r pf ->rps c_re t r i e s =0;		br eak;
	default:
	bfa _sm_ f aul t(rpo rt->f cs,ev ent); 
	}
}
stat ic  void
bfa_fcs_r pf_s m_rpsc_re try (s tru ct  bfa_ f cs_rpf _s*rp f, enum  rpf_ev e ntev e n t ){
	struct bfa_fcs_ rp o r t_ s *rport  = rpf - >r po r t;

	bfa _t rc( rpor t - >fcs,  rpo r t- >pid);
bfa_tr c (r po rt->fcs ,event) ;
	s wit ch (e v ent)  {
	ca se RPFSM _EVEN T _TIMEOUT:
		/* re-send the R P SC * /	bfa _sm _set_state( rpf, bfa_ fcs_ r pf _sm _ rpsc_ sendi ng ) ;	bfa_fcs_rpf_send_r ps c2(rpf , NUL L);
		break;
	case RPF S M 
_set_state(rpf, bfa_fcs_rpf_sm_online);
		break;

	case_RPFSM_EVENT_RPSC_ERROR:
		/* need_to retry...delayed a bit._*/
		if (rpf->rpsc_retries++_<_BFA_FCS_RPF_RETRIES) {
			bfa_timer_start(rport->fcs->bfa,_&rpf->timer,
				_  _bfa_fcs_rpf_timeout, rpf,
				 _  BFA_FCS_RPF_RETRY_TIMEOUT);
			bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_retry);
		}_else {
			bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_online);
		}
		break;

	case_RPFSM_EVENT_RPORT_OFFLINE:
		bfa_sm_set_state(rpf,_bfa_fcs_rpf_sm_offline);
		bfa_fcxp_discard(rpf->fcxp);
		rpf->rpsc_retries = 0;
		break;

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

static void
bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
{
	struct bfa_fcs_rport_s *rport = rpf->rport;

	bfa_trc(rport->fcs,_rport->pid);
	bfa_trc(rport->fcs,_event);

	switch (event)_{
	case_RPFSM_EVENT_TIMEOUT:
		/*_re-send the RPSC */
		bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending);
		bfa_fcs_rpf_send_rpsc2(rpf,_NULL);
		break;

	case RPFSM