ehca_iverbs.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. * IBM eServer eHCA Infiniband device driver for Linux on POWER
  3. *
  4. * Function definitions for internal functions
  5. *
  6. * Authors: Heiko J Schick <schickhj@de.ibm.com>
  7. * Dietmar Decker <ddecker@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_IVERBS_H__
  42. #define __EHCA_IVERBS_H__
  43. #include "ehca_classes.h"
  44. int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
  45. int ehca_query_port(struct ib_device *ibdev, u8 port,
  46. struct ib_port_attr *props);
  47. int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 * pkey);
  48. int ehca_query_gid(struct ib_device *ibdev, u8 port, int index,
  49. union ib_gid *gid);
  50. int ehca_modify_port(struct ib_device *ibdev, u8 port, int port_modify_mask,
  51. struct ib_port_modify *props);
  52. struct ib_pd *ehca_alloc_pd(struct ib_device *device,
  53. struct ib_ucontext *context,
  54. struct ib_udata *udata);
  55. int ehca_dealloc_pd(struct ib_pd *pd);
  56. struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
  57. int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr);
  58. int ehca_query_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr);
  59. int ehca_destroy_ah(struct ib_ah *ah);
  60. struct ib_mr *ehca_get_dma_mr(struct ib_pd *pd, int mr_access_flags);
  61. struct ib_mr *ehca_reg_phys_mr(struct ib_pd *pd,
  62. struct ib_phys_buf *phys_buf_array,
  63. int num_phys_buf,
  64. int mr_access_flags, u64 *iova_start);
  65. struct ib_mr *ehca_reg_user_mr(struct ib_pd *pd,
  66. struct ib_umem *region,
  67. int mr_access_flags, struct ib_udata *udata);
  68. int ehca_rereg_phys_mr(struct ib_mr *mr,
  69. int mr_rereg_mask,
  70. struct ib_pd *pd,
  71. struct ib_phys_buf *phys_buf_array,
  72. int num_phys_buf, int mr_access_flags, u64 *iova_start);
  73. int ehca_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr);
  74. int ehca_dereg_mr(struct ib_mr *mr);
  75. struct ib_mw *ehca_alloc_mw(struct ib_pd *pd);
  76. int ehca_bind_mw(struct ib_qp *qp, struct ib_mw *mw,
  77. struct ib_mw_bind *mw_bind);
  78. int ehca_dealloc_mw(struct ib_mw *mw);
  79. struct ib_fmr *ehca_alloc_fmr(struct ib_pd *pd,
  80. int mr_access_flags,
  81. struct ib_fmr_attr *fmr_attr);
  82. int ehca_map_phys_fmr(struct ib_fmr *fmr,
  83. u64 *page_list, int list_len, u64 iova);
  84. int ehca_unmap_fmr(struct list_head *fmr_list);
  85. int ehca_dealloc_fmr(struct ib_fmr *fmr);
  86. enum ehca_eq_type {
  87. EHCA_EQ = 0, /* Event Queue */
  88. EHCA_NEQ /* Notification Event Queue */
  89. };
  90. int ehca_create_eq(struct ehca_shca *shca, struct ehca_eq *eq,
  91. enum ehca_eq_type type, const u32 length);
  92. int ehca_destroy_eq(struct ehca_shca *shca, struct ehca_eq *eq);
  93. void *ehca_poll_eq(struct ehca_shca *shca, struct ehca_eq *eq);
  94. struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe,
  95. struct ib_ucontext *context,
  96. struct ib_udata *udata);
  97. int ehca_destroy_cq(struct ib_cq *cq);
  98. int ehca_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata);
  99. int ehca_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc);
  100. int ehca_peek_cq(struct ib_cq *cq, int wc_cnt);
  101. int ehca_req_notify_cq(struct ib_cq *cq, enum ib_cq_notify cq_notify);
  102. struct ib_qp *ehca_create_qp(struct ib_pd *pd,
  103. struct ib_qp_init_attr *init_attr,
  104. struct ib_udata *udata);
  105. int ehca_destroy_qp(struct ib_qp *qp);
  106. int ehca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
  107. struct ib_udata *udata);
  108. int ehca_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
  109. int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr);
  110. int ehca_post_send(struct ib_qp *qp, struct ib_send_wr *send_wr,
  111. struct ib_send_wr **bad_send_wr);
  112. int ehca_post_recv(struct ib_qp *qp, struct ib_recv_wr *recv_wr,
  113. struct ib_recv_wr **bad_recv_wr);
  114. u64 ehca_define_sqp(struct ehca_shca *shca, struct ehca_qp *ibqp,
  115. struct ib_qp_init_attr *qp_init_attr);
  116. int ehca_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
  117. int ehca_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
  118. struct ib_ucontext *ehca_alloc_ucontext(struct ib_device *device,
  119. struct ib_udata *udata);
  120. int ehca_dealloc_ucontext(struct ib_ucontext *context);
  121. int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
  122. void ehca_poll_eqs(unsigned long data);
  123. int ehca_mmap_nopage(u64 foffset,u64 length,void **mapped,
  124. struct vm_area_struct **vma);
  125. int ehca_mmap_register(u64 physical,void **mapped,
  126. struct vm_area_struct **vma);
  127. int ehca_munmap(unsigned long addr, size_t len);
  128. #endif