Lines Matching refs:mod

449 claim_fcxps_mem(struct bfa_fcxp_mod_s *mod)  in claim_fcxps_mem()  argument
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()
457 INIT_LIST_HEAD(&mod->fcxp_req_free_q); in claim_fcxps_mem()
458 INIT_LIST_HEAD(&mod->fcxp_rsp_free_q); in claim_fcxps_mem()
459 INIT_LIST_HEAD(&mod->fcxp_active_q); in claim_fcxps_mem()
460 INIT_LIST_HEAD(&mod->fcxp_req_unused_q); in claim_fcxps_mem()
461 INIT_LIST_HEAD(&mod->fcxp_rsp_unused_q); in claim_fcxps_mem()
463 mod->fcxp_list = fcxp; in claim_fcxps_mem()
465 for (i = 0; i < mod->num_fcxps; i++) { in claim_fcxps_mem()
466 fcxp->fcxp_mod = mod; in claim_fcxps_mem()
469 if (i < (mod->num_fcxps / 2)) { in claim_fcxps_mem()
470 list_add_tail(&fcxp->qe, &mod->fcxp_req_free_q); in claim_fcxps_mem()
473 list_add_tail(&fcxp->qe, &mod->fcxp_rsp_free_q); in claim_fcxps_mem()
483 bfa_mem_kva_curp(mod) = (void *)fcxp; in claim_fcxps_mem()
528 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_attach() local
530 mod->bfa = bfa; in bfa_fcxp_attach()
531 mod->num_fcxps = cfg->fwcfg.num_fcxp_reqs; in bfa_fcxp_attach()
536 mod->req_pld_sz = mod->rsp_pld_sz = BFA_FCXP_MAX_IBUF_SZ; in bfa_fcxp_attach()
538 mod->rsp_pld_sz = BFA_FCXP_MAX_LBUF_SZ; in bfa_fcxp_attach()
540 INIT_LIST_HEAD(&mod->req_wait_q); in bfa_fcxp_attach()
541 INIT_LIST_HEAD(&mod->rsp_wait_q); in bfa_fcxp_attach()
543 claim_fcxps_mem(mod); in bfa_fcxp_attach()
564 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_iocdisable() local
569 list_splice_tail_init(&mod->fcxp_req_unused_q, &mod->fcxp_req_free_q); in bfa_fcxp_iocdisable()
570 list_splice_tail_init(&mod->fcxp_rsp_unused_q, &mod->fcxp_rsp_free_q); in bfa_fcxp_iocdisable()
572 list_for_each_safe(qe, qen, &mod->fcxp_active_q) { in bfa_fcxp_iocdisable()
670 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_put() local
674 bfa_q_deq(&mod->req_wait_q, &wqe); in bfa_fcxp_put()
676 bfa_q_deq(&mod->rsp_wait_q, &wqe); in bfa_fcxp_put()
679 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_put()
690 WARN_ON(!bfa_q_is_on_q(&mod->fcxp_active_q, fcxp)); 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()
724 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in hal_fcxp_send_comp() local
741 fcxp = BFA_FCXP_FROM_TAG(mod, fcxp_tag); in hal_fcxp_send_comp()
745 hal_fcxp_rx_plog(mod->bfa, fcxp, fcxp_rsp); in hal_fcxp_send_comp()
748 bfa_trc(mod->bfa, (NULL == fcxp->caller)); in hal_fcxp_send_comp()
977 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_reqbuf() local
981 reqbuf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_reqbuf()
982 mod->req_pld_sz + mod->rsp_pld_sz); in bfa_fcxp_get_reqbuf()
989 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_reqbufsz() local
991 return mod->req_pld_sz; in bfa_fcxp_get_reqbufsz()
1004 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_get_rspbuf() local
1009 fcxp_buf = bfa_mem_get_dmabuf_kva(mod, fcxp->fcxp_tag, in bfa_fcxp_get_rspbuf()
1010 mod->req_pld_sz + mod->rsp_pld_sz); in bfa_fcxp_get_rspbuf()
1013 return ((u8 *) fcxp_buf) + mod->req_pld_sz; in bfa_fcxp_get_rspbuf()
1026 struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod; in bfa_fcxp_free() local
1029 bfa_trc(mod->bfa, fcxp->fcxp_tag); in bfa_fcxp_free()
1120 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_req_rsp_alloc_wait() local
1123 WARN_ON(!list_empty(&mod->fcxp_req_free_q)); in bfa_fcxp_req_rsp_alloc_wait()
1125 WARN_ON(!list_empty(&mod->fcxp_rsp_free_q)); in bfa_fcxp_req_rsp_alloc_wait()
1139 list_add_tail(&wqe->qe, &mod->req_wait_q); in bfa_fcxp_req_rsp_alloc_wait()
1141 list_add_tail(&wqe->qe, &mod->rsp_wait_q); in bfa_fcxp_req_rsp_alloc_wait()
1147 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_walloc_cancel() local
1149 WARN_ON(!bfa_q_is_on_q(&mod->req_wait_q, wqe) || in bfa_fcxp_walloc_cancel()
1150 !bfa_q_is_on_q(&mod->rsp_wait_q, wqe)); in bfa_fcxp_walloc_cancel()
1188 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_get_maxrsp() local
1190 return mod->rsp_pld_sz; in bfa_fcxp_get_maxrsp()
1196 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); in bfa_fcxp_res_recfg() local
1200 for (i = 0; i < (mod->num_fcxps - num_fcxp_fw); i++) { in bfa_fcxp_res_recfg()
1201 if (i < ((mod->num_fcxps - num_fcxp_fw) / 2)) { in bfa_fcxp_res_recfg()
1202 bfa_q_deq_tail(&mod->fcxp_req_free_q, &qe); in bfa_fcxp_res_recfg()
1203 list_add_tail(qe, &mod->fcxp_req_unused_q); in bfa_fcxp_res_recfg()
1205 bfa_q_deq_tail(&mod->fcxp_rsp_free_q, &qe); in bfa_fcxp_res_recfg()
1206 list_add_tail(qe, &mod->fcxp_rsp_unused_q); in bfa_fcxp_res_recfg()
1533 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_attach() local
1537 mod->num_lps = BFA_LPS_MAX_LPORTS; in bfa_lps_attach()
1539 mod->num_lps = BFA_LPS_MIN_LPORTS; in bfa_lps_attach()
1541 mod->num_lps = BFA_LPS_MAX_LPORTS; in bfa_lps_attach()
1542 mod->lps_arr = lps = (struct bfa_lps_s *) bfa_mem_kva_curp(mod); in bfa_lps_attach()
1544 bfa_mem_kva_curp(mod) += mod->num_lps * sizeof(struct bfa_lps_s); in bfa_lps_attach()
1546 INIT_LIST_HEAD(&mod->lps_free_q); in bfa_lps_attach()
1547 INIT_LIST_HEAD(&mod->lps_active_q); in bfa_lps_attach()
1548 INIT_LIST_HEAD(&mod->lps_login_q); in bfa_lps_attach()
1550 for (i = 0; i < mod->num_lps; i++, lps++) { in bfa_lps_attach()
1555 list_add_tail(&lps->qe, &mod->lps_free_q); in bfa_lps_attach()
1580 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_iocdisable() local
1584 list_for_each_safe(qe, qen, &mod->lps_active_q) { in bfa_lps_iocdisable()
1588 list_for_each_safe(qe, qen, &mod->lps_login_q) { in bfa_lps_iocdisable()
1592 list_splice_tail_init(&mod->lps_login_q, &mod->lps_active_q); in bfa_lps_iocdisable()
1601 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_login_rsp() local
1604 WARN_ON(rsp->bfa_tag >= mod->num_lps); in bfa_lps_login_rsp()
1605 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); in bfa_lps_login_rsp()
1647 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_login_rsp()
1655 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_no_res() local
1669 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_no_res()
1682 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_logout_rsp() local
1685 WARN_ON(rsp->bfa_tag >= mod->num_lps); in bfa_lps_logout_rsp()
1686 lps = BFA_LPS_FROM_TAG(mod, rsp->bfa_tag); in bfa_lps_logout_rsp()
1697 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_rx_cvl_event() local
1700 lps = BFA_LPS_FROM_TAG(mod, cvl->bfa_tag); in bfa_lps_rx_cvl_event()
1722 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); in bfa_lps_free() local
1726 list_add_tail(&lps->qe, &mod->lps_free_q); in bfa_lps_free()
1735 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa); in bfa_lps_send_login() local
1754 list_add_tail(&lps->qe, &mod->lps_login_q); in bfa_lps_send_login()
1917 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_alloc() local
1920 bfa_q_deq(&mod->lps_free_q, &lps); in bfa_lps_alloc()
1925 list_add_tail(&lps->qe, &mod->lps_active_q); in bfa_lps_alloc()
1988 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_fwtag() local
1990 return BFA_LPS_FROM_TAG(mod, lp_tag)->fw_tag; in bfa_lps_get_fwtag()
1999 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_tag_from_pid() local
2003 for (i = 0, lps = mod->lps_arr; i < mod->num_lps; i++, lps++) { in bfa_lps_get_tag_from_pid()
2019 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); in bfa_lps_get_base_pid() local
2021 return BFA_LPS_FROM_TAG(mod, 0)->lp_pid; in bfa_lps_get_base_pid()
4906 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_attach() local
4910 INIT_LIST_HEAD(&mod->rp_free_q); in bfa_rport_attach()
4911 INIT_LIST_HEAD(&mod->rp_active_q); in bfa_rport_attach()
4912 INIT_LIST_HEAD(&mod->rp_unused_q); in bfa_rport_attach()
4914 rp = (struct bfa_rport_s *) bfa_mem_kva_curp(mod); in bfa_rport_attach()
4915 mod->rps_list = rp; in bfa_rport_attach()
4916 mod->num_rports = cfg->fwcfg.num_rports; in bfa_rport_attach()
4918 WARN_ON(!mod->num_rports || in bfa_rport_attach()
4919 (mod->num_rports & (mod->num_rports - 1))); in bfa_rport_attach()
4921 for (i = 0; i < mod->num_rports; i++, rp++) { in bfa_rport_attach()
4931 list_add_tail(&rp->qe, &mod->rp_free_q); in bfa_rport_attach()
4939 bfa_mem_kva_curp(mod) = (u8 *) rp; in bfa_rport_attach()
4960 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_iocdisable() local
4965 list_splice_tail_init(&mod->rp_unused_q, &mod->rp_free_q); in bfa_rport_iocdisable()
4967 list_for_each_safe(qe, qen, &mod->rp_active_q) { in bfa_rport_iocdisable()
4974 bfa_rport_alloc(struct bfa_rport_mod_s *mod) in bfa_rport_alloc() argument
4978 bfa_q_deq(&mod->rp_free_q, &rport); in bfa_rport_alloc()
4980 list_add_tail(&rport->qe, &mod->rp_active_q); in bfa_rport_alloc()
4988 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa); in bfa_rport_free() local
4990 WARN_ON(!bfa_q_is_on_q(&mod->rp_active_q, rport)); in bfa_rport_free()
4992 list_add_tail(&rport->qe, &mod->rp_free_q); in bfa_rport_free()
5145 struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(bfa); in bfa_rport_res_recfg() local
5149 for (i = 0; i < (mod->num_rports - num_rport_fw); i++) { in bfa_rport_res_recfg()
5150 bfa_q_deq_tail(&mod->rp_free_q, &qe); in bfa_rport_res_recfg()
5151 list_add_tail(qe, &mod->rp_unused_q); in bfa_rport_res_recfg()
5287 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_attach() local
5300 INIT_LIST_HEAD(&mod->sgpg_q); in bfa_sgpg_attach()
5301 INIT_LIST_HEAD(&mod->sgpg_wait_q); in bfa_sgpg_attach()
5305 mod->free_sgpgs = mod->num_sgpgs = cfg->drvcfg.num_sgpgs; in bfa_sgpg_attach()
5311 hsgpg = (struct bfa_sgpg_s *) bfa_mem_kva_curp(mod); in bfa_sgpg_attach()
5313 bfa_mem_dma_seg_iter(mod, seg_ptr, nsegs, idx) { in bfa_sgpg_attach()
5335 list_add_tail(&hsgpg->qe, &mod->sgpg_q); in bfa_sgpg_attach()
5343 bfa_mem_kva_curp(mod) = (u8 *) hsgpg; in bfa_sgpg_attach()
5369 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_malloc() local
5373 if (mod->free_sgpgs < nsgpgs) in bfa_sgpg_malloc()
5377 bfa_q_deq(&mod->sgpg_q, &hsgpg); in bfa_sgpg_malloc()
5382 mod->free_sgpgs -= nsgpgs; in bfa_sgpg_malloc()
5389 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_mfree() local
5392 mod->free_sgpgs += nsgpg; in bfa_sgpg_mfree()
5393 WARN_ON(mod->free_sgpgs > mod->num_sgpgs); in bfa_sgpg_mfree()
5395 list_splice_tail_init(sgpg_q, &mod->sgpg_q); in bfa_sgpg_mfree()
5397 if (list_empty(&mod->sgpg_wait_q)) in bfa_sgpg_mfree()
5404 wqe = bfa_q_first(&mod->sgpg_wait_q); in bfa_sgpg_mfree()
5405 if (mod->free_sgpgs < wqe->nsgpg) in bfa_sgpg_mfree()
5406 nsgpg = mod->free_sgpgs; in bfa_sgpg_mfree()
5415 } while (mod->free_sgpgs && !list_empty(&mod->sgpg_wait_q)); in bfa_sgpg_mfree()
5421 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_wait() local
5424 WARN_ON(nsgpg <= mod->free_sgpgs); in bfa_sgpg_wait()
5431 if (mod->free_sgpgs) { in bfa_sgpg_wait()
5435 WARN_ON(!list_empty(&mod->sgpg_wait_q)); in bfa_sgpg_wait()
5436 list_splice_tail_init(&mod->sgpg_q, &wqe->sgpg_q); in bfa_sgpg_wait()
5437 wqe->nsgpg -= mod->free_sgpgs; in bfa_sgpg_wait()
5438 mod->free_sgpgs = 0; in bfa_sgpg_wait()
5441 list_add_tail(&wqe->qe, &mod->sgpg_wait_q); in bfa_sgpg_wait()
5447 struct bfa_sgpg_mod_s *mod = BFA_SGPG_MOD(bfa); in bfa_sgpg_wcancel() local
5449 WARN_ON(!bfa_q_is_on_q(&mod->sgpg_wait_q, wqe)); in bfa_sgpg_wcancel()
5766 struct bfa_uf_mod_s *mod = BFA_UF_MOD(bfa); in bfa_uf_res_recfg() local
5770 for (i = 0; i < (mod->num_ufs - num_uf_fw); i++) { in bfa_uf_res_recfg()
5771 bfa_q_deq_tail(&mod->uf_free_q, &qe); in bfa_uf_res_recfg()
5772 list_add_tail(qe, &mod->uf_unused_q); in bfa_uf_res_recfg()