* General Public License for more details.
*/
-/**
+/*
* bfa_fcs.c BFA FCS main
*/
BFA_TRC_FILE(FCS, FCS);
-/**
+/*
* FCS sub-modules
*/
struct bfa_fcs_mod_s {
bfa_fcs_fabric_modexit },
};
-/**
+/*
* fcs_api BFA FCS API
*/
-/**
+/*
* fcs_api BFA FCS API
*/
-/**
+/*
* fcs attach -- called once to initialize data structures at driver attach time
*/
void
}
}
-/**
+/*
* fcs initialization, called once after bfa initialization is complete
*/
void
}
}
-/**
+/*
* Start FCS operations.
*/
void
bfa_fcs_fabric_modstart(fcs);
}
-/**
+/*
* brief
* FCS driver details initialization.
*
bfa_fcs_fabric_psymb_init(&fcs->fabric);
}
-/**
+/*
* brief
* FCS FDMI Driver Parameter Initialization
*
fcs->fdmi_enabled = fdmi_enable;
}
-/**
+/*
* brief
* FCS instance cleanup and exit.
*
bfa_wc_down(&fcs->wc);
}
-/**
+/*
* Fabric module implementation.
*/
u32 rsp_len,
u32 resid_len,
struct fchs_s *rspfchs);
-/**
+/*
* fcs_fabric_sm fabric state machine functions
*/
-/**
+/*
* Fabric state machine events
*/
enum bfa_fcs_fabric_event {
enum bfa_fcs_fabric_event event);
static void bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
enum bfa_fcs_fabric_event event);
-/**
+/*
* Beginning state before fabric creation.
*/
static void
}
}
-/**
+/*
* Beginning state before fabric creation.
*/
static void
}
}
-/**
+/*
* Link is down, awaiting LINK UP event from port. This is also the
* first state at fabric creation.
*/
}
}
-/**
+/*
* FLOGI is in progress, awaiting FLOGI reply.
*/
static void
}
}
-/**
+/*
* Authentication is in progress, awaiting authentication results.
*/
static void
}
}
-/**
+/*
* Authentication failed
*/
static void
}
}
-/**
+/*
* Port is in loopback mode.
*/
static void
}
}
-/**
+/*
* There is no attached fabric - private loop or NPort-to-NPort topology.
*/
static void
}
}
-/**
+/*
* Fabric is online - normal operating state.
*/
static void
}
}
-/**
+/*
* Exchanging virtual fabric parameters.
*/
static void
}
}
-/**
+/*
* EVFP exchange complete and VFT tagging is enabled.
*/
static void
bfa_trc(fabric->fcs, event);
}
-/**
+/*
* Port is isolated after EVFP exchange due to VF_ID mismatch (N and F).
*/
static void
fabric->event_arg.swp_vfid);
}
-/**
+/*
* Fabric is being deleted, awaiting vport delete completions.
*/
static void
-/**
+/*
* fcs_fabric_private fabric private functions
*/
port_cfg->pwwn = bfa_ioc_get_pwwn(&fabric->fcs->bfa->ioc);
}
-/**
+/*
* Port Symbolic Name Creation for base port.
*/
void
port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
}
-/**
+/*
* bfa lps login completion callback
*/
void
bfa_trc(fabric->fcs, fabric->is_npiv);
bfa_trc(fabric->fcs, fabric->is_auth);
}
-/**
+/*
* Allocate and send FLOGI.
*/
static void
bfa_fcs_fabric_set_opertype(fabric);
fabric->stats.fabric_onlines++;
- /**
+ /*
* notify online event to base and then virtual ports
*/
bfa_fcs_lport_online(&fabric->bport);
bfa_trc(fabric->fcs, fabric->fabric_name);
fabric->stats.fabric_offlines++;
- /**
+ /*
* notify offline event first to vports and then base port.
*/
list_for_each_safe(qe, qen, &fabric->vport_q) {
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELAYED);
}
-/**
+/*
* Delete all vports and wait for vport delete completions.
*/
static void
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELCOMP);
}
-/**
+/*
* fcs_fabric_public fabric public functions
*/
-/**
+/*
* Attach time initialization.
*/
void
fabric = &fcs->fabric;
memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s));
- /**
+ /*
* Initialize base fabric.
*/
fabric->fcs = fcs;
fabric->lps = bfa_lps_alloc(fcs->bfa);
bfa_assert(fabric->lps);
- /**
+ /*
* Initialize fabric delete completion handler. Fabric deletion is
* complete when the last vport delete is complete.
*/
bfa_trc(fcs, 0);
}
-/**
+/*
* Module cleanup
*/
void
bfa_trc(fcs, 0);
- /**
+ /*
* Cleanup base fabric.
*/
fabric = &fcs->fabric;
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELETE);
}
-/**
+/*
* Fabric module start -- kick starts FCS actions
*/
void
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START);
}
-/**
+/*
* Suspend fabric activity as part of driver suspend.
*/
void
return fabric->oper_type;
}
-/**
+/*
* Link up notification from BFA physical port module.
*/
void
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_UP);
}
-/**
+/*
* Link down notification from BFA physical port module.
*/
void
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN);
}
-/**
+/*
* A child vport is being created in the fabric.
*
* Call from vport module at vport creation. A list of base port and vports
bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
struct bfa_fcs_vport_s *vport)
{
- /**
+ /*
* - add vport to fabric's vport_q
*/
bfa_trc(fabric->fcs, fabric->vf_id);
bfa_wc_up(&fabric->wc);
}
-/**
+/*
* A child vport is being deleted from fabric.
*
* Vport is being deleted.
bfa_wc_down(&fabric->wc);
}
-/**
+/*
* Base port is deleted.
*/
void
}
-/**
+/*
* Check if fabric is online.
*
* param[in] fabric - Fabric instance. This can be a base fabric or vf.
return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online);
}
-/**
+/*
* brief
*
*/
return BFA_STATUS_OK;
}
-/**
+/*
* Lookup for a vport withing a fabric given its pwwn
*/
struct bfa_fcs_vport_s *
return NULL;
}
-/**
+/*
* In a given fabric, return the number of lports.
*
* param[in] fabric - Fabric instance. This can be a base fabric or vf.
return oui;
}
-/**
+/*
* Unsolicited frame receive handling.
*/
void
bfa_trc(fabric->fcs, len);
bfa_trc(fabric->fcs, pid);
- /**
+ /*
* Look for our own FLOGI frames being looped back. This means an
* external loopback cable is in place. Our own FLOGI frames are
* sometimes looped back when switch port gets temporarily bypassed.
return;
}
- /**
+ /*
* FLOGI/EVFP exchanges should be consumed by base fabric.
*/
if (fchs->d_id == bfa_os_hton3b(FC_FABRIC_PORT)) {
}
if (fabric->bport.pid == pid) {
- /**
+ /*
* All authentication frames should be routed to auth
*/
bfa_trc(fabric->fcs, els_cmd->els_code);
return;
}
- /**
+ /*
* look for a matching local port ID
*/
list_for_each(qe, &fabric->vport_q) {
bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
}
-/**
+/*
* Unsolicited frames to be processed by fabric.
*/
static void
}
}
-/**
+/*
* Process incoming FLOGI
*/
static void
return;
}
- fabric->bb_credit = bfa_os_ntohs(flogi->csp.bbcred);
+ fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
struct fchs_s fchs;
fcxp = bfa_fcs_fcxp_alloc(fabric->fcs);
- /**
+ /*
* Do not expect this failure -- expect remote node to retry
*/
if (!fcxp)
FC_MAX_PDUSZ, 0);
}
-/**
+/*
* Flogi Acc completion callback.
*/
static void
}
}
-/**
+/*
* Returns FCS vf structure for a given vf_id.
*
* param[in] vf_id - VF_ID
return NULL;
}
-/**
+/*
* BFA FCS PPORT ( physical port)
*/
static void
bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
}
-/**
+/*
* BFA FCS UF ( Unsolicited Frames)
*/
-/**
+/*
* BFA callback for unsolicited frame receive handler.
*
* @param[in] cbarg callback arg for receive handler
struct fc_vft_s *vft;
struct bfa_fcs_fabric_s *fabric;
- /**
+ /*
* check for VFT header
*/
if (fchs->routing == FC_RTG_EXT_HDR &&
else
fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id);
- /**
+ /*
* drop frame if vfid is unknown
*/
if (!fabric) {
return;
}
- /**
+ /*
* skip vft header
*/
fchs = (struct fchs_s *) (vft + 1);