38 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
52 bfa_fcs_exit_comp(
void *fcs_cbarg)
84 for (i = 0; i <
sizeof(fcs_modules) /
sizeof(fcs_modules[0]); i++) {
85 mod = &fcs_modules[
i];
100 for (i = 0; i <
sizeof(fcs_modules) /
sizeof(fcs_modules[0]); i++) {
101 mod = &fcs_modules[
i];
128 bfa_wc_init(&fcs->
wc, bfa_fcs_exit_comp, fcs);
131 bfa_wc_wait(&fcs->
wc);
147 for (i = 0; i < npbc_vports; i++)
185 bfa_wc_init(&fcs->
wc, bfa_fcs_exit_comp, fcs);
187 nmods =
sizeof(fcs_modules) /
sizeof(fcs_modules[0]);
189 for (i = 0; i < nmods; i++) {
191 mod = &fcs_modules[
i];
198 bfa_wc_wait(&fcs->
wc);
206 #define BFA_FCS_FABRIC_RETRY_DELAY (2000)
207 #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000)
209 #define bfa_fcs_fabric_set_opertype(__fabric) do { \
210 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
211 == BFA_PORT_TOPOLOGY_P2P) { \
212 if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED) \
213 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \
215 (__fabric)->oper_type = BFA_PORT_TYPE_P2P; \
217 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \
227 static void bfa_fcs_fabric_delay(
void *cbarg);
229 static void bfa_fcs_fabric_delete_comp(
void *cbarg);
231 static void bfa_fcs_fabric_stop_comp(
void *cbarg);
237 static void bfa_fcs_fabric_flogiacc_comp(
void *fcsarg,
286 bfa_fcs_fabric_init(fabric);
306 struct bfa_s *bfa = fabric->
fcs->bfa;
328 bfa_fcs_fabric_login(fabric);
338 bfa_fcs_fabric_delete(fabric);
354 struct bfa_s *bfa = fabric->
fcs->bfa;
363 bfa_fcs_fabric_login(fabric);
380 bfa_fcs_fabric_delete(fabric);
385 bfa_fcs_fabric_stop(fabric);
408 bfa_fcs_fabric_oper_bbscn(fabric));
416 bfa_fcs_fabric_notify_online(fabric);
423 bfa_fcs_fabric_delay, fabric,
437 bfa_fcs_fabric_oper_bbscn(fabric));
438 bfa_fcs_fabric_notify_online(fabric);
450 bfa_fcs_fabric_delete(fabric);
469 bfa_fcs_fabric_login(fabric);
480 bfa_fcs_fabric_delete(fabric);
506 bfa_fcs_fabric_notify_online(fabric);
520 bfa_fcs_fabric_delete(fabric);
541 bfa_fcs_fabric_notify_offline(fabric);
546 bfa_fcs_fabric_delete(fabric);
567 bfa_fcs_fabric_notify_offline(fabric);
572 bfa_fcs_fabric_delete(fabric);
594 bfa_fcs_fabric_notify_offline(fabric);
599 bfa_fcs_fabric_delete(fabric);
606 bfa_fcs_fabric_oper_bbscn(fabric));
624 struct bfa_s *bfa = fabric->
fcs->bfa;
636 bfa_fcs_fabric_notify_offline(fabric);
642 bfa_fcs_fabric_delete(fabric);
647 bfa_fcs_fabric_stop(fabric);
710 wwn2str(pwwn_ptr, fabric->
bport.port_cfg.pwwn);
713 "Port is isolated due to VF_ID mismatch. "
714 "PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.",
715 pwwn_ptr, fabric->
fcs->port_vfid,
732 bfa_wc_down(&fabric->
fcs->wc);
739 bfa_fcs_fabric_notify_offline(fabric);
754 struct bfa_s *bfa = fabric->
fcs->bfa;
798 bfa_wc_down(&(fabric->
fcs)->wc);
823 port_cfg->
nwwn = fabric->
fcs->bfa->ioc.attr->nwwn;
824 port_cfg->
pwwn = fabric->
fcs->bfa->ioc.attr->pwwn;
939 fabric->
stats.flogi_accepts++;
944 fabric->
stats.flogi_acc_err++;
950 switch (fabric->
lps->ext_status) {
952 fabric->
stats.flogi_acc_err++;
956 fabric->
stats.flogi_unknown_rsp++;
967 fabric->
stats.flogi_rejects++;
976 fabric->
stats.flogi_rsp_err++;
984 if (!(fabric->
lps->brcd_switch))
990 if (fabric->
lps->fport) {
991 fabric->
bport.pid = fabric->
lps->lp_pid;
999 fabric->
bport.port_topo.pn2n.rem_port_wwn =
1000 fabric->
lps->pr_pwwn;
1015 struct bfa_s *bfa = fabric->
fcs->bfa;
1017 u8 alpa = 0, bb_scn = 0;
1019 if (bfa_fcs_fabric_is_bbscn_enabled(fabric) &&
1020 (!fabric->
fcs->bbscn_flogi_rjt))
1026 fabric->
stats.flogi_sent++;
1038 fabric->
stats.fabric_onlines++;
1058 fabric->
stats.fabric_offlines++;
1075 bfa_fcs_fabric_delay(
void *cbarg)
1091 bfa_wc_init(&fabric->
stop_wc, bfa_fcs_fabric_stop_comp, fabric);
1101 bfa_wc_wait(&fabric->
stop_wc);
1110 u8 pr_bbscn = fabric->
lps->pr_bbscn;
1113 if (!(fcport->
cfg.bb_scn_state && pr_bbscn))
1130 fcport->
cfg.bb_scn_state &&
1153 bfa_wc_wait(&fabric->
wc);
1157 bfa_fcs_fabric_delete_comp(
void *cbarg)
1165 bfa_fcs_fabric_stop_comp(
void *cbarg)
1191 INIT_LIST_HEAD(&fabric->
vport_q);
1192 INIT_LIST_HEAD(&fabric->
vf_q);
1200 bfa_wc_init(&fabric->
wc, bfa_fcs_fabric_delete_comp, fabric);
1201 bfa_wc_up(&fabric->
wc);
1302 bfa_wc_up(&fabric->
wc);
1316 bfa_wc_down(&fabric->
wc);
1357 fab_nwwn = fabric->
lps->pr_nwwn;
1359 tmp = (
u8 *)&fab_nwwn;
1360 oui = (tmp[3] << 8) | tmp[4];
1397 bfa_fcs_fabric_process_uf(fabric, fchs, len);
1401 if (fabric->
bport.pid == pid) {
1421 if (vport->
lport.pid == pid) {
1446 bfa_fcs_fabric_process_flogi(fabric, fchs, len);
1469 fabric->
stats.flogi_rcvd++;
1473 if (flogi->
csp.port_type) {
1478 fabric->
stats.flogi_rejected++;
1490 bfa_fcs_fabric_send_flogi_acc(fabric);
1499 struct bfa_s *bfa = fabric->
fcs->bfa;
1517 bfa_fcs_fabric_oper_bbscn(fabric));
1521 reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric,
1529 bfa_fcs_fabric_flogiacc_comp(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
1590 "Base port WWN = %s Fabric WWN = %s\n",
1591 pwwn_ptr, fwwn_ptr);
1592 bfa_fcs_fabric_aen_post(&fabric->
bport,
1639 if (vf ==
NULL || lpwwn ==
NULL || *nlports == 0)
1647 lpwwn[i++] = vf->bport.port_cfg.pwwn;
1654 lpwwn[i++] = vport->
lport.port_cfg.pwwn;
1704 bfa_fcs_uf_recv(
void *cbarg,
struct bfa_uf_s *uf)
1707 struct fchs_s *fchs = bfa_uf_get_frmbuf(uf);
1708 u16 len = bfa_uf_get_frmlen(uf);
1718 vft = bfa_uf_get_frmbuf(uf);
1737 fchs = (
struct fchs_s *) (vft + 1);