Lines Matching refs:to_mdev

66 	struct mthca_dev *mdev = to_mdev(ibdev);  in mthca_query_device()
151 err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, in mthca_query_port()
163 props->gid_tbl_len = to_mdev(ibdev)->limits.gid_table_len; in mthca_query_port()
165 props->pkey_tbl_len = to_mdev(ibdev)->limits.pkey_table_len; in mthca_query_port()
190 if (mutex_lock_interruptible(&to_mdev(ibdev)->cap_mask_mutex)) in mthca_modify_device()
193 mutex_unlock(&to_mdev(ibdev)->cap_mask_mutex); in mthca_modify_device()
207 if (mutex_lock_interruptible(&to_mdev(ibdev)->cap_mask_mutex)) in mthca_modify_port()
220 err = mthca_SET_IB(to_mdev(ibdev), &set_ib, port); in mthca_modify_port()
224 mutex_unlock(&to_mdev(ibdev)->cap_mask_mutex); in mthca_modify_port()
244 err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, in mthca_query_pkey()
273 err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, in mthca_query_gid()
284 err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, in mthca_query_gid()
304 if (!(to_mdev(ibdev)->active)) in mthca_alloc_ucontext()
309 uresp.qp_tab_size = to_mdev(ibdev)->limits.num_qps; in mthca_alloc_ucontext()
310 if (mthca_is_memfree(to_mdev(ibdev))) in mthca_alloc_ucontext()
311 uresp.uarc_size = to_mdev(ibdev)->uar_table.uarc_size; in mthca_alloc_ucontext()
319 err = mthca_uar_alloc(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
325 context->db_tab = mthca_init_user_db_tab(to_mdev(ibdev)); in mthca_alloc_ucontext()
328 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
334 mthca_cleanup_user_db_tab(to_mdev(ibdev), &context->uar, context->db_tab); in mthca_alloc_ucontext()
335 mthca_uar_free(to_mdev(ibdev), &context->uar); in mthca_alloc_ucontext()
347 mthca_cleanup_user_db_tab(to_mdev(context->device), &to_mucontext(context)->uar, in mthca_dealloc_ucontext()
349 mthca_uar_free(to_mdev(context->device), &to_mucontext(context)->uar); in mthca_dealloc_ucontext()
382 err = mthca_pd_alloc(to_mdev(ibdev), !context, pd); in mthca_alloc_pd()
390 mthca_pd_free(to_mdev(ibdev), pd); in mthca_alloc_pd()
401 mthca_pd_free(to_mdev(pd->device), to_mpd(pd)); in mthca_dealloc_pd()
417 err = mthca_create_ah(to_mdev(pd->device), to_mpd(pd), ah_attr, ah); in mthca_ah_create()
428 mthca_destroy_ah(to_mdev(ah->device), to_mah(ah)); in mthca_ah_destroy()
458 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
469 err = mthca_alloc_srq(to_mdev(pd->device), to_mpd(pd), in mthca_create_srq()
473 mthca_unmap_user_db(to_mdev(pd->device), &context->uar, in mthca_create_srq()
480 mthca_free_srq(to_mdev(pd->device), srq); in mthca_create_srq()
500 mthca_unmap_user_db(to_mdev(srq->device), &context->uar, in mthca_destroy_srq()
504 mthca_free_srq(to_mdev(srq->device), to_msrq(srq)); in mthca_destroy_srq()
540 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
548 err = mthca_map_user_db(to_mdev(pd->device), &context->uar, in mthca_create_qp()
552 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
565 err = mthca_alloc_qp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
574 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
578 mthca_unmap_user_db(to_mdev(pd->device), in mthca_create_qp()
600 err = mthca_alloc_sqp(to_mdev(pd->device), to_mpd(pd), in mthca_create_qp()
630 mthca_unmap_user_db(to_mdev(qp->device), in mthca_destroy_qp()
634 mthca_unmap_user_db(to_mdev(qp->device), in mthca_destroy_qp()
639 mthca_free_qp(to_mdev(qp->device), to_mqp(qp)); in mthca_destroy_qp()
654 if (entries < 1 || entries > to_mdev(ibdev)->limits.max_cqes) in mthca_create_cq()
661 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
667 err = mthca_map_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
689 err = mthca_init_cq(to_mdev(ibdev), nent, in mthca_create_cq()
691 context ? ucmd.pdn : to_mdev(ibdev)->driver_pd.pd_num, in mthca_create_cq()
697 mthca_free_cq(to_mdev(ibdev), cq); in mthca_create_cq()
711 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
716 mthca_unmap_user_db(to_mdev(ibdev), &to_mucontext(context)->uar, in mthca_create_cq()
769 struct mthca_dev *dev = to_mdev(ibcq->device); in mthca_resize_cq()
846 mthca_unmap_user_db(to_mdev(cq->device), in mthca_destroy_cq()
850 mthca_unmap_user_db(to_mdev(cq->device), in mthca_destroy_cq()
855 mthca_free_cq(to_mdev(cq->device), to_mcq(cq)); in mthca_destroy_cq()
879 err = mthca_mr_alloc_notrans(to_mdev(pd->device), in mthca_get_dma_mr()
951 mthca_dbg(to_mdev(pd->device), "Registering memory at %llx (iova %llx) " in mthca_reg_phys_mr()
958 err = mthca_mr_alloc_phys(to_mdev(pd->device), in mthca_reg_phys_mr()
979 struct mthca_dev *dev = to_mdev(pd->device); in mthca_reg_user_mr()
1080 mthca_free_mr(to_mdev(mr->device), mmr); in mthca_dereg_mr()
1099 err = mthca_fmr_alloc(to_mdev(pd->device), to_mpd(pd)->pd_num, in mthca_alloc_fmr()
1115 err = mthca_free_fmr(to_mdev(fmr->device), mfmr); in mthca_dealloc_fmr()
1130 if (mdev && to_mdev(fmr->device) != mdev) in mthca_unmap_fmr()
1132 mdev = to_mdev(fmr->device); in mthca_unmap_fmr()