Lines Matching refs:mrw
469 int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_free_mrw() argument
477 if (mrw->lkey == 0xFFFFFFFF) { in bnxt_qplib_free_mrw()
484 req.mrw_flags = mrw->type; in bnxt_qplib_free_mrw()
486 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_free_mrw()
487 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_free_mrw()
488 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_free_mrw()
489 req.key = cpu_to_le32(mrw->rkey); in bnxt_qplib_free_mrw()
491 req.key = cpu_to_le32(mrw->lkey); in bnxt_qplib_free_mrw()
499 if (mrw->hwq.max_elements) in bnxt_qplib_free_mrw()
500 bnxt_qplib_free_hwq(res, &mrw->hwq); in bnxt_qplib_free_mrw()
505 int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) in bnxt_qplib_alloc_mrw() argument
516 req.pd_id = cpu_to_le32(mrw->pd->id); in bnxt_qplib_alloc_mrw()
517 req.mrw_flags = mrw->type; in bnxt_qplib_alloc_mrw()
518 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR && in bnxt_qplib_alloc_mrw()
519 mrw->flags & BNXT_QPLIB_FR_PMR) || in bnxt_qplib_alloc_mrw()
520 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || in bnxt_qplib_alloc_mrw()
521 mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) in bnxt_qplib_alloc_mrw()
523 tmp = (unsigned long)mrw; in bnxt_qplib_alloc_mrw()
531 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) || in bnxt_qplib_alloc_mrw()
532 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) || in bnxt_qplib_alloc_mrw()
533 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B)) in bnxt_qplib_alloc_mrw()
534 mrw->rkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
536 mrw->lkey = le32_to_cpu(resp.xid); in bnxt_qplib_alloc_mrw()
540 int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw, in bnxt_qplib_dereg_mrw() argument
551 req.lkey = cpu_to_le32(mrw->lkey); in bnxt_qplib_dereg_mrw()
558 if (mrw->hwq.max_elements) { in bnxt_qplib_dereg_mrw()
559 mrw->va = 0; in bnxt_qplib_dereg_mrw()
560 mrw->total_size = 0; in bnxt_qplib_dereg_mrw()
561 bnxt_qplib_free_hwq(res, &mrw->hwq); in bnxt_qplib_dereg_mrw()