bnxt_re-abi.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
  2. /*
  3. * Broadcom NetXtreme-E RoCE driver.
  4. *
  5. * Copyright (c) 2016 - 2017, Broadcom. All rights reserved. The term
  6. * Broadcom refers to Broadcom Limited and/or its subsidiaries.
  7. *
  8. * This software is available to you under a choice of one of two
  9. * licenses. You may choose to be licensed under the terms of the GNU
  10. * General Public License (GPL) Version 2, available from the file
  11. * COPYING in the main directory of this source tree, or the
  12. * BSD license below:
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions
  16. * are met:
  17. *
  18. * 1. Redistributions of source code must retain the above copyright
  19. * notice, this list of conditions and the following disclaimer.
  20. * 2. Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in
  22. * the documentation and/or other materials provided with the
  23. * distribution.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
  26. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  27. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  28. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
  29. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  30. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  31. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  32. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  33. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  34. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  35. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. *
  37. * Description: Uverbs ABI header file
  38. */
  39. #ifndef __BNXT_RE_UVERBS_ABI_H__
  40. #define __BNXT_RE_UVERBS_ABI_H__
  41. #include <linux/types.h>
  42. #define BNXT_RE_ABI_VERSION 1
  43. #define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00
  44. #define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10
  45. #define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18
  46. enum {
  47. BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
  48. BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
  49. };
  50. enum bnxt_re_wqe_mode {
  51. BNXT_QPLIB_WQE_MODE_STATIC = 0x00,
  52. BNXT_QPLIB_WQE_MODE_VARIABLE = 0x01,
  53. BNXT_QPLIB_WQE_MODE_INVALID = 0x02,
  54. };
  55. struct bnxt_re_uctx_resp {
  56. __u32 dev_id;
  57. __u32 max_qp;
  58. __u32 pg_size;
  59. __u32 cqe_sz;
  60. __u32 max_cqd;
  61. __u32 rsvd;
  62. __aligned_u64 comp_mask;
  63. __u32 chip_id0;
  64. __u32 chip_id1;
  65. __u32 mode;
  66. __u32 rsvd1; /* padding */
  67. };
  68. /*
  69. * This struct is placed after the ib_uverbs_alloc_pd_resp struct, which is
  70. * not 8 byted aligned. To avoid undesired padding in various cases we have to
  71. * set this struct to packed.
  72. */
  73. struct bnxt_re_pd_resp {
  74. __u32 pdid;
  75. __u32 dpi;
  76. __u64 dbr;
  77. } __attribute__((packed, aligned(4)));
  78. struct bnxt_re_cq_req {
  79. __aligned_u64 cq_va;
  80. __aligned_u64 cq_handle;
  81. };
  82. struct bnxt_re_cq_resp {
  83. __u32 cqid;
  84. __u32 tail;
  85. __u32 phase;
  86. __u32 rsvd;
  87. };
  88. struct bnxt_re_qp_req {
  89. __aligned_u64 qpsva;
  90. __aligned_u64 qprva;
  91. __aligned_u64 qp_handle;
  92. };
  93. struct bnxt_re_qp_resp {
  94. __u32 qpid;
  95. __u32 rsvd;
  96. };
  97. struct bnxt_re_srq_req {
  98. __aligned_u64 srqva;
  99. __aligned_u64 srq_handle;
  100. };
  101. struct bnxt_re_srq_resp {
  102. __u32 srqid;
  103. };
  104. enum bnxt_re_shpg_offt {
  105. BNXT_RE_BEG_RESV_OFFT = 0x00,
  106. BNXT_RE_AVID_OFFT = 0x10,
  107. BNXT_RE_AVID_SIZE = 0x04,
  108. BNXT_RE_END_RESV_OFFT = 0xFF0
  109. };
  110. #endif /* __BNXT_RE_UVERBS_ABI_H__*/