Lines Matching +full:qe +full:- +full:firmware
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
30 struct bfad_s *bfad = fcs->bfad; in bfa_fcs_exit_comp()
32 complete(&bfad->comp); in bfa_fcs_exit_comp()
41 bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE); in bfa_fcs_init()
50 * FCS update cfg - reset the pwwn/nwwn of fabric base logical port
51 * with values learned during bfa_init firmware GETATTR REQ.
56 struct bfa_fcs_fabric_s *fabric = &fcs->fabric; in bfa_fcs_update_cfg()
57 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_update_cfg()
58 struct bfa_ioc_s *ioc = &fabric->fcs->bfa->ioc; in bfa_fcs_update_cfg()
60 port_cfg->nwwn = ioc->attr->nwwn; in bfa_fcs_update_cfg()
61 port_cfg->pwwn = ioc->attr->pwwn; in bfa_fcs_update_cfg()
70 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs); in bfa_fcs_stop()
71 bfa_wc_up(&fcs->wc); in bfa_fcs_stop()
73 bfa_wc_wait(&fcs->wc); in bfa_fcs_stop()
86 if (!fcs->min_cfg) { in bfa_fcs_pbc_vport_init()
88 bfa_iocfc_get_pbc_vports(fcs->bfa, pbc_vports); in bfa_fcs_pbc_vport_init()
90 bfa_fcb_pbc_vport_create(fcs->bfa->bfad, pbc_vports[i]); in bfa_fcs_pbc_vport_init()
108 fcs->driver_info = *driver_info; in bfa_fcs_driver_info_init()
110 bfa_fcs_fabric_psymb_init(&fcs->fabric); in bfa_fcs_driver_info_init()
111 bfa_fcs_fabric_nsymb_init(&fcs->fabric); in bfa_fcs_driver_info_init()
124 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs); in bfa_fcs_exit()
125 bfa_wc_up(&fcs->wc); in bfa_fcs_exit()
127 bfa_lps_delete(fcs->fabric.lps); in bfa_fcs_exit()
128 bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_DELETE); in bfa_fcs_exit()
129 bfa_wc_wait(&fcs->wc); in bfa_fcs_exit()
140 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
142 if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED) \
143 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \
145 (__fabric)->oper_type = BFA_PORT_TYPE_P2P; \
147 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \
207 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_uninit()
208 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_uninit()
214 bfa_fcs_lport_init(&fabric->bport, &fabric->bport.port_cfg); in bfa_fcs_fabric_sm_uninit()
222 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_uninit()
233 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_created()
235 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_created()
236 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_created()
240 if (!bfa_fcport_is_linkup(fabric->fcs->bfa)) { in bfa_fcs_fabric_sm_created()
246 fabric->fab_type = BFA_FCS_FABRIC_LOOP; in bfa_fcs_fabric_sm_created()
247 fabric->bport.pid = bfa_fcport_get_myalpa(bfa); in bfa_fcs_fabric_sm_created()
248 fabric->bport.pid = bfa_hton3b(fabric->bport.pid); in bfa_fcs_fabric_sm_created()
252 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_sm_created()
269 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_created()
281 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_linkdown()
283 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_linkdown()
284 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_linkdown()
293 fabric->fab_type = BFA_FCS_FABRIC_LOOP; in bfa_fcs_fabric_sm_linkdown()
294 fabric->bport.pid = bfa_fcport_get_myalpa(bfa); in bfa_fcs_fabric_sm_linkdown()
295 fabric->bport.pid = bfa_hton3b(fabric->bport.pid); in bfa_fcs_fabric_sm_linkdown()
298 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_sm_linkdown()
316 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_linkdown()
327 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_flogi()
328 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
333 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_flogi()
334 fabric->bb_credit); in bfa_fcs_fabric_sm_flogi()
335 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED; in bfa_fcs_fabric_sm_flogi()
337 if (fabric->auth_reqd && fabric->is_auth) { in bfa_fcs_fabric_sm_flogi()
339 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
348 bfa_timer_start(fabric->fcs->bfa, &fabric->delay_timer, in bfa_fcs_fabric_sm_flogi()
355 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
360 fabric->fab_type = BFA_FCS_FABRIC_N2N; in bfa_fcs_fabric_sm_flogi()
361 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_flogi()
362 fabric->bb_credit); in bfa_fcs_fabric_sm_flogi()
369 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
374 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
379 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
388 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_flogi_retry()
389 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi_retry()
399 bfa_timer_stop(&fabric->delay_timer); in bfa_fcs_fabric_sm_flogi_retry()
404 bfa_timer_stop(&fabric->delay_timer); in bfa_fcs_fabric_sm_flogi_retry()
409 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi_retry()
420 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_auth()
421 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_auth()
426 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_auth()
440 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_auth()
449 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_auth()
460 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_auth_failed()
461 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_auth_failed()
475 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_auth_failed()
486 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_loopback()
487 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_loopback()
501 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_loopback()
506 * There is no attached fabric - private loop or NPort-to-NPort topology.
512 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_nofabric()
513 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_nofabric()
518 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_nofabric()
528 bfa_trc(fabric->fcs, fabric->bb_credit); in bfa_fcs_fabric_sm_nofabric()
529 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_nofabric()
530 fabric->bb_credit); in bfa_fcs_fabric_sm_nofabric()
537 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_nofabric()
542 * Fabric is online - normal operating state.
548 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_online()
550 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_online()
551 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_online()
557 bfa_fcs_lport_offline(&fabric->bport); in bfa_fcs_fabric_sm_online()
559 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_online()
576 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_online()
583 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_online()
594 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_evfp()
595 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp()
607 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp()
618 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_evfp_done()
619 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp_done()
629 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad; in bfa_fcs_fabric_sm_isolated()
632 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_isolated()
633 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_isolated()
634 wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_isolated()
639 pwwn_ptr, fabric->fcs->port_vfid, in bfa_fcs_fabric_sm_isolated()
640 fabric->event_arg.swp_vfid); in bfa_fcs_fabric_sm_isolated()
650 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_deleting()
651 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_deleting()
656 bfa_wc_down(&fabric->fcs->wc); in bfa_fcs_fabric_sm_deleting()
667 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_deleting()
678 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_stopping()
680 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_stopping()
681 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_stopping()
689 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_LOGOUT); in bfa_fcs_fabric_sm_stopping()
704 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_stopping()
715 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_cleanup()
716 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_cleanup()
722 bfa_wc_down(&(fabric->fcs)->wc); in bfa_fcs_fabric_sm_cleanup()
727 * Ignore - can get this event if we get notified about IOC down in bfa_fcs_fabric_sm_cleanup()
733 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_cleanup()
744 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_init()
746 port_cfg->roles = BFA_LPORT_ROLE_FCP_IM; in bfa_fcs_fabric_init()
747 port_cfg->nwwn = fabric->fcs->bfa->ioc.attr->nwwn; in bfa_fcs_fabric_init()
748 port_cfg->pwwn = fabric->fcs->bfa->ioc.attr->pwwn; in bfa_fcs_fabric_init()
757 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_psymb_init()
759 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; in bfa_fcs_fabric_psymb_init()
761 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model); in bfa_fcs_fabric_psymb_init()
764 strscpy(port_cfg->sym_name.symname, model, in bfa_fcs_fabric_psymb_init()
766 strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR, in bfa_fcs_fabric_psymb_init()
770 strlcat(port_cfg->sym_name.symname, driver_info->version, in bfa_fcs_fabric_psymb_init()
772 strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR, in bfa_fcs_fabric_psymb_init()
776 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
777 driver_info->host_machine_name, in bfa_fcs_fabric_psymb_init()
779 strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR, in bfa_fcs_fabric_psymb_init()
787 if (driver_info->host_os_patch[0] == '\0') { in bfa_fcs_fabric_psymb_init()
788 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
789 driver_info->host_os_name, in bfa_fcs_fabric_psymb_init()
791 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
795 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
796 driver_info->host_os_name, in bfa_fcs_fabric_psymb_init()
798 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
803 strlcat(port_cfg->sym_name.symname, in bfa_fcs_fabric_psymb_init()
804 driver_info->host_os_patch, in bfa_fcs_fabric_psymb_init()
809 port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0; in bfa_fcs_fabric_psymb_init()
818 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_nsymb_init()
820 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; in bfa_fcs_fabric_nsymb_init()
822 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model); in bfa_fcs_fabric_nsymb_init()
825 strscpy(port_cfg->node_sym_name.symname, model, in bfa_fcs_fabric_nsymb_init()
827 strlcat(port_cfg->node_sym_name.symname, in bfa_fcs_fabric_nsymb_init()
832 strlcat(port_cfg->node_sym_name.symname, (char *)driver_info->version, in bfa_fcs_fabric_nsymb_init()
834 strlcat(port_cfg->node_sym_name.symname, in bfa_fcs_fabric_nsymb_init()
839 strlcat(port_cfg->node_sym_name.symname, in bfa_fcs_fabric_nsymb_init()
840 driver_info->host_machine_name, in bfa_fcs_fabric_nsymb_init()
842 strlcat(port_cfg->node_sym_name.symname, in bfa_fcs_fabric_nsymb_init()
847 port_cfg->node_sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0; in bfa_fcs_fabric_nsymb_init()
858 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_cb_lps_flogi_comp()
859 bfa_trc(fabric->fcs, status); in bfa_cb_lps_flogi_comp()
863 fabric->stats.flogi_accepts++; in bfa_cb_lps_flogi_comp()
868 fabric->stats.flogi_acc_err++; in bfa_cb_lps_flogi_comp()
874 switch (fabric->lps->ext_status) { in bfa_cb_lps_flogi_comp()
876 fabric->stats.flogi_acc_err++; in bfa_cb_lps_flogi_comp()
880 fabric->stats.flogi_unknown_rsp++; in bfa_cb_lps_flogi_comp()
891 fabric->stats.flogi_rejects++; in bfa_cb_lps_flogi_comp()
896 fabric->stats.flogi_rsp_err++; in bfa_cb_lps_flogi_comp()
901 fabric->bb_credit = fabric->lps->pr_bbcred; in bfa_cb_lps_flogi_comp()
902 bfa_trc(fabric->fcs, fabric->bb_credit); in bfa_cb_lps_flogi_comp()
904 if (!(fabric->lps->brcd_switch)) in bfa_cb_lps_flogi_comp()
905 fabric->fabric_name = fabric->lps->pr_nwwn; in bfa_cb_lps_flogi_comp()
908 * Check port type. It should be 1 = F-port. in bfa_cb_lps_flogi_comp()
910 if (fabric->lps->fport) { in bfa_cb_lps_flogi_comp()
911 fabric->bport.pid = fabric->lps->lp_pid; in bfa_cb_lps_flogi_comp()
912 fabric->is_npiv = fabric->lps->npiv_en; in bfa_cb_lps_flogi_comp()
913 fabric->is_auth = fabric->lps->auth_req; in bfa_cb_lps_flogi_comp()
917 * Nport-2-Nport direct attached in bfa_cb_lps_flogi_comp()
919 fabric->bport.port_topo.pn2n.rem_port_wwn = in bfa_cb_lps_flogi_comp()
920 fabric->lps->pr_pwwn; in bfa_cb_lps_flogi_comp()
921 fabric->fab_type = BFA_FCS_FABRIC_N2N; in bfa_cb_lps_flogi_comp()
925 bfa_trc(fabric->fcs, fabric->bport.pid); in bfa_cb_lps_flogi_comp()
926 bfa_trc(fabric->fcs, fabric->is_npiv); in bfa_cb_lps_flogi_comp()
927 bfa_trc(fabric->fcs, fabric->is_auth); in bfa_cb_lps_flogi_comp()
935 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_login()
936 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_login()
940 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa), in bfa_fcs_fabric_login()
941 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd); in bfa_fcs_fabric_login()
943 fabric->stats.flogi_sent++; in bfa_fcs_fabric_login()
950 struct list_head *qe, *qen; in bfa_fcs_fabric_notify_online() local
952 bfa_trc(fabric->fcs, fabric->fabric_name); in bfa_fcs_fabric_notify_online()
955 fabric->stats.fabric_onlines++; in bfa_fcs_fabric_notify_online()
960 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_notify_online()
962 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_notify_online()
963 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_notify_online()
972 struct list_head *qe, *qen; in bfa_fcs_fabric_notify_offline() local
974 bfa_trc(fabric->fcs, fabric->fabric_name); in bfa_fcs_fabric_notify_offline()
975 fabric->stats.fabric_offlines++; in bfa_fcs_fabric_notify_offline()
980 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_notify_offline()
981 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_notify_offline()
985 bfa_fcs_lport_offline(&fabric->bport); in bfa_fcs_fabric_notify_offline()
987 fabric->fabric_name = 0; in bfa_fcs_fabric_notify_offline()
988 fabric->fabric_ip_addr[0] = 0; in bfa_fcs_fabric_notify_offline()
1006 struct list_head *qe, *qen; in bfa_fcs_fabric_stop() local
1008 bfa_wc_init(&fabric->stop_wc, bfa_fcs_fabric_stop_comp, fabric); in bfa_fcs_fabric_stop()
1010 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_stop()
1011 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_stop()
1012 bfa_wc_up(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1016 bfa_wc_up(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1017 bfa_fcs_lport_stop(&fabric->bport); in bfa_fcs_fabric_stop()
1018 bfa_wc_wait(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1028 struct list_head *qe, *qen; in bfa_fcs_fabric_delete() local
1030 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_delete()
1031 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_delete()
1035 bfa_fcs_lport_delete(&fabric->bport); in bfa_fcs_fabric_delete()
1036 bfa_wc_wait(&fabric->wc); in bfa_fcs_fabric_delete()
1060 * Fabric module stop -- stop FCS actions
1068 fabric = &fcs->fabric; in bfa_fcs_fabric_modstop()
1073 * Fabric module start -- kick starts FCS actions
1081 fabric = &fcs->fabric; in bfa_fcs_fabric_modstart()
1092 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_link_up()
1102 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_link_down()
1112 * param[in] fabric - Fabric instance. This can be a base fabric or vf.
1113 * param[in] vport - Vport being created.
1122 * - add vport to fabric's vport_q in bfa_fcs_fabric_addvport()
1124 bfa_trc(fabric->fcs, fabric->vf_id); in bfa_fcs_fabric_addvport()
1126 list_add_tail(&vport->qe, &fabric->vport_q); in bfa_fcs_fabric_addvport()
1127 fabric->num_vports++; in bfa_fcs_fabric_addvport()
1128 bfa_wc_up(&fabric->wc); in bfa_fcs_fabric_addvport()
1140 list_del(&vport->qe); in bfa_fcs_fabric_delvport()
1141 fabric->num_vports--; in bfa_fcs_fabric_delvport()
1142 bfa_wc_down(&fabric->wc); in bfa_fcs_fabric_delvport()
1153 struct list_head *qe; in bfa_fcs_fabric_vport_lookup() local
1155 list_for_each(qe, &fabric->vport_q) { in bfa_fcs_fabric_vport_lookup()
1156 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_vport_lookup()
1157 if (bfa_fcs_lport_get_pwwn(&vport->lport) == pwwn) in bfa_fcs_fabric_vport_lookup()
1183 fab_nwwn = fabric->lps->pr_nwwn; in bfa_fcs_fabric_get_switch_oui()
1197 u32 pid = fchs->d_id; in bfa_fcs_fabric_uf_recv()
1199 struct list_head *qe; in bfa_fcs_fabric_uf_recv() local
1203 bfa_trc(fabric->fcs, len); in bfa_fcs_fabric_uf_recv()
1204 bfa_trc(fabric->fcs, pid); in bfa_fcs_fabric_uf_recv()
1212 (els_cmd->els_code == FC_ELS_FLOGI) && in bfa_fcs_fabric_uf_recv()
1213 (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) { in bfa_fcs_fabric_uf_recv()
1221 if (fchs->d_id == bfa_hton3b(FC_FABRIC_PORT)) { in bfa_fcs_fabric_uf_recv()
1222 bfa_trc(fabric->fcs, pid); in bfa_fcs_fabric_uf_recv()
1227 if (fabric->bport.pid == pid) { in bfa_fcs_fabric_uf_recv()
1231 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_uf_recv()
1232 if (els_cmd->els_code == FC_ELS_AUTH) { in bfa_fcs_fabric_uf_recv()
1233 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_uf_recv()
1237 bfa_trc(fabric->fcs, *(u8 *) ((u8 *) fchs)); in bfa_fcs_fabric_uf_recv()
1238 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len); in bfa_fcs_fabric_uf_recv()
1245 list_for_each(qe, &fabric->vport_q) { in bfa_fcs_fabric_uf_recv()
1246 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_fabric_uf_recv()
1247 if (vport->lport.pid == pid) { in bfa_fcs_fabric_uf_recv()
1248 bfa_fcs_lport_uf_recv(&vport->lport, fchs, len); in bfa_fcs_fabric_uf_recv()
1254 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len); in bfa_fcs_fabric_uf_recv()
1256 bfa_trc(fabric->fcs, fchs->type); in bfa_fcs_fabric_uf_recv()
1268 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_process_uf()
1270 switch (els_cmd->els_code) { in bfa_fcs_fabric_process_uf()
1291 struct bfa_fcs_lport_s *bport = &fabric->bport; in bfa_fcs_fabric_process_flogi()
1293 bfa_trc(fabric->fcs, fchs->s_id); in bfa_fcs_fabric_process_flogi()
1295 fabric->stats.flogi_rcvd++; in bfa_fcs_fabric_process_flogi()
1297 * Check port type. It should be 0 = n-port. in bfa_fcs_fabric_process_flogi()
1299 if (flogi->csp.port_type) { in bfa_fcs_fabric_process_flogi()
1303 bfa_trc(fabric->fcs, flogi->port_name); in bfa_fcs_fabric_process_flogi()
1304 fabric->stats.flogi_rejected++; in bfa_fcs_fabric_process_flogi()
1308 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred); in bfa_fcs_fabric_process_flogi()
1309 bport->port_topo.pn2n.rem_port_wwn = flogi->port_name; in bfa_fcs_fabric_process_flogi()
1310 bport->port_topo.pn2n.reply_oxid = fchs->ox_id; in bfa_fcs_fabric_process_flogi()
1322 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_send_flogi_acc()
1323 struct bfa_fcs_lport_n2n_s *n2n_port = &fabric->bport.port_topo.pn2n; in bfa_fcs_fabric_send_flogi_acc()
1324 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_send_flogi_acc()
1329 fcxp = bfa_fcs_fcxp_alloc(fabric->fcs, BFA_FALSE); in bfa_fcs_fabric_send_flogi_acc()
1331 * Do not expect this failure -- expect remote node to retry in bfa_fcs_fabric_send_flogi_acc()
1338 n2n_port->reply_oxid, pcfg->pwwn, in bfa_fcs_fabric_send_flogi_acc()
1339 pcfg->nwwn, in bfa_fcs_fabric_send_flogi_acc()
1343 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag, in bfa_fcs_fabric_send_flogi_acc()
1359 bfa_trc(fabric->fcs, status); in bfa_fcs_fabric_flogiacc_comp()
1370 struct bfad_s *bfad = (struct bfad_s *)port->fabric->fcs->bfad; in bfa_fcs_fabric_aen_post()
1377 aen_entry->aen_data.port.pwwn = bfa_fcs_lport_get_pwwn(port); in bfa_fcs_fabric_aen_post()
1378 aen_entry->aen_data.port.fwwn = bfa_fcs_lport_get_fabric_name(port); in bfa_fcs_fabric_aen_post()
1381 bfad_im_post_vendor_event(aen_entry, bfad, ++port->fcs->fcs_aen_seq, in bfa_fcs_fabric_aen_post()
1387 * @param[in] fabric - fabric
1388 * @param[in] wwn_t - new fabric name
1390 * @return - none
1396 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad; in bfa_fcs_fabric_set_fabric_name()
1400 bfa_trc(fabric->fcs, fabric_name); in bfa_fcs_fabric_set_fabric_name()
1402 if (fabric->fabric_name == 0) { in bfa_fcs_fabric_set_fabric_name()
1407 fabric->fabric_name = fabric_name; in bfa_fcs_fabric_set_fabric_name()
1409 fabric->fabric_name = fabric_name; in bfa_fcs_fabric_set_fabric_name()
1410 wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport)); in bfa_fcs_fabric_set_fabric_name()
1412 bfa_fcs_lport_get_fabric_name(&fabric->bport)); in bfa_fcs_fabric_set_fabric_name()
1416 bfa_fcs_fabric_aen_post(&fabric->bport, in bfa_fcs_fabric_set_fabric_name()
1431 * param[in] vf_id - VF_ID
1441 return &fcs->fabric; in bfa_fcs_vf_lookup()
1458 struct list_head *qe; in bfa_fcs_vf_get_ports() local
1466 fcs = vf->fcs; in bfa_fcs_vf_get_ports()
1468 bfa_trc(fcs, vf->vf_id); in bfa_fcs_vf_get_ports()
1471 lpwwn[i++] = vf->bport.port_cfg.pwwn; in bfa_fcs_vf_get_ports()
1473 list_for_each(qe, &vf->vport_q) { in bfa_fcs_vf_get_ports()
1477 vport = (struct bfa_fcs_vport_s *) qe; in bfa_fcs_vf_get_ports()
1478 lpwwn[i++] = vport->lport.port_cfg.pwwn; in bfa_fcs_vf_get_ports()
1497 bfa_fcs_fabric_link_up(&fcs->fabric); in bfa_fcs_port_event_handler()
1501 bfa_fcs_fabric_link_down(&fcs->fabric); in bfa_fcs_port_event_handler()
1533 if (fchs->routing == FC_RTG_EXT_HDR && in bfa_fcs_uf_recv()
1534 fchs->cat_info == FC_CAT_VFT_HDR) { in bfa_fcs_uf_recv()
1537 if (fcs->port_vfid == vft->vf_id) in bfa_fcs_uf_recv()
1538 fabric = &fcs->fabric; in bfa_fcs_uf_recv()
1540 fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id); in bfa_fcs_uf_recv()
1556 len -= sizeof(struct fc_vft_s); in bfa_fcs_uf_recv()
1558 bfa_trc(fcs, vft->vf_id); in bfa_fcs_uf_recv()
1561 fabric = &fcs->fabric; in bfa_fcs_uf_recv()
1577 * fcs attach -- called once to initialize data structures at driver attach time
1583 struct bfa_fcs_fabric_s *fabric = &fcs->fabric; in bfa_fcs_attach()
1585 fcs->bfa = bfa; in bfa_fcs_attach()
1586 fcs->bfad = bfad; in bfa_fcs_attach()
1587 fcs->min_cfg = min_cfg; in bfa_fcs_attach()
1588 fcs->num_rport_logins = 0; in bfa_fcs_attach()
1590 bfa->fcs = BFA_TRUE; in bfa_fcs_attach()
1593 bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs); in bfa_fcs_attach()
1594 bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs); in bfa_fcs_attach()
1601 fabric->fcs = fcs; in bfa_fcs_attach()
1602 INIT_LIST_HEAD(&fabric->vport_q); in bfa_fcs_attach()
1603 INIT_LIST_HEAD(&fabric->vf_q); in bfa_fcs_attach()
1604 fabric->lps = bfa_lps_alloc(fcs->bfa); in bfa_fcs_attach()
1605 WARN_ON(!fabric->lps); in bfa_fcs_attach()
1611 bfa_wc_init(&fabric->wc, bfa_fcs_fabric_delete_comp, fabric); in bfa_fcs_attach()
1612 bfa_wc_up(&fabric->wc); /* For the base port */ in bfa_fcs_attach()
1615 bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL); in bfa_fcs_attach()