Lines Matching refs:mrw
549 int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_free_mrw() argument
557 if (mrw->lkey == 0xFFFFFFFF) { in bnxt_qplib_free_mrw()
565 req.mrw_flags = mrw->type; in bnxt_qplib_free_mrw()
567 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_free_mrw()
568 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_free_mrw()
569 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_free_mrw()
570 req.key = cpu_to_le32(mrw->rkey); in bnxt_qplib_free_mrw()
572 req.key = cpu_to_le32(mrw->lkey); in bnxt_qplib_free_mrw()
580 if (mrw->hwq.max_elements) in bnxt_qplib_free_mrw()
581 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq); in bnxt_qplib_free_mrw()
586 int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_alloc_mrw() argument
597 req.pd_id = cpu_to_le32(mrw->pd->id); in bnxt_qplib_alloc_mrw()
598 req.mrw_flags = mrw->type; in bnxt_qplib_alloc_mrw()
599 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR && in bnxt_qplib_alloc_mrw()
600 mrw->flags & BNXT_QPLIB_FR_PMR) || in bnxt_qplib_alloc_mrw()
601 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || in bnxt_qplib_alloc_mrw()
602 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) in bnxt_qplib_alloc_mrw()
604 tmp = (unsigned long)mrw; in bnxt_qplib_alloc_mrw()
612 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_alloc_mrw()
613 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_alloc_mrw()
614 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_alloc_mrw()
615 mrw->rkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
617 mrw->lkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
621 int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw, in bnxt_qplib_dereg_mrw() argument
632 req.lkey = cpu_to_le32(mrw->lkey); in bnxt_qplib_dereg_mrw()
639 if (mrw->hwq.max_elements) { in bnxt_qplib_dereg_mrw()
640 mrw->va = 0; in bnxt_qplib_dereg_mrw()
641 mrw->total_size = 0; in bnxt_qplib_dereg_mrw()
642 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq); in bnxt_qplib_dereg_mrw()