ocrdma_abi.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* This file is part of the Emulex RoCE Device Driver for
  2. * RoCE (RDMA over Converged Ethernet) adapters.
  3. * Copyright (C) 2012-2015 Emulex. All rights reserved.
  4. * EMULEX and SLI are trademarks of Emulex.
  5. * www.emulex.com
  6. *
  7. * This software is available to you under a choice of one of two licenses.
  8. * You may choose to be licensed under the terms of the GNU General Public
  9. * License (GPL) Version 2, available from the file COPYING in the main
  10. * directory of this source tree, or the BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. *
  16. * - Redistributions of source code must retain the above copyright notice,
  17. * this list of conditions and the following disclaimer.
  18. *
  19. * - Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in
  21. * the documentation and/or other materials provided with the distribution.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  27. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  30. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  32. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  33. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. * Contact Information:
  36. * linux-drivers@emulex.com
  37. *
  38. * Emulex
  39. * 3333 Susan Street
  40. * Costa Mesa, CA 92626
  41. */
  42. #ifndef __OCRDMA_ABI_H__
  43. #define __OCRDMA_ABI_H__
  44. #define OCRDMA_ABI_VERSION 2
  45. #define OCRDMA_BE_ROCE_ABI_VERSION 1
  46. /* user kernel communication data structures. */
  47. struct ocrdma_alloc_ucontext_resp {
  48. u32 dev_id;
  49. u32 wqe_size;
  50. u32 max_inline_data;
  51. u32 dpp_wqe_size;
  52. u64 ah_tbl_page;
  53. u32 ah_tbl_len;
  54. u32 rqe_size;
  55. u8 fw_ver[32];
  56. /* for future use/new features in progress */
  57. u64 rsvd1;
  58. u64 rsvd2;
  59. };
  60. struct ocrdma_alloc_pd_ureq {
  61. u64 rsvd1;
  62. };
  63. struct ocrdma_alloc_pd_uresp {
  64. u32 id;
  65. u32 dpp_enabled;
  66. u32 dpp_page_addr_hi;
  67. u32 dpp_page_addr_lo;
  68. u64 rsvd1;
  69. };
  70. struct ocrdma_create_cq_ureq {
  71. u32 dpp_cq;
  72. u32 rsvd; /* pad */
  73. };
  74. #define MAX_CQ_PAGES 8
  75. struct ocrdma_create_cq_uresp {
  76. u32 cq_id;
  77. u32 page_size;
  78. u32 num_pages;
  79. u32 max_hw_cqe;
  80. u64 page_addr[MAX_CQ_PAGES];
  81. u64 db_page_addr;
  82. u32 db_page_size;
  83. u32 phase_change;
  84. /* for future use/new features in progress */
  85. u64 rsvd1;
  86. u64 rsvd2;
  87. };
  88. #define MAX_QP_PAGES 8
  89. #define MAX_UD_AV_PAGES 8
  90. struct ocrdma_create_qp_ureq {
  91. u8 enable_dpp_cq;
  92. u8 rsvd;
  93. u16 dpp_cq_id;
  94. u32 rsvd1; /* pad */
  95. };
  96. struct ocrdma_create_qp_uresp {
  97. u16 qp_id;
  98. u16 sq_dbid;
  99. u16 rq_dbid;
  100. u16 resv0; /* pad */
  101. u32 sq_page_size;
  102. u32 rq_page_size;
  103. u32 num_sq_pages;
  104. u32 num_rq_pages;
  105. u64 sq_page_addr[MAX_QP_PAGES];
  106. u64 rq_page_addr[MAX_QP_PAGES];
  107. u64 db_page_addr;
  108. u32 db_page_size;
  109. u32 dpp_credit;
  110. u32 dpp_offset;
  111. u32 num_wqe_allocated;
  112. u32 num_rqe_allocated;
  113. u32 db_sq_offset;
  114. u32 db_rq_offset;
  115. u32 db_shift;
  116. u64 rsvd[11];
  117. } __packed;
  118. struct ocrdma_create_srq_uresp {
  119. u16 rq_dbid;
  120. u16 resv0; /* pad */
  121. u32 resv1;
  122. u32 rq_page_size;
  123. u32 num_rq_pages;
  124. u64 rq_page_addr[MAX_QP_PAGES];
  125. u64 db_page_addr;
  126. u32 db_page_size;
  127. u32 num_rqe_allocated;
  128. u32 db_rq_offset;
  129. u32 db_shift;
  130. u64 rsvd2;
  131. u64 rsvd3;
  132. };
  133. #endif /* __OCRDMA_ABI_H__ */