static void bfa_fcs_vport_sm_created(struct bfa_fcs_vport_s *vport, enum bfa_fcs_vport_event event) { bfa_trc(__vport_fcs(vport), __vport_pwwn(vport)); bfa_trc(__vport_fcs(vport), event); switch (event) { case BFA_FCS_VPORT_SM_START: if (bfa_fcs_fabric_is_online(__vport_fabric(vport)) && bfa_fcs_fabric_npiv_capable(__vport_fabric(vport))) { bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc); bfa_fcs_vport_do_fdisc(vport); } else { vport->vport_stats.fab_no_npiv++; bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); } break; case BFA_FCS_VPORT_SM_DELETE: bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); bfa_fcs_port_delete(&vport->lport); break; case BFA_FCS_VPORT_SM_ONLINE: case BFA_FCS_VPORT_SM_OFFLINE: break; default: bfa_assert(0); } }
/** * Created state - a start event is required to start up the state machine. */ static void bfa_fcs_vport_sm_created(struct bfa_fcs_vport_s *vport, enum bfa_fcs_vport_event event) { bfa_trc(__vport_fcs(vport), __vport_pwwn(vport)); bfa_trc(__vport_fcs(vport), event); switch (event) { case BFA_FCS_VPORT_SM_START: if (bfa_fcs_fabric_is_online(__vport_fabric(vport)) && bfa_fcs_fabric_npiv_capable(__vport_fabric(vport))) { bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc); bfa_fcs_vport_do_fdisc(vport); } else { /** * Fabric is offline or not NPIV capable, stay in * offline state. */ vport->vport_stats.fab_no_npiv++; bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); } break; case BFA_FCS_VPORT_SM_DELETE: bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); bfa_fcs_port_delete(&vport->lport); break; case BFA_FCS_VPORT_SM_ONLINE: case BFA_FCS_VPORT_SM_OFFLINE: /** * Ignore ONLINE/OFFLINE events from fabric till vport is started. */ break; default: bfa_assert(0); } }