Path: blob/master/drivers/infiniband/hw/ehca/ehca_mrmw.h
15112 views
/*1* IBM eServer eHCA Infiniband device driver for Linux on POWER2*3* MR/MW declarations and inline functions4*5* Authors: Dietmar Decker <[email protected]>6* Christoph Raisch <[email protected]>7*8* Copyright (c) 2005 IBM Corporation9*10* All rights reserved.11*12* This source code is distributed under a dual license of GPL v2.0 and OpenIB13* BSD.14*15* OpenIB BSD License16*17* Redistribution and use in source and binary forms, with or without18* modification, are permitted provided that the following conditions are met:19*20* Redistributions of source code must retain the above copyright notice, this21* list of conditions and the following disclaimer.22*23* Redistributions in binary form must reproduce the above copyright notice,24* this list of conditions and the following disclaimer in the documentation25* and/or other materials26* provided with the distribution.27*28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"29* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE30* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE31* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE32* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR33* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF34* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR35* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER36* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)37* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE38* POSSIBILITY OF SUCH DAMAGE.39*/4041#ifndef _EHCA_MRMW_H_42#define _EHCA_MRMW_H_4344enum ehca_reg_type {45EHCA_REG_MR,46EHCA_REG_BUSMAP_MR47};4849int ehca_reg_mr(struct ehca_shca *shca,50struct ehca_mr *e_mr,51u64 *iova_start,52u64 size,53int acl,54struct ehca_pd *e_pd,55struct ehca_mr_pginfo *pginfo,56u32 *lkey,57u32 *rkey,58enum ehca_reg_type reg_type);5960int ehca_reg_mr_rpages(struct ehca_shca *shca,61struct ehca_mr *e_mr,62struct ehca_mr_pginfo *pginfo);6364int ehca_rereg_mr(struct ehca_shca *shca,65struct ehca_mr *e_mr,66u64 *iova_start,67u64 size,68int mr_access_flags,69struct ehca_pd *e_pd,70struct ehca_mr_pginfo *pginfo,71u32 *lkey,72u32 *rkey);7374int ehca_unmap_one_fmr(struct ehca_shca *shca,75struct ehca_mr *e_fmr);7677int ehca_reg_smr(struct ehca_shca *shca,78struct ehca_mr *e_origmr,79struct ehca_mr *e_newmr,80u64 *iova_start,81int acl,82struct ehca_pd *e_pd,83u32 *lkey,84u32 *rkey);8586int ehca_reg_internal_maxmr(struct ehca_shca *shca,87struct ehca_pd *e_pd,88struct ehca_mr **maxmr);8990int ehca_reg_maxmr(struct ehca_shca *shca,91struct ehca_mr *e_newmr,92u64 *iova_start,93int acl,94struct ehca_pd *e_pd,95u32 *lkey,96u32 *rkey);9798int ehca_dereg_internal_maxmr(struct ehca_shca *shca);99100int ehca_mr_chk_buf_and_calc_size(struct ib_phys_buf *phys_buf_array,101int num_phys_buf,102u64 *iova_start,103u64 *size);104105int ehca_fmr_check_page_list(struct ehca_mr *e_fmr,106u64 *page_list,107int list_len);108109int ehca_set_pagebuf(struct ehca_mr_pginfo *pginfo,110u32 number,111u64 *kpage);112113int ehca_mr_is_maxmr(u64 size,114u64 *iova_start);115116void ehca_mrmw_map_acl(int ib_acl,117u32 *hipz_acl);118119void ehca_mrmw_set_pgsize_hipz_acl(u32 pgsize, u32 *hipz_acl);120121void ehca_mrmw_reverse_map_acl(const u32 *hipz_acl,122int *ib_acl);123124void ehca_mr_deletenew(struct ehca_mr *mr);125126int ehca_create_busmap(void);127128void ehca_destroy_busmap(void);129130extern struct ib_dma_mapping_ops ehca_dma_mapping_ops;131#endif /*_EHCA_MRMW_H_*/132133134