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);
453 struct bfa_s *bfa)
455 struct bfa_fcxp_mod_s *fcxp_mod = BFA_FCXP_MOD(bfa);
456 struct bfa_mem_kva_s *fcxp_kva = BFA_MEM_FCXP_KVA(bfa);
490 bfa_fcxp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
493 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
495 mod->bfa = bfa;
512 bfa_fcxp_iocdisable(struct bfa_s *bfa)
514 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
530 bfa_cb_queue(bfa, &fcxp->hcb_qe,
554 struct bfa_s *bfa,
565 WARN_ON(bfa == NULL);
567 bfa_trc(bfa, fcxp->fcxp_tag);
592 void *caller, struct bfa_s *bfa, int nreq_sgles,
599 WARN_ON(bfa == NULL);
601 bfa_trc(bfa, fcxp->fcxp_tag);
605 bfa_fcxp_init_reqrsp(fcxp, bfa,
610 bfa_fcxp_init_reqrsp(fcxp, bfa,
629 bfa_trc(mod->bfa, fcxp->fcxp_tag);
631 bfa_fcxp_init(fcxp, wqe->caller, wqe->bfa, wqe->nreq_sgles,
672 hal_fcxp_send_comp(struct bfa_s *bfa, struct bfi_fcxp_send_rsp_s *fcxp_rsp)
674 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
678 bfa_trc(bfa, fcxp_tag);
695 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp);
698 bfa_trc(mod->bfa, (NULL == fcxp->caller));
713 bfa_cb_queue(bfa, &fcxp->hcb_qe,
717 bfa_trc(bfa, (NULL == fcxp->send_cbfn));
722 hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen, struct bfa_fcxp_s *fcxp,
733 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_FCXP,
738 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP,
744 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP, BFA_PL_EID_TX,
750 hal_fcxp_rx_plog(struct bfa_s *bfa, struct bfa_fcxp_s *fcxp,
758 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_FCXP,
763 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP,
769 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_FCXP, BFA_PL_EID_RX,
781 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
785 send_req = bfa_reqq_next(bfa, BFA_REQQ_FCXP);
795 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
801 bfa_fn_lpu(bfa));
815 send_req->lp_fwtag = bfa_lps_get_fwtag(bfa, reqi->lp_tag);
861 hal_fcxp_tx_plog(bfa, reqi->req_tot_len, fcxp, &reqi->fchs);
863 bfa_reqq_produce(bfa, BFA_REQQ_FCXP, send_req->mh);
865 bfa_trc(bfa, bfa_reqq_pi(bfa, BFA_REQQ_FCXP));
866 bfa_trc(bfa, bfa_reqq_ci(bfa, BFA_REQQ_FCXP));
873 * @param[in] bfa BFA bfa instance
895 bfa_fcxp_req_rsp_alloc(void *caller, struct bfa_s *bfa, int nreq_sgles,
903 WARN_ON(bfa == NULL);
905 fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa), req);
909 bfa_trc(bfa, fcxp->fcxp_tag);
911 bfa_fcxp_init(fcxp, caller, bfa, nreq_sgles, nrsp_sgles, req_sga_cbfn,
979 bfa_trc(mod->bfa, fcxp->fcxp_tag);
1010 struct bfa_s *bfa = fcxp->fcxp_mod->bfa;
1015 bfa_trc(bfa, fcxp->fcxp_tag);
1035 send_req = bfa_reqq_next(bfa, BFA_REQQ_FCXP);
1037 bfa_trc(bfa, fcxp->fcxp_tag);
1039 bfa_reqq_wait(bfa, BFA_REQQ_FCXP, &fcxp->reqq_wqe);
1056 bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag);
1062 bfa_fcxp_req_rsp_alloc_wait(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe,
1070 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1080 wqe->bfa = bfa;
1095 bfa_fcxp_walloc_cancel(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe)
1097 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1122 bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
1126 hal_fcxp_send_comp(bfa, (struct bfi_fcxp_send_rsp_s *) msg);
1130 bfa_trc(bfa, msg->mhdr.msg_id);
1136 bfa_fcxp_get_maxrsp(struct bfa_s *bfa)
1138 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1144 bfa_fcxp_res_recfg(struct bfa_s *bfa, u16 num_fcxp_fw)
1146 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
1171 bfa_trc(lps->bfa, lps->bfa_tag);
1172 bfa_trc(lps->bfa, event);
1176 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1178 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1185 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1188 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1219 bfa_sm_fault(lps->bfa, event);
1229 bfa_trc(lps->bfa, lps->bfa_tag);
1230 bfa_trc(lps->bfa, event);
1237 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1240 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1243 bfa_trc(lps->bfa, lps->fport);
1244 bfa_trc(lps->bfa, lps->lp_pid);
1251 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1255 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1268 bfa_trc(lps->bfa, lps->fport);
1269 bfa_trc(lps->bfa, lps->lp_pid);
1273 bfa_sm_fault(lps->bfa, event);
1283 bfa_trc(lps->bfa, lps->bfa_tag);
1284 bfa_trc(lps->bfa, event);
1307 bfa_sm_fault(lps->bfa, event);
1317 bfa_trc(lps->bfa, lps->bfa_tag);
1318 bfa_trc(lps->bfa, event);
1322 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1324 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1329 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1338 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1343 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
1345 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
1356 bfa_sm_fault(lps->bfa, event);
1366 bfa_trc(lps->bfa, lps->bfa_tag);
1367 bfa_trc(lps->bfa, event);
1377 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1387 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
1398 bfa_sm_fault(lps->bfa, event);
1408 bfa_trc(lps->bfa, lps->bfa_tag);
1409 bfa_trc(lps->bfa, event);
1423 bfa_sm_fault(lps->bfa, event);
1433 bfa_trc(lps->bfa, lps->bfa_tag);
1434 bfa_trc(lps->bfa, event);
1449 bfa_sm_fault(lps->bfa, event);
1464 struct bfa_s *bfa)
1466 struct bfa_mem_kva_s *lps_kva = BFA_MEM_LPS_KVA(bfa);
1477 * bfa module attach at initialization time
1480 bfa_lps_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
1483 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1501 lps->bfa = bfa;
1513 bfa_lps_iocdisable(struct bfa_s *bfa)
1515 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1534 bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
1536 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1589 struct bfa_s *bfa = first_lps->bfa;
1590 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1594 bfa_trc(bfa, count);
1601 bfa_trc(bfa, lps->bfa_tag);
1615 bfa_lps_logout_rsp(struct bfa_s *bfa, struct bfi_lps_logout_rsp_s *rsp)
1617 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1630 bfa_lps_rx_cvl_event(struct bfa_s *bfa, struct bfi_lps_cvl_event_s *cvl)
1632 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1657 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa);
1670 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa);
1673 m = bfa_reqq_next(lps->bfa, lps->reqq);
1677 bfa_fn_lpu(lps->bfa));
1687 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1700 m = bfa_reqq_next(lps->bfa, lps->reqq);
1704 bfa_fn_lpu(lps->bfa));
1708 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1719 m = bfa_reqq_next(lps->bfa, lps->reqq);
1723 bfa_fn_lpu(lps->bfa));
1727 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1742 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
1744 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
1753 if (!lps->bfa->fcs) {
1754 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_login_comp_cb,
1760 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
1762 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
1777 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
1779 bfa_cb_lps_flogo_comp(lps->bfa->bfad, lps->uarg);
1788 if (!lps->bfa->fcs) {
1789 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_logout_comp_cb,
1794 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
1810 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
1820 if (!lps->bfa->fcs) {
1821 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_cvl_event_cb,
1828 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
1838 bfa_lps_get_max_vport(struct bfa_s *bfa)
1840 if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT)
1850 bfa_lps_alloc(struct bfa_s *bfa)
1852 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1921 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag)
1923 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1932 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid)
1934 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1952 bfa_lps_get_base_pid(struct bfa_s *bfa)
1954 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
1965 bfa_trc(lps->bfa, lps->bfa_tag);
1966 bfa_trc(lps->bfa, n2n_pid);
1976 bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1980 bfa_trc(bfa, m->mhdr.msg_id);
1985 bfa_lps_login_rsp(bfa, msg.login_rsp);
1989 bfa_lps_logout_rsp(bfa, msg.logout_rsp);
1993 bfa_lps_rx_cvl_event(bfa, msg.cvl_event);
1997 bfa_trc(bfa, m->mhdr.msg_id);
2005 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2012 aen_entry->aen_data.port.ioc_type = bfa_get_type(fcport->bfa);
2016 bfad_im_post_vendor_event(aen_entry, bfad, ++fcport->bfa->bfa_aen_seq,
2027 bfa_trc(fcport->bfa, event);
2037 bfa_trc(fcport->bfa, BFA_TRUE);
2040 bfa_trc(fcport->bfa, BFA_FALSE);
2067 bfa_sm_fault(fcport->bfa, event);
2076 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2077 bfa_trc(fcport->bfa, event);
2103 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2131 bfa_sm_fault(fcport->bfa, event);
2140 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2141 bfa_trc(fcport->bfa, event);
2170 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2193 bfa_sm_fault(fcport->bfa, event);
2203 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2205 bfa_trc(fcport->bfa, event);
2212 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2214 if (!bfa_ioc_get_fcmode(&fcport->bfa->ioc)) {
2216 bfa_trc(fcport->bfa,
2218 bfa_trc(fcport->bfa,
2222 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2226 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2262 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2285 bfa_sm_fault(fcport->bfa, event);
2294 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2296 bfa_trc(fcport->bfa, event);
2314 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2329 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2332 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2348 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2365 if (BFA_PORT_IS_DISABLED(fcport->bfa)) {
2384 bfa_sm_fault(fcport->bfa, event);
2392 bfa_trc(fcport->bfa, event);
2435 bfa_sm_fault(fcport->bfa, event);
2443 bfa_trc(fcport->bfa, event);
2482 bfa_sm_fault(fcport->bfa, event);
2491 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2492 bfa_trc(fcport->bfa, event);
2512 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2537 bfa_sm_fault(fcport->bfa, event);
2546 struct bfad_s *bfad = (struct bfad_s *)fcport->bfa->bfad;
2547 bfa_trc(fcport->bfa, event);
2567 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2594 bfa_sm_fault(fcport->bfa, event);
2602 bfa_trc(fcport->bfa, event);
2628 bfa_trc(fcport->bfa, event);
2654 bfa_trc(fcport->bfa, event);
2676 bfa_trc(fcport->bfa, event);
2701 bfa_sm_fault(fcport->bfa, event);
2709 bfa_trc(fcport->bfa, event);
2735 bfa_sm_fault(fcport->bfa, event);
2743 bfa_trc(fcport->bfa, event);
2762 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
2778 bfa_sm_fault(fcport->bfa, event);
2789 bfa_trc(ln->fcport->bfa, event);
2798 bfa_sm_fault(ln->fcport->bfa, event);
2809 bfa_trc(ln->fcport->bfa, event);
2821 bfa_sm_fault(ln->fcport->bfa, event);
2832 bfa_trc(ln->fcport->bfa, event);
2845 bfa_sm_fault(ln->fcport->bfa, event);
2856 bfa_trc(ln->fcport->bfa, event);
2865 bfa_sm_fault(ln->fcport->bfa, event);
2876 bfa_trc(ln->fcport->bfa, event);
2888 bfa_sm_fault(ln->fcport->bfa, event);
2899 bfa_trc(ln->fcport->bfa, event);
2912 bfa_sm_fault(ln->fcport->bfa, event);
2923 bfa_trc(ln->fcport->bfa, event);
2936 bfa_sm_fault(ln->fcport->bfa, event);
2979 if (fcport->bfa->fcs) {
2984 bfa_cb_queue(fcport->bfa, &ln->ln_qe,
2994 struct bfa_s *bfa)
2996 struct bfa_mem_dma_s *fcport_dma = BFA_MEM_FCPORT_DMA(bfa);
3024 bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
3027 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3031 fcport->bfa = bfa;
3067 bfa_fcport_start(struct bfa_s *bfa)
3069 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_START);
3076 bfa_fcport_iocdisable(struct bfa_s *bfa)
3078 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3081 bfa_trunk_iocdisable(bfa);
3133 bfa_trc(fcport->bfa, fcport->speed);
3134 bfa_trc(fcport->bfa, fcport->topology);
3162 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3164 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3170 bfa_fn_lpu(fcport->bfa));
3178 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_lo);
3179 bfa_trc(fcport->bfa, m->stats_dma_addr.a32.addr_hi);
3184 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh);
3205 m = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3207 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3213 bfa_fn_lpu(fcport->bfa));
3219 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, m->mh);
3227 fcport->pwwn = fcport->bfa->ioc.attr->pwwn;
3228 fcport->nwwn = fcport->bfa->ioc.attr->nwwn;
3230 bfa_trc(fcport->bfa, fcport->pwwn);
3231 bfa_trc(fcport->bfa, fcport->nwwn);
3284 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc))
3294 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe,
3309 bfa_trc(fcport->bfa, fcport->stats_qfull);
3326 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3332 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3340 bfa_fn_lpu(fcport->bfa));
3341 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh);
3359 bfa_cb_queue_status(fcport->bfa, &cb->hcb_qe,
3374 bfa_trc(fcport->bfa, fcport->stats_qfull);
3391 msg = bfa_reqq_next(fcport->bfa, BFA_REQQ_PORT);
3397 bfa_reqq_wait(fcport->bfa, BFA_REQQ_PORT,
3405 bfa_fn_lpu(fcport->bfa));
3406 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT, msg->mh);
3422 bfa_trc(fcport->bfa, fcport->cfg.trunked);
3426 bfa_trc(fcport->bfa, trunk->attr.state);
3427 bfa_trc(fcport->bfa, scn->trunk_state);
3428 bfa_trc(fcport->bfa, scn->trunk_speed);
3453 bfa_trc(fcport->bfa, lattr->link_state);
3454 bfa_trc(fcport->bfa, lattr->trunk_wwn);
3455 bfa_trc(fcport->bfa, lattr->fctl);
3456 bfa_trc(fcport->bfa, lattr->speed);
3457 bfa_trc(fcport->bfa, lattr->deskew);
3462 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3466 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3470 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3474 bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
3489 bfa_trunk_iocdisable(struct bfa_s *bfa)
3491 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3520 bfa_fcport_init(struct bfa_s *bfa)
3522 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3529 fcport->cfg.maxfrsize = bfa_ioc_maxfrsize(&bfa->ioc);
3530 fcport->cfg.rx_bbcredit = bfa_ioc_rx_bbcredit(&bfa->ioc);
3531 fcport->speed_sup = bfa_ioc_speed_sup(&bfa->ioc);
3533 if (bfa_fcport_is_pbcdisabled(bfa))
3534 bfa->modules.port.pbc_disabled = BFA_TRUE;
3545 bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
3547 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3553 bfa_trc(bfa, msg->mhdr.msg_id);
3554 bfa_trc(bfa, bfa_sm_to_state(hal_port_sm_table, fcport->sm));
3672 bfa_fcport_event_register(struct bfa_s *bfa,
3677 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3684 bfa_fcport_enable(struct bfa_s *bfa)
3686 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3688 if (bfa_fcport_is_pbcdisabled(bfa))
3691 if (bfa_ioc_is_disabled(&bfa->ioc))
3697 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_ENABLE);
3702 bfa_fcport_disable(struct bfa_s *bfa)
3704 if (bfa_fcport_is_pbcdisabled(bfa))
3707 if (bfa_ioc_is_disabled(&bfa->ioc))
3710 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DISABLE);
3716 bfa_fcport_is_pbcdisabled(struct bfa_s *bfa)
3718 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3719 struct bfa_iocfc_s *iocfc = &bfa->iocfc;
3723 bfa_trc(bfa, fcport->pwwn);
3733 bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
3735 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3737 bfa_trc(bfa, speed);
3745 bfa_trc(bfa, fcport->speed_sup);
3750 if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) {
3753 (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id)))
3778 bfa_fcport_get_speed(struct bfa_s *bfa)
3780 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3789 bfa_fcport_cfg_topology(struct bfa_s *bfa, enum bfa_port_topology topology)
3791 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3793 bfa_trc(bfa, topology);
3794 bfa_trc(bfa, fcport->cfg.topology);
3801 if ((bfa_fcport_is_qos_enabled(bfa) != BFA_FALSE) ||
3806 if ((bfa_fcport_is_trunk_enabled(bfa) != BFA_FALSE) ||
3809 if ((bfa_fcport_get_speed(bfa) == BFA_PORT_SPEED_16GBPS) ||
3812 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type))
3814 if (bfa_fcport_is_dport(bfa) != BFA_FALSE)
3816 if (bfa_fcport_is_ddport(bfa) != BFA_FALSE)
3835 bfa_fcport_get_topology(struct bfa_s *bfa)
3837 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3846 bfa_fcport_get_cfg_topology(struct bfa_s *bfa)
3848 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3854 bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa)
3856 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3858 bfa_trc(bfa, alpa);
3859 bfa_trc(bfa, fcport->cfg.cfg_hardalpa);
3860 bfa_trc(bfa, fcport->cfg.hardalpa);
3869 bfa_fcport_clr_hardalpa(struct bfa_s *bfa)
3871 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3873 bfa_trc(bfa, fcport->cfg.cfg_hardalpa);
3874 bfa_trc(bfa, fcport->cfg.hardalpa);
3881 bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa)
3883 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3890 bfa_fcport_get_myalpa(struct bfa_s *bfa)
3892 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3898 bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize)
3900 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3902 bfa_trc(bfa, maxfrsize);
3903 bfa_trc(bfa, fcport->cfg.maxfrsize);
3918 bfa_fcport_get_maxfrsize(struct bfa_s *bfa)
3920 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3926 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa)
3928 if (bfa_fcport_get_topology(bfa) != BFA_PORT_TOPOLOGY_LOOP)
3929 return (BFA_FCPORT_MOD(bfa))->cfg.rx_bbcredit;
3936 bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit)
3938 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3948 bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node)
3950 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3958 bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3960 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3967 attr->factorypwwn = bfa->ioc.attr->mfg_pwwn;
3968 attr->factorynwwn = bfa->ioc.attr->mfg_nwwn;
3987 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
3988 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
3994 if (bfa_fcport_is_pbcdisabled(bfa))
3997 if (bfa_ioc_is_disabled(&fcport->bfa->ioc))
3999 else if (bfa_ioc_fw_mismatch(&fcport->bfa->ioc))
4013 bfa_fcport_get_stats(struct bfa_s *bfa, struct bfa_cb_pending_q_s *cb)
4015 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4017 if (!bfa_iocfc_is_operational(bfa) ||
4027 bfa_timer_start(bfa, &fcport->timer,
4040 bfa_fcport_clear_stats(struct bfa_s *bfa, struct bfa_cb_pending_q_s *cb)
4042 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4044 if (!bfa_iocfc_is_operational(bfa) ||
4054 bfa_timer_start(bfa, &fcport->timer,
4067 bfa_fcport_is_disabled(struct bfa_s *bfa)
4069 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4077 bfa_fcport_is_dport(struct bfa_s *bfa)
4079 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4086 bfa_fcport_is_ddport(struct bfa_s *bfa)
4088 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4095 bfa_fcport_set_qos_bw(struct bfa_s *bfa, struct bfa_qos_bw_s *qos_bw)
4097 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4098 enum bfa_ioc_type_e ioc_type = bfa_get_type(bfa);
4100 bfa_trc(bfa, ioc_type);
4120 bfa_fcport_is_ratelim(struct bfa_s *bfa)
4122 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4132 bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state)
4134 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4136 bfa_trc(bfa, state);
4144 bfa_fcport_get_ratelim_speed(struct bfa_s *bfa)
4146 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4148 bfa_trc(bfa, fcport->cfg.trl_def_speed);
4157 struct bfa_s *bfa = dev;
4158 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4160 bfa_trc(bfa, beacon);
4161 bfa_trc(bfa, link_e2e_beacon);
4162 bfa_trc(bfa, fcport->beacon);
4163 bfa_trc(bfa, fcport->link_e2e_beacon);
4170 bfa_fcport_is_linkup(struct bfa_s *bfa)
4172 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4181 bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
4183 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4189 bfa_fcport_is_trunk_enabled(struct bfa_s *bfa)
4191 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4197 bfa_fcport_cfg_bbcr(struct bfa_s *bfa, bfa_boolean_t on_off, u8 bb_scn)
4199 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4201 bfa_trc(bfa, on_off);
4203 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4206 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type) &&
4207 (bfa->ioc.attr->card_type != BFA_MFG_TYPE_CHINOOK))
4221 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc)))
4224 if (bfa_ioc_speed_sup(&bfa->ioc) < BFA_PORT_SPEED_8GBPS)
4251 bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
4254 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4256 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4268 bfa_fcport_dportenable(struct bfa_s *bfa)
4273 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DPORTENABLE);
4274 bfa_port_set_dportenabled(&bfa->modules.port, BFA_TRUE);
4278 bfa_fcport_dportdisable(struct bfa_s *bfa)
4283 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DPORTDISABLE);
4284 bfa_port_set_dportenabled(&bfa->modules.port, BFA_FALSE);
4288 bfa_fcport_ddportenable(struct bfa_s *bfa)
4293 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTENABLE);
4297 bfa_fcport_ddportdisable(struct bfa_s *bfa)
4302 bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTDISABLE);
4314 bfa_trc(rp->bfa, rp->rport_tag);
4315 bfa_trc(rp->bfa, event);
4325 bfa_sm_fault(rp->bfa, event);
4332 bfa_trc(rp->bfa, rp->rport_tag);
4333 bfa_trc(rp->bfa, event);
4357 bfa_sm_fault(rp->bfa, event);
4367 bfa_trc(rp->bfa, rp->rport_tag);
4368 bfa_trc(rp->bfa, event);
4394 bfa_sm_fault(rp->bfa, event);
4404 bfa_trc(rp->bfa, rp->rport_tag);
4405 bfa_trc(rp->bfa, event);
4435 bfa_sm_fault(rp->bfa, event);
4447 bfa_trc(rp->bfa, rp->rport_tag);
4448 bfa_trc(rp->bfa, event);
4479 bfa_trc(rp->bfa, qos_scn->old_qos_attr.qos_flow_id);
4480 bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_flow_id);
4481 bfa_trc(rp->bfa, qos_scn->old_qos_attr.qos_priority);
4482 bfa_trc(rp->bfa, qos_scn->new_qos_attr.qos_priority);
4503 bfa_sm_fault(rp->bfa, event);
4513 bfa_trc(rp->bfa, rp->rport_tag);
4514 bfa_trc(rp->bfa, event);
4536 bfa_sm_fault(rp->bfa, event);
4543 bfa_trc(rp->bfa, rp->rport_tag);
4544 bfa_trc(rp->bfa, event);
4566 bfa_sm_fault(rp->bfa, event);
4576 bfa_trc(rp->bfa, rp->rport_tag);
4577 bfa_trc(rp->bfa, event);
4605 bfa_sm_fault(rp->bfa, event);
4615 bfa_trc(rp->bfa, rp->rport_tag);
4616 bfa_trc(rp->bfa, event);
4632 bfa_sm_fault(rp->bfa, event);
4639 bfa_trc(rp->bfa, rp->rport_tag);
4640 bfa_trc(rp->bfa, event);
4657 bfa_sm_fault(rp->bfa, event);
4668 bfa_trc(rp->bfa, rp->rport_tag);
4669 bfa_trc(rp->bfa, event);
4688 bfa_sm_fault(rp->bfa, event);
4699 bfa_trc(rp->bfa, rp->rport_tag);
4700 bfa_trc(rp->bfa, event);
4724 bfa_sm_fault(rp->bfa, event);
4734 bfa_trc(rp->bfa, rp->rport_tag);
4735 bfa_trc(rp->bfa, event);
4762 bfa_sm_fault(rp->bfa, event);
4800 struct bfa_s *bfa)
4802 struct bfa_mem_kva_s *rport_kva = BFA_MEM_RPORT_KVA(bfa);
4813 bfa_rport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
4816 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
4833 rp->bfa = bfa;
4853 bfa_rport_iocdisable(struct bfa_s *bfa)
4855 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
4883 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa);
4898 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4900 bfa_reqq_wait(rp->bfa, BFA_REQQ_RPORT, &rp->reqq_wait);
4905 bfa_fn_lpu(rp->bfa));
4909 m->lp_fwtag = bfa_lps_get_fwtag(rp->bfa, (u8)rp->rport_info.lp_tag);
4919 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4931 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4933 bfa_reqq_wait(rp->bfa, BFA_REQQ_RPORT, &rp->reqq_wait);
4938 bfa_fn_lpu(rp->bfa));
4944 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4956 m = bfa_reqq_next(rp->bfa, BFA_REQQ_RPORT);
4958 bfa_trc(rp->bfa, rp->rport_info.speed);
4963 bfa_fn_lpu(rp->bfa));
4970 bfa_reqq_produce(rp->bfa, BFA_REQQ_RPORT, m->mh);
4984 bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
4989 bfa_trc(bfa, m->mhdr.msg_id);
4995 rp = BFA_RPORT_FROM_TAG(bfa, msg.create_rsp->bfa_handle);
4998 bfa_rport_set_lunmask(bfa, rp);
5004 rp = BFA_RPORT_FROM_TAG(bfa, msg.delete_rsp->bfa_handle);
5006 bfa_rport_unset_lunmask(bfa, rp);
5011 rp = BFA_RPORT_FROM_TAG(bfa, msg.qos_scn_evt->bfa_handle);
5017 bfa_fcport_update_loop_info(BFA_FCPORT_MOD(bfa),
5019 bfa_cb_rport_scn_online(bfa);
5023 bfa_cb_rport_scn_offline(bfa);
5027 rp = BFA_RPORT_FROM_TAG(bfa, msg.lip_scn->bfa_handle);
5032 bfa_trc(bfa, m->mhdr.msg_id);
5038 bfa_rport_res_recfg(struct bfa_s *bfa, u16 num_rport_fw)
5040 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa);
5055 bfa_rport_create(struct bfa_s *bfa, void *rport_drv)
5059 rp = bfa_rport_alloc(BFA_RPORT_MOD(bfa));
5064 rp->bfa = bfa;
5084 bfa_trc(rport->bfa, rport->rport_tag);
5106 bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
5108 struct bfa_lps_mod_s *lps_mod = BFA_LPS_MOD(bfa);
5117 bfa_fcpim_lunmask_rp_update(bfa, lp_wwn, rp_wwn, rp->rport_tag, lp_tag);
5122 bfa_rport_unset_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
5124 struct bfa_lps_mod_s *lps_mod = BFA_LPS_MOD(bfa);
5132 bfa_fcpim_lunmask_rp_update(bfa, lp_wwn, rp_wwn,
5145 struct bfa_s *bfa)
5147 struct bfa_sgpg_mod_s *sgpg_mod = BFA_SGPG_MOD(bfa);
5148 struct bfa_mem_kva_s *sgpg_kva = BFA_MEM_SGPG_KVA(bfa);
5179 bfa_sgpg_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5182 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5198 bfa_trc(bfa, cfg->drvcfg.num_sgpgs);
5242 bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs)
5244 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5262 bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpg)
5264 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5284 bfa_sgpg_malloc(bfa, &wqe->sgpg_q, nsgpg);
5294 bfa_sgpg_wait(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe, int nsgpg)
5296 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5320 bfa_sgpg_wcancel(struct bfa_s *bfa, struct bfa_sgpg_wqe_s *wqe)
5322 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa);
5328 bfa_sgpg_mfree(bfa, &wqe->sgpg_q,
5353 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(uf->bfa);
5377 bfa_fn_lpu(ufm->bfa));
5403 uf->bfa = ufm->bfa;
5426 struct bfa_s *bfa)
5428 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5429 struct bfa_mem_kva_s *uf_kva = BFA_MEM_UF_KVA(bfa);
5453 bfa_uf_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5456 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5458 ufm->bfa = bfa;
5487 uf_post_msg = bfa_reqq_next(ufm->bfa, BFA_REQQ_FCXP);
5493 bfa_reqq_produce(ufm->bfa, BFA_REQQ_FCXP, uf_post_msg->mh);
5495 bfa_trc(ufm->bfa, uf->uf_tag);
5513 uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m)
5515 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5536 bfa_plog_fchdr(bfa->plog, BFA_PL_MID_HAL_UF, BFA_PL_EID_RX,
5540 bfa_plog_fchdr_and_pl(bfa->plog, BFA_PL_MID_HAL_UF,
5545 if (bfa->fcs)
5548 bfa_cb_queue(bfa, &uf->hcb_qe, __bfa_cb_uf_recv, uf);
5552 bfa_uf_iocdisable(struct bfa_s *bfa)
5554 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5569 bfa_uf_start(struct bfa_s *bfa)
5571 bfa_uf_post_all(BFA_UF_MOD(bfa));
5577 * @param[in] bfa BFA instance
5582 bfa_uf_recv_register(struct bfa_s *bfa, bfa_cb_uf_recv_t ufrecv, void *cbarg)
5584 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5600 bfa_uf_put(BFA_UF_MOD(uf->bfa), uf);
5601 bfa_uf_post_all(BFA_UF_MOD(uf->bfa));
5610 bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
5612 bfa_trc(bfa, msg->mhdr.msg_id);
5616 uf_recv(bfa, (struct bfi_uf_frm_rcvd_s *) msg);
5620 bfa_trc(bfa, msg->mhdr.msg_id);
5626 bfa_uf_res_recfg(struct bfa_s *bfa, u16 num_uf_fw)
5628 struct bfa_uf_mod_s *mod = BFA_UF_MOD(bfa);
5701 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fcdiag->bfa);
5710 bfa_fcdiag_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5713 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5716 fcdiag->bfa = bfa;
5717 fcdiag->trcmod = bfa->trcmod;
5719 dport->bfa = bfa;
5729 bfa_fcdiag_iocdisable(struct bfa_s *bfa)
5731 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5773 req = bfa_reqq_next(fcdiag->bfa, fcdiag->qtest.queue);
5779 bfa_fn_lpu(fcdiag->bfa));
5786 bfa_reqq_produce(fcdiag->bfa, fcdiag->qtest.queue, req->mh);
5873 lb_req = bfa_reqq_next(fcdiag->bfa, BFA_REQQ_DIAG);
5879 bfa_fn_lpu(fcdiag->bfa));
5887 bfa_reqq_produce(fcdiag->bfa, BFA_REQQ_DIAG, lb_req->mh);
5900 bfa_fcdiag_intr(struct bfa_s *bfa, struct bfi_msg_s *msg)
5902 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5929 * @param[in] *bfa - bfa data struct
5941 bfa_fcdiag_loopback(struct bfa_s *bfa, enum bfa_port_opmode opmode,
5949 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
5951 if (!bfa_iocfc_is_operational(bfa))
5955 if (bfa_fcport_is_pbcdisabled(bfa)) {
5960 if (bfa_fcport_is_disabled(bfa) == BFA_FALSE) {
5968 if (bfa_ioc_get_type(&bfa->ioc) == BFA_IOC_TYPE_FC) {
5978 bfa_fcport_get_attr(bfa, &attr);
5993 (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id))) {
5999 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type)) {
6000 if (bfa_ioc_get_type(&bfa->ioc) == BFA_IOC_TYPE_FC) {
6014 if (bfa_fcport_is_dport(bfa)) {
6043 * @param[in] *bfa - bfa data struct
6053 bfa_fcdiag_queuetest(struct bfa_s *bfa, u32 force, u32 queue,
6057 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6062 if (!force && !bfa_iocfc_is_operational(bfa))
6096 bfa_timer_start(bfa, &fcdiag->qtest.timer,
6107 * @param[in] *bfa - bfa data struct
6112 bfa_fcdiag_lb_is_running(struct bfa_s *bfa)
6114 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6145 bfa_trc(dport->bfa, event);
6149 bfa_fcport_dportenable(dport->bfa);
6166 bfa_fcport_ddportenable(dport->bfa);
6171 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6177 bfa_sm_fault(dport->bfa, event);
6185 bfa_trc(dport->bfa, event);
6200 bfa_sm_fault(dport->bfa, event);
6207 bfa_trc(dport->bfa, event);
6224 bfa_fcport_dportdisable(dport->bfa);
6234 bfa_sm_fault(dport->bfa, event);
6241 bfa_trc(dport->bfa, event);
6252 bfa_fcport_dportdisable(dport->bfa);
6283 bfa_fcport_ddportdisable(dport->bfa);
6294 bfa_fcport_ddportdisable(dport->bfa);
6301 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6302 bfa_sm_fault(dport->bfa, event);
6306 bfa_sm_fault(dport->bfa, event);
6314 bfa_trc(dport->bfa, event);
6333 bfa_sm_fault(dport->bfa, event);
6340 bfa_trc(dport->bfa, event);
6358 bfa_sm_fault(dport->bfa, event);
6366 bfa_trc(dport->bfa, event);
6381 bfa_sm_fault(dport->bfa, event);
6388 bfa_trc(dport->bfa, event);
6412 bfa_sm_fault(dport->bfa, event);
6420 bfa_trc(dport->bfa, event);
6428 bfa_fcport_enable(dport->bfa);
6432 bfa_trc(dport->bfa, dport->i2hmsg.scn.state);
6433 bfa_sm_fault(dport->bfa, event);
6444 bfa_sm_fault(dport->bfa, event);
6452 bfa_trc(dport->bfa, event);
6471 bfa_sm_fault(dport->bfa, event);
6483 m = bfa_reqq_next(dport->bfa, BFA_REQQ_DIAG);
6485 bfa_reqq_wait(dport->bfa, BFA_REQQ_PORT, &dport->reqq_wait);
6490 bfa_fn_lpu(dport->bfa));
6500 bfa_reqq_produce(dport->bfa, BFA_REQQ_DIAG, m->mh);
6523 bfa_trc(dport->bfa, msg->status);
6524 bfa_trc(dport->bfa, dport->rp_pwwn);
6525 bfa_trc(dport->bfa, dport->rp_nwwn);
6529 bfa_trc(dport->bfa, msg->status);
6556 bfa_trc(dport->bfa, msg->state);
6562 bfa_trc(dport->bfa, dport->result.end_time);
6565 bfa_trc(dport->bfa, dport->result.status);
6577 bfa_trc(dport->bfa, dport->result.roundtrip_latency);
6578 bfa_trc(dport->bfa, dport->result.est_cable_distance);
6579 bfa_trc(dport->bfa, dport->result.buffer_required);
6580 bfa_trc(dport->bfa, dport->result.frmsz);
6581 bfa_trc(dport->bfa, dport->result.speed);
6586 bfa_trc(dport->bfa, dport->result.subtest[i].status);
6612 bfa_trc(dport->bfa, subtesttype);
6613 bfa_trc(dport->bfa,
6625 bfa_sm_fault(dport->bfa, msg->state);
6634 * @param[in] *bfa - bfa data struct
6637 bfa_dport_enable(struct bfa_s *bfa, u32 lpcnt, u32 pat,
6640 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6646 if (bfa_mfg_is_mezz(dport->bfa->ioc.attr->card_type)) {
6647 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6654 if (!(bfa_asic_id_ct2(dport->bfa->ioc.pcidev.device_id))) {
6655 bfa_trc(dport->bfa, dport->bfa->ioc.pcidev.device_id);
6662 if (!bfa_iocfc_is_operational(bfa))
6666 if (bfa_fcport_is_pbcdisabled(bfa)) {
6667 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6674 if (bfa_ioc_get_type(&bfa->ioc) != BFA_IOC_TYPE_FC) {
6675 bfa_trc(dport->bfa, bfa_ioc_get_type(&bfa->ioc));
6682 if ((bfa_fcport_get_cfg_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP) ||
6683 (bfa_fcport_get_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP)) {
6684 bfa_trc(dport->bfa, 0);
6691 if (bfa_fcport_is_trunk_enabled(bfa)) {
6692 bfa_trc(dport->bfa, 0);
6699 if (bfa_fcdiag_lb_is_running(bfa)) {
6700 bfa_trc(dport->bfa, 0);
6707 if ((bfa_fcport_is_disabled(bfa) == BFA_FALSE) &&
6708 (bfa_fcport_is_dport(bfa) == BFA_FALSE)) {
6709 bfa_trc(dport->bfa, 0);
6729 bfa_trc(dport->bfa, 0);
6733 bfa_trc(dport->bfa, lpcnt);
6734 bfa_trc(dport->bfa, pat);
6747 * @param[in] *bfa - bfa data struct
6750 bfa_dport_disable(struct bfa_s *bfa, bfa_cb_diag_t cbfn, void *cbarg)
6752 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6755 if (bfa_ioc_is_disabled(&bfa->ioc))
6759 if (bfa_fcport_is_pbcdisabled(bfa)) {
6760 bfa_trc(dport->bfa, BFA_STATUS_PBC);
6774 if ((bfa_fcport_is_disabled(bfa) == BFA_FALSE) &&
6775 (bfa_fcport_is_dport(bfa) == BFA_FALSE)) {
6776 bfa_trc(dport->bfa, 0);
6790 bfa_trc(dport->bfa, 0);
6804 * @param[in] *bfa - bfa data struct
6807 bfa_dport_start(struct bfa_s *bfa, u32 lpcnt, u32 pat,
6810 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6816 if (!bfa_iocfc_is_operational(bfa))
6836 bfa_trc(dport->bfa, 0);
6849 bfa_trc(dport->bfa, lpcnt);
6850 bfa_trc(dport->bfa, pat);
6865 * @param[in] *bfa - bfa data struct
6868 bfa_dport_show(struct bfa_s *bfa, struct bfa_diag_dport_result_s *result)
6870 struct bfa_fcdiag_s *fcdiag = BFA_FCDIAG_MOD(bfa);
6876 if (!bfa_iocfc_is_operational(bfa))
6889 bfa_trc(dport->bfa, 0);