Jason Gunthorpe | d50e14a | 2018-04-20 09:49:10 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Hisilicon Limited. |
| 4 | * |
| 5 | * This software is available to you under a choice of one of two |
| 6 | * licenses. You may choose to be licensed under the terms of the GNU |
| 7 | * General Public License (GPL) Version 2, available from the file |
| 8 | * COPYING in the main directory of this source tree, or the |
| 9 | * OpenIB.org BSD license below: |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or |
| 12 | * without modification, are permitted provided that the following |
| 13 | * conditions are met: |
| 14 | * |
| 15 | * - Redistributions of source code must retain the above |
| 16 | * copyright notice, this list of conditions and the following |
| 17 | * disclaimer. |
| 18 | * |
| 19 | * - Redistributions in binary form must reproduce the above |
| 20 | * copyright notice, this list of conditions and the following |
| 21 | * disclaimer in the documentation and/or other materials |
| 22 | * provided with the distribution. |
| 23 | * |
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | * SOFTWARE. |
| 32 | */ |
| 33 | |
Leon Romanovsky | 4d40995 | 2016-10-19 20:13:07 +0300 | [diff] [blame] | 34 | #ifndef HNS_ABI_USER_H |
| 35 | #define HNS_ABI_USER_H |
| 36 | |
| 37 | #include <linux/types.h> |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 38 | |
| 39 | struct hns_roce_ib_create_cq { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 40 | __aligned_u64 buf_addr; |
| 41 | __aligned_u64 db_addr; |
Wenpeng Liang | 09a5f21 | 2020-09-16 16:43:24 +0800 | [diff] [blame] | 42 | __u32 cqe_size; |
| 43 | __u32 reserved; |
Yixian Liu | 9b44703 | 2018-03-09 18:36:30 +0800 | [diff] [blame] | 44 | }; |
| 45 | |
Weihang Li | 53ef499 | 2020-12-02 09:29:20 +0800 | [diff] [blame] | 46 | enum hns_roce_cq_cap_flags { |
| 47 | HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0, |
| 48 | }; |
| 49 | |
Yixian Liu | 9b44703 | 2018-03-09 18:36:30 +0800 | [diff] [blame] | 50 | struct hns_roce_ib_create_cq_resp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 51 | __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */ |
| 52 | __aligned_u64 cap_flags; |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 53 | }; |
| 54 | |
Lijun Ou | c7bcb13 | 2018-11-24 16:49:21 +0800 | [diff] [blame] | 55 | struct hns_roce_ib_create_srq { |
| 56 | __aligned_u64 buf_addr; |
| 57 | __aligned_u64 db_addr; |
| 58 | __aligned_u64 que_addr; |
| 59 | }; |
| 60 | |
Lijun Ou | 9d9d4ff | 2019-01-23 10:09:27 +0800 | [diff] [blame] | 61 | struct hns_roce_ib_create_srq_resp { |
| 62 | __u32 srqn; |
| 63 | __u32 reserved; |
| 64 | }; |
| 65 | |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 66 | struct hns_roce_ib_create_qp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 67 | __aligned_u64 buf_addr; |
| 68 | __aligned_u64 db_addr; |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 69 | __u8 log_sq_bb_count; |
| 70 | __u8 log_sq_stride; |
| 71 | __u8 sq_no_prefetch; |
| 72 | __u8 reserved[5]; |
Yixian Liu | 0425e3e | 2018-08-02 10:38:05 +0800 | [diff] [blame] | 73 | __aligned_u64 sdb_addr; |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 74 | }; |
| 75 | |
Weihang Li | 53ef499 | 2020-12-02 09:29:20 +0800 | [diff] [blame] | 76 | enum hns_roce_qp_cap_flags { |
| 77 | HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0, |
| 78 | HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1, |
| 79 | HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2, |
Yixing Liu | 0045e0d | 2021-12-07 20:49:01 +0800 | [diff] [blame] | 80 | HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5, |
Weihang Li | 53ef499 | 2020-12-02 09:29:20 +0800 | [diff] [blame] | 81 | }; |
| 82 | |
Yixian Liu | e088a68 | 2018-03-09 18:36:29 +0800 | [diff] [blame] | 83 | struct hns_roce_ib_create_qp_resp { |
Jason Gunthorpe | 26b9906 | 2018-03-20 14:19:51 -0600 | [diff] [blame] | 84 | __aligned_u64 cap_flags; |
Yixing Liu | 0045e0d | 2021-12-07 20:49:01 +0800 | [diff] [blame] | 85 | __aligned_u64 dwqe_mmap_key; |
Yixian Liu | e088a68 | 2018-03-09 18:36:29 +0800 | [diff] [blame] | 86 | }; |
| 87 | |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 88 | struct hns_roce_ib_alloc_ucontext_resp { |
| 89 | __u32 qp_tab_size; |
Wenpeng Liang | 09a5f21 | 2020-09-16 16:43:24 +0800 | [diff] [blame] | 90 | __u32 cqe_size; |
Wenpeng Liang | 3254887 | 2021-03-04 10:55:58 +0800 | [diff] [blame] | 91 | __u32 srq_tab_size; |
| 92 | __u32 reserved; |
oulijun | 9a44353 | 2016-07-21 19:06:38 +0800 | [diff] [blame] | 93 | }; |
Jason Gunthorpe | 633fb4d | 2018-03-14 14:39:42 -0600 | [diff] [blame] | 94 | |
| 95 | struct hns_roce_ib_alloc_pd_resp { |
| 96 | __u32 pdn; |
| 97 | }; |
| 98 | |
Leon Romanovsky | 4d40995 | 2016-10-19 20:13:07 +0300 | [diff] [blame] | 99 | #endif /* HNS_ABI_USER_H */ |