• Home
  • Raw
  • Download

Lines Matching refs:fcxp

26 BFA_MODULE(fcxp);
112 static void hal_fcxp_rx_plog(struct bfa_s *bfa, struct bfa_fcxp_s *fcxp,
115 struct bfa_fcxp_s *fcxp, struct fchs_s *fchs);
117 static void bfa_fcxp_queue(struct bfa_fcxp_s *fcxp,
452 struct bfa_fcxp_s *fcxp; in claim_fcxps_mem() local
454 fcxp = (struct bfa_fcxp_s *) bfa_mem_kva_curp(mod); in claim_fcxps_mem()
455 memset(fcxp, 0, sizeof(struct bfa_fcxp_s) * mod->num_fcxps); in claim_fcxps_mem()
463 mod->fcxp_list = fcxp; in claim_fcxps_mem()
466 fcxp->fcxp_mod = mod; in claim_fcxps_mem()
467 fcxp->fcxp_tag = i; in claim_fcxps_mem()
470 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); in claim_fcxps_mem()
471 fcxp->req_rsp = BFA_TRUE; in claim_fcxps_mem()
473 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); in claim_fcxps_mem()
474 fcxp->req_rsp = BFA_FALSE; in claim_fcxps_mem()
477 bfa_reqq_winit(&fcxp->reqq_wqe, bfa_fcxp_qresume, fcxp); in claim_fcxps_mem()
478 fcxp->reqq_waiting = BFA_FALSE; in claim_fcxps_mem()
480 fcxp = fcxp + 1; in claim_fcxps_mem()
483 bfa_mem_kva_curp(mod) = (void *)fcxp; in claim_fcxps_mem()
565 struct bfa_fcxp_s *fcxp; in bfa_fcxp_iocdisable() local
573 fcxp = (struct bfa_fcxp_s *) qe; in bfa_fcxp_iocdisable()
574 if (fcxp->caller == NULL) { in bfa_fcxp_iocdisable()
575 fcxp->send_cbfn(fcxp->caller, fcxp, fcxp->send_cbarg, in bfa_fcxp_iocdisable()
577 bfa_fcxp_free(fcxp); in bfa_fcxp_iocdisable()
579 fcxp->rsp_status = BFA_STATUS_IOC_FAILURE; in bfa_fcxp_iocdisable()
580 bfa_cb_queue(bfa, &fcxp->hcb_qe, in bfa_fcxp_iocdisable()
581 __bfa_fcxp_send_cbfn, fcxp); in bfa_fcxp_iocdisable()
589 struct bfa_fcxp_s *fcxp; in bfa_fcxp_get() local
592 bfa_q_deq(&fm->fcxp_req_free_q, &fcxp); in bfa_fcxp_get()
594 bfa_q_deq(&fm->fcxp_rsp_free_q, &fcxp); in bfa_fcxp_get()
596 if (fcxp) in bfa_fcxp_get()
597 list_add_tail(&fcxp->qe, &fm->fcxp_active_q); in bfa_fcxp_get()
599 return fcxp; in bfa_fcxp_get()
603 bfa_fcxp_init_reqrsp(struct bfa_fcxp_s *fcxp, in bfa_fcxp_init_reqrsp() argument
617 bfa_trc(bfa, fcxp->fcxp_tag); in bfa_fcxp_init_reqrsp()
641 bfa_fcxp_init(struct bfa_fcxp_s *fcxp, in bfa_fcxp_init() argument
651 bfa_trc(bfa, fcxp->fcxp_tag); in bfa_fcxp_init()
653 fcxp->caller = caller; in bfa_fcxp_init()
655 bfa_fcxp_init_reqrsp(fcxp, bfa, in bfa_fcxp_init()
656 &fcxp->use_ireqbuf, &fcxp->nreq_sgles, &fcxp->req_sga_cbfn, in bfa_fcxp_init()
657 &fcxp->req_sglen_cbfn, &fcxp->req_sgpg_q, in bfa_fcxp_init()
660 bfa_fcxp_init_reqrsp(fcxp, bfa, in bfa_fcxp_init()
661 &fcxp->use_irspbuf, &fcxp->nrsp_sgles, &fcxp->rsp_sga_cbfn, in bfa_fcxp_init()
662 &fcxp->rsp_sglen_cbfn, &fcxp->rsp_sgpg_q, in bfa_fcxp_init()
668 bfa_fcxp_put(struct bfa_fcxp_s *fcxp) in bfa_fcxp_put() argument
670 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_put()
673 if (fcxp->req_rsp) in bfa_fcxp_put()
679 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_put()
681 bfa_fcxp_init(fcxp, wqe->caller, wqe->bfa, wqe->nreq_sgles, in bfa_fcxp_put()
686 wqe->alloc_cbfn(wqe->alloc_cbarg, fcxp); in bfa_fcxp_put()
690 WARN_ON(!bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); in bfa_fcxp_put()
691 list_del(&fcxp->qe); in bfa_fcxp_put()
693 if (fcxp->req_rsp) in bfa_fcxp_put()
694 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); in bfa_fcxp_put()
696 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); in bfa_fcxp_put()
700 bfa_fcxp_null_comp(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg, in bfa_fcxp_null_comp() argument
710 struct bfa_fcxp_s *fcxp = cbarg; in __bfa_fcxp_send_cbfn() local
713 fcxp->send_cbfn(fcxp->caller, fcxp, fcxp->send_cbarg, in __bfa_fcxp_send_cbfn()
714 fcxp->rsp_status, fcxp->rsp_len, in __bfa_fcxp_send_cbfn()
715 fcxp->residue_len, &fcxp->rsp_fchs); in __bfa_fcxp_send_cbfn()
717 bfa_fcxp_free(fcxp); in __bfa_fcxp_send_cbfn()
725 struct bfa_fcxp_s *fcxp; in hal_fcxp_send_comp() local
741 fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); in hal_fcxp_send_comp()
743 WARN_ON(fcxp->send_cbfn == NULL); in hal_fcxp_send_comp()
745 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); in hal_fcxp_send_comp()
747 if (fcxp->send_cbfn != NULL) { in hal_fcxp_send_comp()
748 bfa_trc(mod->bfa, (NULL == fcxp->caller)); in hal_fcxp_send_comp()
749 if (fcxp->caller == NULL) { in hal_fcxp_send_comp()
750 fcxp->send_cbfn(fcxp->caller, fcxp, fcxp->send_cbarg, in hal_fcxp_send_comp()
756 bfa_fcxp_free(fcxp); in hal_fcxp_send_comp()
758 fcxp->rsp_status = fcxp_rsp->req_status; in hal_fcxp_send_comp()
759 fcxp->rsp_len = fcxp_rsp->rsp_len; in hal_fcxp_send_comp()
760 fcxp->residue_len = fcxp_rsp->residue_len; in hal_fcxp_send_comp()
761 fcxp->rsp_fchs = fcxp_rsp->fchs; in hal_fcxp_send_comp()
763 bfa_cb_queue(bfa, &fcxp->hcb_qe, in hal_fcxp_send_comp()
764 __bfa_fcxp_send_cbfn, fcxp); in hal_fcxp_send_comp()
767 bfa_trc(bfa, (NULL == fcxp->send_cbfn)); in hal_fcxp_send_comp()
772 hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen, struct bfa_fcxp_s *fcxp, in hal_fcxp_tx_plog() argument
779 if (fcxp->use_ireqbuf) { in hal_fcxp_tx_plog()
781 *((u32 *) BFA_FCXP_REQ_PLD(fcxp)); in hal_fcxp_tx_plog()
800 hal_fcxp_rx_plog(struct bfa_s *bfa, struct bfa_fcxp_s *fcxp, in hal_fcxp_rx_plog() argument
804 if (fcxp->use_irspbuf) { in hal_fcxp_rx_plog()
806 *((u32 *) BFA_FCXP_RSP_PLD(fcxp)); in hal_fcxp_rx_plog()
830 struct bfa_fcxp_s *fcxp = cbarg; in bfa_fcxp_qresume() local
831 struct bfa_s *bfa = fcxp->fcxp_mod->bfa; in bfa_fcxp_qresume()
834 fcxp->reqq_waiting = BFA_FALSE; in bfa_fcxp_qresume()
836 bfa_fcxp_queue(fcxp, send_req); in bfa_fcxp_qresume()
843 bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req) in bfa_fcxp_queue() argument
845 struct bfa_s *bfa = fcxp->fcxp_mod->bfa; in bfa_fcxp_queue()
846 struct bfa_fcxp_req_info_s *reqi = &fcxp->req_info; in bfa_fcxp_queue()
847 struct bfa_fcxp_rsp_info_s *rspi = &fcxp->rsp_info; in bfa_fcxp_queue()
853 send_req->fcxp_tag = cpu_to_be16(fcxp->fcxp_tag); in bfa_fcxp_queue()
877 if (fcxp->use_ireqbuf == 1) { in bfa_fcxp_queue()
879 BFA_FCXP_REQ_PLD_PA(fcxp)); in bfa_fcxp_queue()
881 if (fcxp->nreq_sgles > 0) { in bfa_fcxp_queue()
882 WARN_ON(fcxp->nreq_sgles != 1); in bfa_fcxp_queue()
884 fcxp->req_sga_cbfn(fcxp->caller, 0)); in bfa_fcxp_queue()
894 if (fcxp->use_irspbuf == 1) { in bfa_fcxp_queue()
898 BFA_FCXP_RSP_PLD_PA(fcxp)); in bfa_fcxp_queue()
900 if (fcxp->nrsp_sgles > 0) { in bfa_fcxp_queue()
901 WARN_ON(fcxp->nrsp_sgles != 1); in bfa_fcxp_queue()
903 fcxp->rsp_sga_cbfn(fcxp->caller, 0)); in bfa_fcxp_queue()
911 hal_fcxp_tx_plog(bfa, reqi->req_tot_len, fcxp, &reqi->fchs); in bfa_fcxp_queue()
951 struct bfa_fcxp_s *fcxp = NULL; in bfa_fcxp_req_rsp_alloc() local
955 fcxp = bfa_fcxp_get(BFA_FCXP_MOD(bfa), req); in bfa_fcxp_req_rsp_alloc()
956 if (fcxp == NULL) in bfa_fcxp_req_rsp_alloc()
959 bfa_trc(bfa, fcxp->fcxp_tag); in bfa_fcxp_req_rsp_alloc()
961 bfa_fcxp_init(fcxp, caller, bfa, nreq_sgles, nrsp_sgles, req_sga_cbfn, in bfa_fcxp_req_rsp_alloc()
964 return fcxp; in bfa_fcxp_req_rsp_alloc()
975 bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp) in bfa_fcxp_get_reqbuf() argument
977 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_reqbuf()
980 WARN_ON(fcxp->use_ireqbuf != 1); in bfa_fcxp_get_reqbuf()
981 reqbuf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_reqbuf()
987 bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp) in bfa_fcxp_get_reqbufsz() argument
989 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_reqbufsz()
1002 bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp) in bfa_fcxp_get_rspbuf() argument
1004 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_rspbuf()
1007 WARN_ON(fcxp->use_irspbuf != 1); in bfa_fcxp_get_rspbuf()
1009 fcxp_buf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_rspbuf()
1024 bfa_fcxp_free(struct bfa_fcxp_s *fcxp) in bfa_fcxp_free() argument
1026 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_free()
1028 WARN_ON(fcxp == NULL); in bfa_fcxp_free()
1029 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_free()
1030 bfa_fcxp_put(fcxp); in bfa_fcxp_free()
1055 bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport, in bfa_fcxp_send() argument
1060 struct bfa_s *bfa = fcxp->fcxp_mod->bfa; in bfa_fcxp_send()
1061 struct bfa_fcxp_req_info_s *reqi = &fcxp->req_info; in bfa_fcxp_send()
1062 struct bfa_fcxp_rsp_info_s *rspi = &fcxp->rsp_info; in bfa_fcxp_send()
1065 bfa_trc(bfa, fcxp->fcxp_tag); in bfa_fcxp_send()
1079 fcxp->send_cbfn = cbfn ? cbfn : bfa_fcxp_null_comp; in bfa_fcxp_send()
1080 fcxp->send_cbarg = cbarg; in bfa_fcxp_send()
1087 bfa_trc(bfa, fcxp->fcxp_tag); in bfa_fcxp_send()
1088 fcxp->reqq_waiting = BFA_TRUE; in bfa_fcxp_send()
1089 bfa_reqq_wait(bfa, BFA_REQQ_FCXP, &fcxp->reqq_wqe); in bfa_fcxp_send()
1093 bfa_fcxp_queue(fcxp, send_req); in bfa_fcxp_send()
1104 bfa_fcxp_abort(struct bfa_fcxp_s *fcxp) in bfa_fcxp_abort() argument
1106 bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_abort()
1155 bfa_fcxp_discard(struct bfa_fcxp_s *fcxp) in bfa_fcxp_discard() argument
1161 if (fcxp->reqq_waiting) { in bfa_fcxp_discard()
1162 fcxp->reqq_waiting = BFA_FALSE; in bfa_fcxp_discard()
1163 bfa_reqq_wcancel(&fcxp->reqq_wqe); in bfa_fcxp_discard()
1164 bfa_fcxp_free(fcxp); in bfa_fcxp_discard()
1168 fcxp->send_cbfn = bfa_fcxp_null_comp; in bfa_fcxp_discard()