ehca_mrmw.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * IBM eServer eHCA Infiniband device driver for Linux on POWER
  3. *
  4. * MR/MW declarations and inline functions
  5. *
  6. * Authors: Dietmar Decker <ddecker@de.ibm.com>
  7. * Christoph Raisch <raisch@de.ibm.com>
  8. *
  9. * Copyright (c) 2005 IBM Corporation
  10. *
  11. * All rights reserved.
  12. *
  13. * This source code is distributed under a dual license of GPL v2.0 and OpenIB
  14. * BSD.
  15. *
  16. * OpenIB BSD License
  17. *
  18. * Redistribution and use in source and binary forms, with or without
  19. * modification, are permitted provided that the following conditions are met:
  20. *
  21. * Redistributions of source code must retain the above copyright notice, this
  22. * list of conditions and the following disclaimer.
  23. *
  24. * Redistributions in binary form must reproduce the above copyright notice,
  25. * this list of conditions and the following disclaimer in the documentation
  26. * and/or other materials
  27. * provided with the distribution.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  30. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  33. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  34. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  35. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  36. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  37. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  38. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  39. * POSSIBILITY OF SUCH DAMAGE.
  40. */
  41. #ifndef _EHCA_MRMW_H_
  42. #define _EHCA_MRMW_H_
  43. int ehca_reg_mr(struct ehca_shca *shca,
  44. struct ehca_mr *e_mr,
  45. u64 *iova_start,
  46. u64 size,
  47. int acl,
  48. struct ehca_pd *e_pd,
  49. struct ehca_mr_pginfo *pginfo,
  50. u32 *lkey,
  51. u32 *rkey);
  52. int ehca_reg_mr_rpages(struct ehca_shca *shca,
  53. struct ehca_mr *e_mr,
  54. struct ehca_mr_pginfo *pginfo);
  55. int ehca_rereg_mr(struct ehca_shca *shca,
  56. struct ehca_mr *e_mr,
  57. u64 *iova_start,
  58. u64 size,
  59. int mr_access_flags,
  60. struct ehca_pd *e_pd,
  61. struct ehca_mr_pginfo *pginfo,
  62. u32 *lkey,
  63. u32 *rkey);
  64. int ehca_unmap_one_fmr(struct ehca_shca *shca,
  65. struct ehca_mr *e_fmr);
  66. int ehca_reg_smr(struct ehca_shca *shca,
  67. struct ehca_mr *e_origmr,
  68. struct ehca_mr *e_newmr,
  69. u64 *iova_start,
  70. int acl,
  71. struct ehca_pd *e_pd,
  72. u32 *lkey,
  73. u32 *rkey);
  74. int ehca_reg_internal_maxmr(struct ehca_shca *shca,
  75. struct ehca_pd *e_pd,
  76. struct ehca_mr **maxmr);
  77. int ehca_reg_maxmr(struct ehca_shca *shca,
  78. struct ehca_mr *e_newmr,
  79. u64 *iova_start,
  80. int acl,
  81. struct ehca_pd *e_pd,
  82. u32 *lkey,
  83. u32 *rkey);
  84. int ehca_dereg_internal_maxmr(struct ehca_shca *shca);
  85. int ehca_mr_chk_buf_and_calc_size(struct ib_phys_buf *phys_buf_array,
  86. int num_phys_buf,
  87. u64 *iova_start,
  88. u64 *size);
  89. int ehca_fmr_check_page_list(struct ehca_mr *e_fmr,
  90. u64 *page_list,
  91. int list_len);
  92. int ehca_set_pagebuf(struct ehca_mr_pginfo *pginfo,
  93. u32 number,
  94. u64 *kpage);
  95. int ehca_mr_is_maxmr(u64 size,
  96. u64 *iova_start);
  97. void ehca_mrmw_map_acl(int ib_acl,
  98. u32 *hipz_acl);
  99. void ehca_mrmw_set_pgsize_hipz_acl(u32 pgsize, u32 *hipz_acl);
  100. void ehca_mrmw_reverse_map_acl(const u32 *hipz_acl,
  101. int *ib_acl);
  102. void ehca_mr_deletenew(struct ehca_mr *mr);
  103. #endif /*_EHCA_MRMW_H_*/