Lines Matching refs:mrw
557 int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_free_mrw() argument
565 if (mrw->lkey == 0xFFFFFFFF) { in bnxt_qplib_free_mrw()
572 req.mrw_flags = mrw->type; in bnxt_qplib_free_mrw()
574 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_free_mrw()
575 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_free_mrw()
576 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_free_mrw()
577 req.key = cpu_to_le32(mrw->rkey); in bnxt_qplib_free_mrw()
579 req.key = cpu_to_le32(mrw->lkey); in bnxt_qplib_free_mrw()
587 if (mrw->hwq.max_elements) in bnxt_qplib_free_mrw()
588 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq); in bnxt_qplib_free_mrw()
593 int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_alloc_mrw() argument
604 req.pd_id = cpu_to_le32(mrw->pd->id); in bnxt_qplib_alloc_mrw()
605 req.mrw_flags = mrw->type; in bnxt_qplib_alloc_mrw()
606 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR && in bnxt_qplib_alloc_mrw()
607 mrw->flags & BNXT_QPLIB_FR_PMR) || in bnxt_qplib_alloc_mrw()
608 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || in bnxt_qplib_alloc_mrw()
609 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) in bnxt_qplib_alloc_mrw()
611 tmp = (unsigned long)mrw; in bnxt_qplib_alloc_mrw()
619 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_alloc_mrw()
620 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_alloc_mrw()
621 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_alloc_mrw()
622 mrw->rkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
624 mrw->lkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
628 int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw, in bnxt_qplib_dereg_mrw() argument
639 req.lkey = cpu_to_le32(mrw->lkey); in bnxt_qplib_dereg_mrw()
646 if (mrw->hwq.max_elements) { in bnxt_qplib_dereg_mrw()
647 mrw->va = 0; in bnxt_qplib_dereg_mrw()
648 mrw->total_size = 0; in bnxt_qplib_dereg_mrw()
649 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq); in bnxt_qplib_dereg_mrw()