Lines Matching refs:mod

394 claim_fcxps_mem(struct bfa_fcxp_mod_s *mod)  in claim_fcxps_mem()  argument
399 fcxp = (struct bfa_fcxp_s *) bfa_mem_kva_curp(mod); in claim_fcxps_mem()
400 memset(fcxp, 0, sizeof(struct bfa_fcxp_s) * mod->num_fcxps); in claim_fcxps_mem()
402 INIT_LIST_HEAD(&mod->fcxp_req_free_q); in claim_fcxps_mem()
403 INIT_LIST_HEAD(&mod->fcxp_rsp_free_q); in claim_fcxps_mem()
404 INIT_LIST_HEAD(&mod->fcxp_active_q); in claim_fcxps_mem()
405 INIT_LIST_HEAD(&mod->fcxp_req_unused_q); in claim_fcxps_mem()
406 INIT_LIST_HEAD(&mod->fcxp_rsp_unused_q); in claim_fcxps_mem()
408 mod->fcxp_list = fcxp; in claim_fcxps_mem()
410 for (i = 0; i < mod->num_fcxps; i++) { in claim_fcxps_mem()
411 fcxp->fcxp_mod = mod; in claim_fcxps_mem()
414 if (i < (mod->num_fcxps / 2)) { in claim_fcxps_mem()
415 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); in claim_fcxps_mem()
418 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); in claim_fcxps_mem()
428 bfa_mem_kva_curp(mod) = (void *)fcxp; in claim_fcxps_mem()
473 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_attach() local
475 mod->bfa = bfa; in bfa_fcxp_attach()
476 mod->num_fcxps = cfg->fwcfg.num_fcxp_reqs; in bfa_fcxp_attach()
481 mod->req_pld_sz = mod->rsp_pld_sz = BFA_FCXP_MAX_IBUF_SZ; in bfa_fcxp_attach()
483 mod->rsp_pld_sz = BFA_FCXP_MAX_LBUF_SZ; in bfa_fcxp_attach()
485 INIT_LIST_HEAD(&mod->req_wait_q); in bfa_fcxp_attach()
486 INIT_LIST_HEAD(&mod->rsp_wait_q); in bfa_fcxp_attach()
488 claim_fcxps_mem(mod); in bfa_fcxp_attach()
494 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_iocdisable() local
499 list_splice_tail_init(&mod->fcxp_req_unused_q, &mod->fcxp_req_free_q); in bfa_fcxp_iocdisable()
500 list_splice_tail_init(&mod->fcxp_rsp_unused_q, &mod->fcxp_rsp_free_q); in bfa_fcxp_iocdisable()
502 list_for_each_safe(qe, qen, &mod->fcxp_active_q) { in bfa_fcxp_iocdisable()
600 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_put() local
604 bfa_q_deq(&mod->req_wait_q, &wqe); in bfa_fcxp_put()
606 bfa_q_deq(&mod->rsp_wait_q, &wqe); in bfa_fcxp_put()
609 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_put()
620 WARN_ON(!bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); in bfa_fcxp_put()
624 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); in bfa_fcxp_put()
626 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); in bfa_fcxp_put()
654 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in hal_fcxp_send_comp() local
671 fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); in hal_fcxp_send_comp()
675 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); in hal_fcxp_send_comp()
678 bfa_trc(mod->bfa, (NULL == fcxp->caller)); in hal_fcxp_send_comp()
907 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_reqbuf() local
911 reqbuf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_reqbuf()
912 mod->req_pld_sz + mod->rsp_pld_sz); in bfa_fcxp_get_reqbuf()
926 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_rspbuf() local
931 fcxp_buf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_rspbuf()
932 mod->req_pld_sz + mod->rsp_pld_sz); in bfa_fcxp_get_rspbuf()
935 return ((u8 *) fcxp_buf) + mod->req_pld_sz; in bfa_fcxp_get_rspbuf()
948 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_free() local
951 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_free()
1027 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_req_rsp_alloc_wait() local
1030 WARN_ON(!list_empty(&mod->fcxp_req_free_q)); in bfa_fcxp_req_rsp_alloc_wait()
1032 WARN_ON(!list_empty(&mod->fcxp_rsp_free_q)); in bfa_fcxp_req_rsp_alloc_wait()
1046 list_add_tail(&wqe->qe, &mod->req_wait_q); in bfa_fcxp_req_rsp_alloc_wait()
1048 list_add_tail(&wqe->qe, &mod->rsp_wait_q); in bfa_fcxp_req_rsp_alloc_wait()
1054 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_walloc_cancel() local
1056 WARN_ON(!bfa_q_is_on_q(&mod->req_wait_q, wqe) || in bfa_fcxp_walloc_cancel()
1057 !bfa_q_is_on_q(&mod->rsp_wait_q, wqe)); in bfa_fcxp_walloc_cancel()
1095 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_get_maxrsp() local
1097 return mod->rsp_pld_sz; in bfa_fcxp_get_maxrsp()
1103 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_res_recfg() local
1107 for (i = 0; i < (mod->num_fcxps - num_fcxp_fw); i++) { in bfa_fcxp_res_recfg()
1108 if (i < ((mod->num_fcxps - num_fcxp_fw) / 2)) { in bfa_fcxp_res_recfg()
1109 bfa_q_deq_tail(&mod->fcxp_req_free_q, &qe); in bfa_fcxp_res_recfg()
1110 list_add_tail(qe, &mod->fcxp_req_unused_q); in bfa_fcxp_res_recfg()
1112 bfa_q_deq_tail(&mod->fcxp_rsp_free_q, &qe); in bfa_fcxp_res_recfg()
1113 list_add_tail(qe, &mod->fcxp_rsp_unused_q); in bfa_fcxp_res_recfg()
1440 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_attach() local
1444 mod->num_lps = BFA_LPS_MAX_LPORTS; in bfa_lps_attach()
1446 mod->num_lps = BFA_LPS_MIN_LPORTS; in bfa_lps_attach()
1448 mod->num_lps = BFA_LPS_MAX_LPORTS; in bfa_lps_attach()
1449 mod->lps_arr = lps = (struct bfa_lps_s *) bfa_mem_kva_curp(mod); in bfa_lps_attach()
1451 bfa_mem_kva_curp(mod) += mod->num_lps * sizeof(struct bfa_lps_s); in bfa_lps_attach()
1453 INIT_LIST_HEAD(&mod->lps_free_q); in bfa_lps_attach()
1454 INIT_LIST_HEAD(&mod->lps_active_q); in bfa_lps_attach()
1455 INIT_LIST_HEAD(&mod->lps_login_q); in bfa_lps_attach()
1457 for (i = 0; i < mod->num_lps; i++, lps++) { in bfa_lps_attach()
1462 list_add_tail(&lps->qe, &mod->lps_free_q); in bfa_lps_attach()
1472 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_iocdisable() local
1476 list_for_each_safe(qe, qen, &mod->lps_active_q) { in bfa_lps_iocdisable()
1480 list_for_each_safe(qe, qen, &mod->lps_login_q) { in bfa_lps_iocdisable()
1484 list_splice_tail_init(&mod->lps_login_q, &mod->lps_active_q); in bfa_lps_iocdisable()
1493 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_login_rsp() local
1496 WARN_ON(rsp->bfa_tag >= mod->num_lps); in bfa_lps_login_rsp()
1497 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); in bfa_lps_login_rsp()
1539 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_login_rsp()
1547 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_no_res() local
1561 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_no_res()
1574 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_logout_rsp() local
1577 WARN_ON(rsp->bfa_tag >= mod->num_lps); in bfa_lps_logout_rsp()
1578 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); in bfa_lps_logout_rsp()
1589 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_rx_cvl_event() local
1592 lps = BFA_LPS_FROM_TAG(mod, cvl->bfa_tag); in bfa_lps_rx_cvl_event()
1614 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); in bfa_lps_free() local
1618 list_add_tail(&lps->qe, &mod->lps_free_q); in bfa_lps_free()
1627 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); in bfa_lps_send_login() local
1646 list_add_tail(&lps->qe, &mod->lps_login_q); in bfa_lps_send_login()
1809 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_alloc() local
1812 bfa_q_deq(&mod->lps_free_q, &lps); in bfa_lps_alloc()
1817 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_alloc()
1880 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_fwtag() local
1882 return BFA_LPS_FROM_TAG(mod, lp_tag)->fw_tag; in bfa_lps_get_fwtag()
1891 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_tag_from_pid() local
1895 for (i = 0, lps = mod->lps_arr; i < mod->num_lps; i++, lps++) { in bfa_lps_get_tag_from_pid()
1911 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_base_pid() local
1913 return BFA_LPS_FROM_TAG(mod, 0)->lp_pid; in bfa_lps_get_base_pid()
4741 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_attach() local
4745 INIT_LIST_HEAD(&mod->rp_free_q); in bfa_rport_attach()
4746 INIT_LIST_HEAD(&mod->rp_active_q); in bfa_rport_attach()
4747 INIT_LIST_HEAD(&mod->rp_unused_q); in bfa_rport_attach()
4749 rp = (struct bfa_rport_s *) bfa_mem_kva_curp(mod); in bfa_rport_attach()
4750 mod->rps_list = rp; in bfa_rport_attach()
4751 mod->num_rports = cfg->fwcfg.num_rports; in bfa_rport_attach()
4753 WARN_ON(!mod->num_rports || in bfa_rport_attach()
4754 (mod->num_rports & (mod->num_rports - 1))); in bfa_rport_attach()
4756 for (i = 0; i < mod->num_rports; i++, rp++) { in bfa_rport_attach()
4766 list_add_tail(&rp->qe, &mod->rp_free_q); in bfa_rport_attach()
4774 bfa_mem_kva_curp(mod) = (u8 *) rp; in bfa_rport_attach()
4780 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_iocdisable() local
4785 list_splice_tail_init(&mod->rp_unused_q, &mod->rp_free_q); in bfa_rport_iocdisable()
4787 list_for_each_safe(qe, qen, &mod->rp_active_q) { in bfa_rport_iocdisable()
4794 bfa_rport_alloc(struct bfa_rport_mod_s *mod) in bfa_rport_alloc() argument
4798 bfa_q_deq(&mod->rp_free_q, &rport); in bfa_rport_alloc()
4800 list_add_tail(&rport->qe, &mod->rp_active_q); in bfa_rport_alloc()
4808 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa); in bfa_rport_free() local
4810 WARN_ON(!bfa_q_is_on_q(&mod->rp_active_q, rport)); in bfa_rport_free()
4812 list_add_tail(&rport->qe, &mod->rp_free_q); in bfa_rport_free()
4965 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_res_recfg() local
4969 for (i = 0; i < (mod->num_rports - num_rport_fw); i++) { in bfa_rport_res_recfg()
4970 bfa_q_deq_tail(&mod->rp_free_q, &qe); in bfa_rport_res_recfg()
4971 list_add_tail(qe, &mod->rp_unused_q); in bfa_rport_res_recfg()
5107 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_attach() local
5120 INIT_LIST_HEAD(&mod->sgpg_q); in bfa_sgpg_attach()
5121 INIT_LIST_HEAD(&mod->sgpg_wait_q); in bfa_sgpg_attach()
5125 mod->free_sgpgs = mod->num_sgpgs = cfg->drvcfg.num_sgpgs; in bfa_sgpg_attach()
5131 hsgpg = (struct bfa_sgpg_s *) bfa_mem_kva_curp(mod); in bfa_sgpg_attach()
5133 bfa_mem_dma_seg_iter(mod, seg_ptr, nsegs, idx) { in bfa_sgpg_attach()
5155 list_add_tail(&hsgpg->qe, &mod->sgpg_q); in bfa_sgpg_attach()
5163 bfa_mem_kva_curp(mod) = (u8 *) hsgpg; in bfa_sgpg_attach()
5169 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_malloc() local
5173 if (mod->free_sgpgs < nsgpgs) in bfa_sgpg_malloc()
5177 bfa_q_deq(&mod->sgpg_q, &hsgpg); in bfa_sgpg_malloc()
5182 mod->free_sgpgs -= nsgpgs; in bfa_sgpg_malloc()
5189 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_mfree() local
5192 mod->free_sgpgs += nsgpg; in bfa_sgpg_mfree()
5193 WARN_ON(mod->free_sgpgs > mod->num_sgpgs); in bfa_sgpg_mfree()
5195 list_splice_tail_init(sgpg_q, &mod->sgpg_q); in bfa_sgpg_mfree()
5197 if (list_empty(&mod->sgpg_wait_q)) in bfa_sgpg_mfree()
5204 wqe = bfa_q_first(&mod->sgpg_wait_q); in bfa_sgpg_mfree()
5205 if (mod->free_sgpgs < wqe->nsgpg) in bfa_sgpg_mfree()
5206 nsgpg = mod->free_sgpgs; in bfa_sgpg_mfree()
5215 } while (mod->free_sgpgs && !list_empty(&mod->sgpg_wait_q)); in bfa_sgpg_mfree()
5221 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_wait() local
5224 WARN_ON(nsgpg <= mod->free_sgpgs); in bfa_sgpg_wait()
5231 if (mod->free_sgpgs) { in bfa_sgpg_wait()
5235 WARN_ON(!list_empty(&mod->sgpg_wait_q)); in bfa_sgpg_wait()
5236 list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q); in bfa_sgpg_wait()
5237 wqe->nsgpg -= mod->free_sgpgs; in bfa_sgpg_wait()
5238 mod->free_sgpgs = 0; in bfa_sgpg_wait()
5241 list_add_tail(&wqe->qe, &mod->sgpg_wait_q); in bfa_sgpg_wait()
5247 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_wcancel() local
5249 WARN_ON(!bfa_q_is_on_q(&mod->sgpg_wait_q, wqe)); in bfa_sgpg_wcancel()
5536 struct bfa_uf_mod_s *mod = BFA_UF_MOD(bfa); in bfa_uf_res_recfg() local
5540 for (i = 0; i < (mod->num_ufs - num_uf_fw); i++) { in bfa_uf_res_recfg()
5541 bfa_q_deq_tail(&mod->uf_free_q, &qe); in bfa_uf_res_recfg()
5542 list_add_tail(qe, &mod->uf_unused_q); in bfa_uf_res_recfg()