Lines Matching refs:bfa

39 #define BFA_PORT_IS_DISABLED(bfa) \
40 ((bfa_fcport_is_disabled(bfa) == BFA_TRUE) || \
41 (bfa_ioc_is_disabled(&bfa->ioc) == BFA_TRUE))
77 if ((__rp)->bfa->fcs) \
80 bfa_cb_queue((__rp)->bfa, &(__rp)->hcb_qe, \
86 if ((__rp)->bfa->fcs) \
89 bfa_cb_queue((__rp)->bfa, &(__rp)->hcb_qe, \
98 static void hal_fcxp_rx_plog(struct bfa_s *bfa, struct bfa_fcxp_s *fcxp,
100 static void hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen,
109 static void bfa_lps_login_rsp(struct bfa_s *bfa,
112 static void bfa_lps_logout_rsp(struct bfa_s *bfa,
153 static void bfa_trunk_iocdisable(struct bfa_s *bfa);
447 struct bfa_s *bfa)
449 struct bfa_fcxp_mod_s *fcxp_mod = BFA_FCXP_MOD(bfa);
450 struct bfa_mem_kva_s *fcxp_kva = BFA_MEM_FCXP_KVA(bfa);
484 bfa_fcxp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
487 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
489 mod->bfa = bfa;
506 bfa_fcxp_iocdisable(struct bfa_s *bfa)
508 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
524 bfa_cb_queue(bfa, &fcxp->hcb_qe,
548 struct bfa_s *bfa,
559 WARN_ON(bfa == NULL);
561 bfa_trc(bfa, fcxp->fcxp_tag);
586 void *caller, struct bfa_s *bfa, int nreq_sgles,
593 WARN_ON(bfa == NULL);
595 bfa_trc(bfa, fcxp->fcxp_tag);
599 bfa_fcxp_init_reqrsp(fcxp, bfa,
604 bfa_fcxp_init_reqrsp(fcxp, bfa,
623 bfa_trc(mod->bfa, fcxp->fcxp_tag);
625 bfa_fcxp_init(fcxp, wqe->caller, wqe->bfa, wqe->nreq_sgles,
666 hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp)
668 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
672 bfa_trc(bfa, fcxp_tag);
689 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp);
692 bfa_trc(mod->bfa, (NULL == fcxp->caller));
707 bfa_cb_queue(bfa, &fcxp->hcb_qe,
711 bfa_trc(bfa, (NULL == fcxp->send_cbfn));
716 hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen, struct bfa_fcxp_s *fcxp,
727 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_FCXP,
732 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP,
738 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP, BFA_PL_EID_TX,
744 hal_fcxp_rx_plog(struct bfa_s *bfa, struct bfa_fcxp_s *fcxp,
752 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_FCXP,
757 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP,
763 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP, BFA_PL_EID_RX,
775 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
779 send_req = bfa_reqq_next(bfa, BFA_REQQ_FCXP);
789 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
795 bfa_fn_lpu(bfa));
809 send_req->lp_fwtag = bfa_lps_get_fwtag(bfa, reqi->lp_tag);
855 hal_fcxp_tx_plog(bfa, reqi->req_tot_len, fcxp, &reqi->fchs);
857 bfa_reqq_produce(bfa, BFA_REQQ_FCXP, send_req->mh);
859 bfa_trc(bfa, bfa_reqq_pi(bfa, BFA_REQQ_FCXP));
860 bfa_trc(bfa, bfa_reqq_ci(bfa, BFA_REQQ_FCXP));
867 * @param[in] bfa BFA bfa instance
889 bfa_fcxp_req_rsp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles,
897 WARN_ON(bfa == NULL);
899 fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa), req);
903 bfa_trc(bfa, fcxp->fcxp_tag);
905 bfa_fcxp_init(fcxp, caller, bfa, nreq_sgles, nrsp_sgles, req_sga_cbfn,
973 bfa_trc(mod->bfa, fcxp->fcxp_tag);
1004 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
1009 bfa_trc(bfa, fcxp->fcxp_tag);
1029 send_req = bfa_reqq_next(bfa, BFA_REQQ_FCXP);
1031 bfa_trc(bfa, fcxp->fcxp_tag);
1033 bfa_reqq_wait(bfa, BFA_REQQ_FCXP, &fcxp->reqq_wqe);
1050 bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag);
1056 bfa_fcxp_req_rsp_alloc_wait(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe,
1064 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1074 wqe->bfa = bfa;
1089 bfa_fcxp_walloc_cancel(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe)
1091 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1116 bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
1120 hal_fcxp_send_comp(bfa, (struct bfi_fcxp_send_rsp_s *) msg);
1124 bfa_trc(bfa, msg->mhdr.msg_id);
1130 bfa_fcxp_get_maxrsp(struct bfa_s *bfa)
1132 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1138 bfa_fcxp_res_recfg(struct bfa_s *bfa, u16 num_fcxp_fw)
1140 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1165 bfa_trc(lps->bfa, lps->bfa_tag);
1166 bfa_trc(lps->bfa, event);
1170 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1172 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1179 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1182 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1213 bfa_sm_fault(lps->bfa, event);
1223 bfa_trc(lps->bfa, lps->bfa_tag);
1224 bfa_trc(lps->bfa, event);
1231 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1234 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1237 bfa_trc(lps->bfa, lps->fport);
1238 bfa_trc(lps->bfa, lps->lp_pid);
1245 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1249 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1262 bfa_trc(lps->bfa, lps->fport);
1263 bfa_trc(lps->bfa, lps->lp_pid);
1267 bfa_sm_fault(lps->bfa, event);
1277 bfa_trc(lps->bfa, lps->bfa_tag);
1278 bfa_trc(lps->bfa, event);
1301 bfa_sm_fault(lps->bfa, event);
1311 bfa_trc(lps->bfa, lps->bfa_tag);
1312 bfa_trc(lps->bfa, event);
1316 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1318 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1323 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1332 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1337 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1339 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1350 bfa_sm_fault(lps->bfa, event);
1360 bfa_trc(lps->bfa, lps->bfa_tag);
1361 bfa_trc(lps->bfa, event);
1371 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1381 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1392 bfa_sm_fault(lps->bfa, event);
1402 bfa_trc(lps->bfa, lps->bfa_tag);
1403 bfa_trc(lps->bfa, event);
1417 bfa_sm_fault(lps->bfa, event);
1427 bfa_trc(lps->bfa, lps->bfa_tag);
1428 bfa_trc(lps->bfa, event);
1443 bfa_sm_fault(lps->bfa, event);
1458 struct bfa_s *bfa)
1460 struct bfa_mem_kva_s *lps_kva = BFA_MEM_LPS_KVA(bfa);
1471 * bfa module attach at initialization time
1474 bfa_lps_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
1477 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1495 lps->bfa = bfa;
1507 bfa_lps_iocdisable(struct bfa_s *bfa)
1509 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1528 bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
1530 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1583 struct bfa_s *bfa = first_lps->bfa;
1584 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1588 bfa_trc(bfa, count);
1595 bfa_trc(bfa, lps->bfa_tag);
1609 bfa_lps_logout_rsp(struct bfa_s *bfa, struct bfi_lps_logout_rsp_s *rsp)
1611 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1624 bfa_lps_rx_cvl_event(struct bfa_s *bfa, struct bfi_lps_cvl_event_s *cvl)
1626 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1651 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa);
1664 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa);
1667 m = bfa_reqq_next(lps->bfa, lps->reqq);
1671 bfa_fn_lpu(lps->bfa));
1681 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1694 m = bfa_reqq_next(lps->bfa, lps->reqq);
1698 bfa_fn_lpu(lps->bfa));
1702 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1713 m = bfa_reqq_next(lps->bfa, lps->reqq);
1717 bfa_fn_lpu(lps->bfa));
1721 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1736 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
1738 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
1747 if (!lps->bfa->fcs) {
1748 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_login_comp_cb,
1754 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
1756 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
1771 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
1773 bfa_cb_lps_flogo_comp(lps->bfa->bfad, lps->uarg);
1782 if (!lps->bfa->fcs) {
1783 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_logout_comp_cb,
1788 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
1804 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
1814 if (!lps->bfa->fcs) {
1815 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_cvl_event_cb,
1822 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
1832 bfa_lps_get_max_vport(struct bfa_s *bfa)
1834 if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT)
1844 bfa_lps_alloc(struct bfa_s *bfa)
1846 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1915 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag)
1917 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1926 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid)
1928 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1946 bfa_lps_get_base_pid(struct bfa_s *bfa)
1948 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1959 bfa_trc(lps->bfa, lps->bfa_tag);
1960 bfa_trc(lps->bfa, n2n_pid);
1970 bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1974 bfa_trc(bfa, m->mhdr.msg_id);
1979 bfa_lps_login_rsp(bfa, msg.login_rsp);
1983 bfa_lps_logout_rsp(bfa, msg.logout_rsp);
1987 bfa_lps_rx_cvl_event(bfa, msg.cvl_event);
1991 bfa_trc(bfa, m->mhdr.msg_id);
1999 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2006 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa);
2010 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq,
2021 bfa_trc(fcport->bfa, event);
2031 bfa_trc(fcport->bfa, BFA_TRUE);
2034 bfa_trc(fcport->bfa, BFA_FALSE);
2061 bfa_sm_fault(fcport->bfa, event);
2070 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2071 bfa_trc(fcport->bfa, event);
2097 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2125 bfa_sm_fault(fcport->bfa, event);
2134 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2135 bfa_trc(fcport->bfa, event);
2164 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2187 bfa_sm_fault(fcport->bfa, event);
2197 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2199 bfa_trc(fcport->bfa, event);
2206 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2208 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) {
2210 bfa_trc(fcport->bfa,
2212 bfa_trc(fcport->bfa,
2216 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2220 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2256 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2279 bfa_sm_fault(fcport->bfa, event);
2288 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2290 bfa_trc(fcport->bfa, event);
2308 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2323 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2326 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2342 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2359 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2378 bfa_sm_fault(fcport->bfa, event);
2386 bfa_trc(fcport->bfa, event);
2429 bfa_sm_fault(fcport->bfa, event);
2437 bfa_trc(fcport->bfa, event);
2476 bfa_sm_fault(fcport->bfa, event);
2485 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2486 bfa_trc(fcport->bfa, event);
2506 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2531 bfa_sm_fault(fcport->bfa, event);
2540 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2541 bfa_trc(fcport->bfa, event);
2561 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2588 bfa_sm_fault(fcport->bfa, event);
2596 bfa_trc(fcport->bfa, event);
2622 bfa_trc(fcport->bfa, event);
2648 bfa_trc(fcport->bfa, event);
2670 bfa_trc(fcport->bfa, event);
2695 bfa_sm_fault(fcport->bfa, event);
2703 bfa_trc(fcport->bfa, event);
2729 bfa_sm_fault(fcport->bfa, event);
2737 bfa_trc(fcport->bfa, event);
2756 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2772 bfa_sm_fault(fcport->bfa, event);
2783 bfa_trc(ln->fcport->bfa, event);
2792 bfa_sm_fault(ln->fcport->bfa, event);
2803 bfa_trc(ln->fcport->bfa, event);
2815 bfa_sm_fault(ln->fcport->bfa, event);
2826 bfa_trc(ln->fcport->bfa, event);
2839 bfa_sm_fault(ln->fcport->bfa, event);
2850 bfa_trc(ln->fcport->bfa, event);
2859 bfa_sm_fault(ln->fcport->bfa, event);
2870 bfa_trc(ln->fcport->bfa, event);
2882 bfa_sm_fault(ln->fcport->bfa, event);
2893 bfa_trc(ln->fcport->bfa, event);
2906 bfa_sm_fault(ln->fcport->bfa, event);
2917 bfa_trc(ln->fcport->bfa, event);
2930 bfa_sm_fault(ln->fcport->bfa, event);
2973 if (fcport->bfa->fcs) {
2978 bfa_cb_queue(fcport->bfa, &ln->ln_qe,
2988 struct bfa_s *bfa)
2990 struct bfa_mem_dma_s *fcport_dma = BFA_MEM_FCPORT_DMA(bfa);
3018 bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
3021 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3025 fcport->bfa = bfa;
3061 bfa_fcport_start(struct bfa_s *bfa)
3063 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_START);
3070 bfa_fcport_iocdisable(struct bfa_s *bfa)
3072 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3075 bfa_trunk_iocdisable(bfa);
3127 bfa_trc(fcport->bfa, fcport->speed);
3128 bfa_trc(fcport->bfa, fcport->topology);
3156 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3158 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3164 bfa_fn_lpu(fcport->bfa));
3172 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo);
3173 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi);
3178 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh);
3199 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3201 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3207 bfa_fn_lpu(fcport->bfa));
3213 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh);
3221 fcport->pwwn = fcport->bfa->ioc.attr->pwwn;
3222 fcport->nwwn = fcport->bfa->ioc.attr->nwwn;
3224 bfa_trc(fcport->bfa, fcport->pwwn);
3225 bfa_trc(fcport->bfa, fcport->nwwn);
3278 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc))
3288 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe,
3303 bfa_trc(fcport->bfa, fcport->stats_qfull);
3320 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3326 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3334 bfa_fn_lpu(fcport->bfa));
3335 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh);
3353 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe,
3368 bfa_trc(fcport->bfa, fcport->stats_qfull);
3385 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3391 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3399 bfa_fn_lpu(fcport->bfa));
3400 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh);
3416 bfa_trc(fcport->bfa, fcport->cfg.trunked);
3420 bfa_trc(fcport->bfa, trunk->attr.state);
3421 bfa_trc(fcport->bfa, scn->trunk_state);
3422 bfa_trc(fcport->bfa, scn->trunk_speed);
3447 bfa_trc(fcport->bfa, lattr->link_state);
3448 bfa_trc(fcport->bfa, lattr->trunk_wwn);
3449 bfa_trc(fcport->bfa, lattr->fctl);
3450 bfa_trc(fcport->bfa, lattr->speed);
3451 bfa_trc(fcport->bfa, lattr->deskew);
3456 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3460 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3464 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3468 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3483 bfa_trunk_iocdisable(struct bfa_s *bfa)
3485 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3514 bfa_fcport_init(struct bfa_s *bfa)
3516 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3523 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc);
3524 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc);
3525 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc);
3527 if (bfa_fcport_is_pbcdisabled(bfa))
3528 bfa->modules.port.pbc_disabled = BFA_TRUE;
3539 bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
3541 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3547 bfa_trc(bfa, msg->mhdr.msg_id);
3548 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm));
3666 bfa_fcport_event_register(struct bfa_s *bfa,
3671 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3678 bfa_fcport_enable(struct bfa_s *bfa)
3680 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3682 if (bfa_fcport_is_pbcdisabled(bfa))
3685 if (bfa_ioc_is_disabled(&bfa->ioc))
3691 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_ENABLE);
3696 bfa_fcport_disable(struct bfa_s *bfa)
3698 if (bfa_fcport_is_pbcdisabled(bfa))
3701 if (bfa_ioc_is_disabled(&bfa->ioc))
3704 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DISABLE);
3710 bfa_fcport_is_pbcdisabled(struct bfa_s *bfa)
3712 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3713 struct bfa_iocfc_s *iocfc = &bfa->iocfc;
3717 bfa_trc(bfa, fcport->pwwn);
3727 bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
3729 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3731 bfa_trc(bfa, speed);
3739 bfa_trc(bfa, fcport->speed_sup);
3744 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) {
3747 (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id)))
3772 bfa_fcport_get_speed(struct bfa_s *bfa)
3774 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3783 bfa_fcport_cfg_topology(struct bfa_s *bfa, enum bfa_port_topology topology)
3785 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3787 bfa_trc(bfa, topology);
3788 bfa_trc(bfa, fcport->cfg.topology);
3795 if ((bfa_fcport_is_qos_enabled(bfa) != BFA_FALSE) ||
3800 if ((bfa_fcport_is_trunk_enabled(bfa) != BFA_FALSE) ||
3803 if ((bfa_fcport_get_speed(bfa) == BFA_PORT_SPEED_16GBPS) ||
3806 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type))
3808 if (bfa_fcport_is_dport(bfa) != BFA_FALSE)
3810 if (bfa_fcport_is_ddport(bfa) != BFA_FALSE)
3829 bfa_fcport_get_topology(struct bfa_s *bfa)
3831 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3840 bfa_fcport_get_cfg_topology(struct bfa_s *bfa)
3842 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3848 bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa)
3850 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3852 bfa_trc(bfa, alpa);
3853 bfa_trc(bfa, fcport->cfg.cfg_hardalpa);
3854 bfa_trc(bfa, fcport->cfg.hardalpa);
3863 bfa_fcport_clr_hardalpa(struct bfa_s *bfa)
3865 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3867 bfa_trc(bfa, fcport->cfg.cfg_hardalpa);
3868 bfa_trc(bfa, fcport->cfg.hardalpa);
3875 bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa)
3877 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3884 bfa_fcport_get_myalpa(struct bfa_s *bfa)
3886 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3892 bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize)
3894 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3896 bfa_trc(bfa, maxfrsize);
3897 bfa_trc(bfa, fcport->cfg.maxfrsize);
3912 bfa_fcport_get_maxfrsize(struct bfa_s *bfa)
3914 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3920 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa)
3922 if (bfa_fcport_get_topology(bfa) != BFA_PORT_TOPOLOGY_LOOP)
3923 return (BFA_FCPORT_MOD(bfa))->cfg.rx_bbcredit;
3930 bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit)
3932 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3942 bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node)
3944 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3952 bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3954 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3961 attr->factorypwwn = bfa->ioc.attr->mfg_pwwn;
3962 attr->factorynwwn = bfa->ioc.attr->mfg_nwwn;
3981 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
3982 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
3988 if (bfa_fcport_is_pbcdisabled(bfa))
3991 if (bfa_ioc_is_disabled(&fcport->bfa->ioc))
3993 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc))
4007 bfa_fcport_get_stats(struct bfa_s *bfa, struct bfa_cb_pending_q_s *cb)
4009 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4011 if (!bfa_iocfc_is_operational(bfa) ||
4021 bfa_timer_start(bfa, &fcport->timer,
4034 bfa_fcport_clear_stats(struct bfa_s *bfa, struct bfa_cb_pending_q_s *cb)
4036 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4038 if (!bfa_iocfc_is_operational(bfa) ||
4048 bfa_timer_start(bfa, &fcport->timer,
4061 bfa_fcport_is_disabled(struct bfa_s *bfa)
4063 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4071 bfa_fcport_is_dport(struct bfa_s *bfa)
4073 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4080 bfa_fcport_is_ddport(struct bfa_s *bfa)
4082 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4089 bfa_fcport_set_qos_bw(struct bfa_s *bfa, struct bfa_qos_bw_s *qos_bw)
4091 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4092 enum bfa_ioc_type_e ioc_type = bfa_get_type(bfa);
4094 bfa_trc(bfa, ioc_type);
4114 bfa_fcport_is_ratelim(struct bfa_s *bfa)
4116 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4126 bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state)
4128 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4130 bfa_trc(bfa, state);
4138 bfa_fcport_get_ratelim_speed(struct bfa_s *bfa)
4140 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4142 bfa_trc(bfa, fcport->cfg.trl_def_speed);
4151 struct bfa_s *bfa = dev;
4152 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4154 bfa_trc(bfa, beacon);
4155 bfa_trc(bfa, link_e2e_beacon);
4156 bfa_trc(bfa, fcport->beacon);
4157 bfa_trc(bfa, fcport->link_e2e_beacon);
4164 bfa_fcport_is_linkup(struct bfa_s *bfa)
4166 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4175 bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
4177 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4183 bfa_fcport_is_trunk_enabled(struct bfa_s *bfa)
4185 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4191 bfa_fcport_cfg_bbcr(struct bfa_s *bfa, bfa_boolean_t on_off, u8 bb_scn)
4193 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4195 bfa_trc(bfa, on_off);
4197 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4200 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type) &&
4201 (bfa->ioc.attr->card_type != BFA_MFG_TYPE_CHINOOK))
4215 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc)))
4218 if (bfa_ioc_speed_sup(&bfa->ioc) < BFA_PORT_SPEED_8GBPS)
4245 bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
4248 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4250 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4262 bfa_fcport_dportenable(struct bfa_s *bfa)
4267 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DPORTENABLE);
4268 bfa_port_set_dportenabled(&bfa->modules.port, BFA_TRUE);
4272 bfa_fcport_dportdisable(struct bfa_s *bfa)
4277 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DPORTDISABLE);
4278 bfa_port_set_dportenabled(&bfa->modules.port, BFA_FALSE);
4282 bfa_fcport_ddportenable(struct bfa_s *bfa)
4287 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTENABLE);
4291 bfa_fcport_ddportdisable(struct bfa_s *bfa)
4296 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTDISABLE);
4308 bfa_trc(rp->bfa, rp->rport_tag);
4309 bfa_trc(rp->bfa, event);
4319 bfa_sm_fault(rp->bfa, event);
4326 bfa_trc(rp->bfa, rp->rport_tag);
4327 bfa_trc(rp->bfa, event);
4351 bfa_sm_fault(rp->bfa, event);
4361 bfa_trc(rp->bfa, rp->rport_tag);
4362 bfa_trc(rp->bfa, event);
4388 bfa_sm_fault(rp->bfa, event);
4398 bfa_trc(rp->bfa, rp->rport_tag);
4399 bfa_trc(rp->bfa, event);
4429 bfa_sm_fault(rp->bfa, event);
4441 bfa_trc(rp->bfa, rp->rport_tag);
4442 bfa_trc(rp->bfa, event);
4473 bfa_trc(rp->bfa, qos_scn->old_qos_attr.qos_flow_id);
4474 bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_flow_id);
4475 bfa_trc(rp->bfa, qos_scn->old_qos_attr.qos_priority);
4476 bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_priority);
4497 bfa_sm_fault(rp->bfa, event);
4507 bfa_trc(rp->bfa, rp->rport_tag);
4508 bfa_trc(rp->bfa, event);
4530 bfa_sm_fault(rp->bfa, event);
4537 bfa_trc(rp->bfa, rp->rport_tag);
4538 bfa_trc(rp->bfa, event);
4560 bfa_sm_fault(rp->bfa, event);
4570 bfa_trc(rp->bfa, rp->rport_tag);
4571 bfa_trc(rp->bfa, event);
4599 bfa_sm_fault(rp->bfa, event);
4609 bfa_trc(rp->bfa, rp->rport_tag);
4610 bfa_trc(rp->bfa, event);
4626 bfa_sm_fault(rp->bfa, event);
4633 bfa_trc(rp->bfa, rp->rport_tag);
4634 bfa_trc(rp->bfa, event);
4651 bfa_sm_fault(rp->bfa, event);
4662 bfa_trc(rp->bfa, rp->rport_tag);
4663 bfa_trc(rp->bfa, event);
4682 bfa_sm_fault(rp->bfa, event);
4693 bfa_trc(rp->bfa, rp->rport_tag);
4694 bfa_trc(rp->bfa, event);
4718 bfa_sm_fault(rp->bfa, event);
4728 bfa_trc(rp->bfa, rp->rport_tag);
4729 bfa_trc(rp->bfa, event);
4756 bfa_sm_fault(rp->bfa, event);
4794 struct bfa_s *bfa)
4796 struct bfa_mem_kva_s *rport_kva = BFA_MEM_RPORT_KVA(bfa);
4807 bfa_rport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
4810 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
4827 rp->bfa = bfa;
4847 bfa_rport_iocdisable(struct bfa_s *bfa)
4849 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
4877 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa);
4892 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4894 bfa_reqq_wait(rp->bfa, BFA_REQQ_RPORT, &rp->reqq_wait);
4899 bfa_fn_lpu(rp->bfa));
4903 m->lp_fwtag = bfa_lps_get_fwtag(rp->bfa, (u8)rp->rport_info.lp_tag);
4913 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4925 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4927 bfa_reqq_wait(rp->bfa, BFA_REQQ_RPORT, &rp->reqq_wait);
4932 bfa_fn_lpu(rp->bfa));
4938 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4950 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4952 bfa_trc(rp->bfa, rp->rport_info.speed);
4957 bfa_fn_lpu(rp->bfa));
4964 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4978 bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
4983 bfa_trc(bfa, m->mhdr.msg_id);
4989 rp = BFA_RPORT_FROM_TAG(bfa, msg.create_rsp->bfa_handle);
4992 bfa_rport_set_lunmask(bfa, rp);
4998 rp = BFA_RPORT_FROM_TAG(bfa, msg.delete_rsp->bfa_handle);
5000 bfa_rport_unset_lunmask(bfa, rp);
5005 rp = BFA_RPORT_FROM_TAG(bfa, msg.qos_scn_evt->bfa_handle);
5011 bfa_fcport_update_loop_info(BFA_FCPORT_MOD(bfa),
5013 bfa_cb_rport_scn_online(bfa);
5017 bfa_cb_rport_scn_offline(bfa);
5021 rp = BFA_RPORT_FROM_TAG(bfa, msg.lip_scn->bfa_handle);
5026 bfa_trc(bfa, m->mhdr.msg_id);
5032 bfa_rport_res_recfg(struct bfa_s *bfa, u16 num_rport_fw)
5034 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
5049 bfa_rport_create(struct bfa_s *bfa, void *rport_drv)
5053 rp = bfa_rport_alloc(BFA_RPORT_MOD(bfa));
5058 rp->bfa = bfa;
5078 bfa_trc(rport->bfa, rport->rport_tag);
5100 bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
5102 struct bfa_lps_mod_s *lps_mod = BFA_LPS_MOD(bfa);
5111 bfa_fcpim_lunmask_rp_update(bfa, lp_wwn, rp_wwn, rp->rport_tag, lp_tag);
5116 bfa_rport_unset_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
5118 struct bfa_lps_mod_s *lps_mod = BFA_LPS_MOD(bfa);
5126 bfa_fcpim_lunmask_rp_update(bfa, lp_wwn, rp_wwn,
5139 struct bfa_s *bfa)
5141 struct bfa_sgpg_mod_s *sgpg_mod = BFA_SGPG_MOD(bfa);
5142 struct bfa_mem_kva_s *sgpg_kva = BFA_MEM_SGPG_KVA(bfa);
5173 bfa_sgpg_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5176 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5192 bfa_trc(bfa, cfg->drvcfg.num_sgpgs);
5236 bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs)
5238 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5256 bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpg)
5258 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5278 bfa_sgpg_malloc(bfa, &wqe->sgpg_q, nsgpg);
5288 bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpg)
5290 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5314 bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe)
5316 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5322 bfa_sgpg_mfree(bfa, &wqe->sgpg_q,
5347 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(uf->bfa);
5371 bfa_fn_lpu(ufm->bfa));
5397 uf->bfa = ufm->bfa;
5420 struct bfa_s *bfa)
5422 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5423 struct bfa_mem_kva_s *uf_kva = BFA_MEM_UF_KVA(bfa);
5447 bfa_uf_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5450 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5452 ufm->bfa = bfa;
5481 uf_post_msg = bfa_reqq_next(ufm->bfa, BFA_REQQ_FCXP);
5487 bfa_reqq_produce(ufm->bfa, BFA_REQQ_FCXP, uf_post_msg->mh);
5489 bfa_trc(ufm->bfa, uf->uf_tag);
5507 uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m)
5509 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5530 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_UF, BFA_PL_EID_RX,
5534 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_UF,
5539 if (bfa->fcs)
5542 bfa_cb_queue(bfa, &uf->hcb_qe, __bfa_cb_uf_recv, uf);
5546 bfa_uf_iocdisable(struct bfa_s *bfa)
5548 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5563 bfa_uf_start(struct bfa_s *bfa)
5565 bfa_uf_post_all(BFA_UF_MOD(bfa));
5571 * @param[in] bfa BFA instance
5576 bfa_uf_recv_register(struct bfa_s *bfa, bfa_cb_uf_recv_t ufrecv, void *cbarg)
5578 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5594 bfa_uf_put(BFA_UF_MOD(uf->bfa), uf);
5595 bfa_uf_post_all(BFA_UF_MOD(uf->bfa));
5604 bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
5606 bfa_trc(bfa, msg->mhdr.msg_id);
5610 uf_recv(bfa, (struct bfi_uf_frm_rcvd_s *) msg);
5614 bfa_trc(bfa, msg->mhdr.msg_id);
5620 bfa_uf_res_recfg(struct bfa_s *bfa, u16 num_uf_fw)
5622 struct bfa_uf_mod_s *mod = BFA_UF_MOD(bfa);
5695 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa);
5704 bfa_fcdiag_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5707 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5710 fcdiag->bfa = bfa;
5711 fcdiag->trcmod = bfa->trcmod;
5713 dport->bfa = bfa;
5723 bfa_fcdiag_iocdisable(struct bfa_s *bfa)
5725 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5767 req = bfa_reqq_next(fcdiag->bfa, fcdiag->qtest.queue);
5773 bfa_fn_lpu(fcdiag->bfa));
5780 bfa_reqq_produce(fcdiag->bfa, fcdiag->qtest.queue, req->mh);
5867 lb_req = bfa_reqq_next(fcdiag->bfa, BFA_REQQ_DIAG);
5873 bfa_fn_lpu(fcdiag->bfa));
5881 bfa_reqq_produce(fcdiag->bfa, BFA_REQQ_DIAG, lb_req->mh);
5894 bfa_fcdiag_intr(struct bfa_s *bfa, struct bfi_msg_s *msg)
5896 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5923 * @param[in] *bfa - bfa data struct
5935 bfa_fcdiag_loopback(struct bfa_s *bfa, enum bfa_port_opmode opmode,
5943 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5945 if (!bfa_iocfc_is_operational(bfa))
5949 if (bfa_fcport_is_pbcdisabled(bfa)) {
5954 if (bfa_fcport_is_disabled(bfa) == BFA_FALSE) {
5962 if (bfa_ioc_get_type(&bfa->ioc) == BFA_IOC_TYPE_FC) {
5972 bfa_fcport_get_attr(bfa, &attr);
5987 (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id))) {
5993 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type)) {
5994 if (bfa_ioc_get_type(&bfa->ioc) == BFA_IOC_TYPE_FC) {
6008 if (bfa_fcport_is_dport(bfa)) {
6037 * @param[in] *bfa - bfa data struct
6047 bfa_fcdiag_queuetest(struct bfa_s *bfa, u32 force, u32 queue,
6051 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6056 if (!force && !bfa_iocfc_is_operational(bfa))
6090 bfa_timer_start(bfa, &fcdiag->qtest.timer,
6101 * @param[in] *bfa - bfa data struct
6106 bfa_fcdiag_lb_is_running(struct bfa_s *bfa)
6108 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6139 bfa_trc(dport->bfa, event);
6143 bfa_fcport_dportenable(dport->bfa);
6160 bfa_fcport_ddportenable(dport->bfa);
6165 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6171 bfa_sm_fault(dport->bfa, event);
6179 bfa_trc(dport->bfa, event);
6194 bfa_sm_fault(dport->bfa, event);
6201 bfa_trc(dport->bfa, event);
6218 bfa_fcport_dportdisable(dport->bfa);
6228 bfa_sm_fault(dport->bfa, event);
6235 bfa_trc(dport->bfa, event);
6246 bfa_fcport_dportdisable(dport->bfa);
6277 bfa_fcport_ddportdisable(dport->bfa);
6288 bfa_fcport_ddportdisable(dport->bfa);
6295 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6296 bfa_sm_fault(dport->bfa, event);
6300 bfa_sm_fault(dport->bfa, event);
6308 bfa_trc(dport->bfa, event);
6327 bfa_sm_fault(dport->bfa, event);
6334 bfa_trc(dport->bfa, event);
6352 bfa_sm_fault(dport->bfa, event);
6360 bfa_trc(dport->bfa, event);
6375 bfa_sm_fault(dport->bfa, event);
6382 bfa_trc(dport->bfa, event);
6406 bfa_sm_fault(dport->bfa, event);
6414 bfa_trc(dport->bfa, event);
6422 bfa_fcport_enable(dport->bfa);
6426 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6427 bfa_sm_fault(dport->bfa, event);
6438 bfa_sm_fault(dport->bfa, event);
6446 bfa_trc(dport->bfa, event);
6465 bfa_sm_fault(dport->bfa, event);
6477 m = bfa_reqq_next(dport->bfa, BFA_REQQ_DIAG);
6479 bfa_reqq_wait(dport->bfa, BFA_REQQ_PORT, &dport->reqq_wait);
6484 bfa_fn_lpu(dport->bfa));
6494 bfa_reqq_produce(dport->bfa, BFA_REQQ_DIAG, m->mh);
6517 bfa_trc(dport->bfa, msg->status);
6518 bfa_trc(dport->bfa, dport->rp_pwwn);
6519 bfa_trc(dport->bfa, dport->rp_nwwn);
6523 bfa_trc(dport->bfa, msg->status);
6550 bfa_trc(dport->bfa, msg->state);
6556 bfa_trc(dport->bfa, dport->result.end_time);
6559 bfa_trc(dport->bfa, dport->result.status);
6571 bfa_trc(dport->bfa, dport->result.roundtrip_latency);
6572 bfa_trc(dport->bfa, dport->result.est_cable_distance);
6573 bfa_trc(dport->bfa, dport->result.buffer_required);
6574 bfa_trc(dport->bfa, dport->result.frmsz);
6575 bfa_trc(dport->bfa, dport->result.speed);
6580 bfa_trc(dport->bfa, dport->result.subtest[i].status);
6606 bfa_trc(dport->bfa, subtesttype);
6607 bfa_trc(dport->bfa,
6619 bfa_sm_fault(dport->bfa, msg->state);
6628 * @param[in] *bfa - bfa data struct
6631 bfa_dport_enable(struct bfa_s *bfa, u32 lpcnt, u32 pat,
6634 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6640 if (bfa_mfg_is_mezz(dport->bfa->ioc.attr->card_type)) {
6641 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6648 if (!(bfa_asic_id_ct2(dport->bfa->ioc.pcidev.device_id))) {
6649 bfa_trc(dport->bfa, dport->bfa->ioc.pcidev.device_id);
6656 if (!bfa_iocfc_is_operational(bfa))
6660 if (bfa_fcport_is_pbcdisabled(bfa)) {
6661 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6668 if (bfa_ioc_get_type(&bfa->ioc) != BFA_IOC_TYPE_FC) {
6669 bfa_trc(dport->bfa, bfa_ioc_get_type(&bfa->ioc));
6676 if ((bfa_fcport_get_cfg_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP) ||
6677 (bfa_fcport_get_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP)) {
6678 bfa_trc(dport->bfa, 0);
6685 if (bfa_fcport_is_trunk_enabled(bfa)) {
6686 bfa_trc(dport->bfa, 0);
6693 if (bfa_fcdiag_lb_is_running(bfa)) {
6694 bfa_trc(dport->bfa, 0);
6701 if ((bfa_fcport_is_disabled(bfa) == BFA_FALSE) &&
6702 (bfa_fcport_is_dport(bfa) == BFA_FALSE)) {
6703 bfa_trc(dport->bfa, 0);
6723 bfa_trc(dport->bfa, 0);
6727 bfa_trc(dport->bfa, lpcnt);
6728 bfa_trc(dport->bfa, pat);
6741 * @param[in] *bfa - bfa data struct
6744 bfa_dport_disable(struct bfa_s *bfa, bfa_cb_diag_t cbfn, void *cbarg)
6746 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6749 if (bfa_ioc_is_disabled(&bfa->ioc))
6753 if (bfa_fcport_is_pbcdisabled(bfa)) {
6754 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6768 if ((bfa_fcport_is_disabled(bfa) == BFA_FALSE) &&
6769 (bfa_fcport_is_dport(bfa) == BFA_FALSE)) {
6770 bfa_trc(dport->bfa, 0);
6784 bfa_trc(dport->bfa, 0);
6798 * @param[in] *bfa - bfa data struct
6801 bfa_dport_start(struct bfa_s *bfa, u32 lpcnt, u32 pat,
6804 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6810 if (!bfa_iocfc_is_operational(bfa))
6830 bfa_trc(dport->bfa, 0);
6843 bfa_trc(dport->bfa, lpcnt);
6844 bfa_trc(dport->bfa, pat);
6859 * @param[in] *bfa - bfa data struct
6862 bfa_dport_show(struct bfa_s *bfa, struct bfa_diag_dport_result_s *result)
6864 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6870 if (!bfa_iocfc_is_operational(bfa))
6883 bfa_trc(dport->bfa, 0);