1d50e14abSJason Gunthorpe /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ 24d409958SLeon Romanovsky /* 34d409958SLeon Romanovsky * Copyright (c) 2016 Hisilicon Limited. 44d409958SLeon Romanovsky * 54d409958SLeon Romanovsky * This software is available to you under a choice of one of two 64d409958SLeon Romanovsky * licenses. You may choose to be licensed under the terms of the GNU 74d409958SLeon Romanovsky * General Public License (GPL) Version 2, available from the file 84d409958SLeon Romanovsky * COPYING in the main directory of this source tree, or the 94d409958SLeon Romanovsky * OpenIB.org BSD license below: 104d409958SLeon Romanovsky * 114d409958SLeon Romanovsky * Redistribution and use in source and binary forms, with or 124d409958SLeon Romanovsky * without modification, are permitted provided that the following 134d409958SLeon Romanovsky * conditions are met: 144d409958SLeon Romanovsky * 154d409958SLeon Romanovsky * - Redistributions of source code must retain the above 164d409958SLeon Romanovsky * copyright notice, this list of conditions and the following 174d409958SLeon Romanovsky * disclaimer. 184d409958SLeon Romanovsky * 194d409958SLeon Romanovsky * - Redistributions in binary form must reproduce the above 204d409958SLeon Romanovsky * copyright notice, this list of conditions and the following 214d409958SLeon Romanovsky * disclaimer in the documentation and/or other materials 224d409958SLeon Romanovsky * provided with the distribution. 234d409958SLeon Romanovsky * 244d409958SLeon Romanovsky * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 254d409958SLeon Romanovsky * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 264d409958SLeon Romanovsky * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 274d409958SLeon Romanovsky * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 284d409958SLeon Romanovsky * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 294d409958SLeon Romanovsky * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 304d409958SLeon Romanovsky * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 314d409958SLeon Romanovsky * SOFTWARE. 324d409958SLeon Romanovsky */ 334d409958SLeon Romanovsky 344d409958SLeon Romanovsky #ifndef HNS_ABI_USER_H 354d409958SLeon Romanovsky #define HNS_ABI_USER_H 364d409958SLeon Romanovsky 374d409958SLeon Romanovsky #include <linux/types.h> 384d409958SLeon Romanovsky 394d409958SLeon Romanovsky struct hns_roce_ib_create_cq { 4026b99066SJason Gunthorpe __aligned_u64 buf_addr; 4126b99066SJason Gunthorpe __aligned_u64 db_addr; 4209a5f210SWenpeng Liang __u32 cqe_size; 4309a5f210SWenpeng Liang __u32 reserved; 449b44703dSYixian Liu }; 459b44703dSYixian Liu 4653ef4999SWeihang Li enum hns_roce_cq_cap_flags { 4753ef4999SWeihang Li HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0, 4853ef4999SWeihang Li }; 4953ef4999SWeihang Li 509b44703dSYixian Liu struct hns_roce_ib_create_cq_resp { 5126b99066SJason Gunthorpe __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */ 5226b99066SJason Gunthorpe __aligned_u64 cap_flags; 534d409958SLeon Romanovsky }; 544d409958SLeon Romanovsky 55c7bcb134SLijun Ou struct hns_roce_ib_create_srq { 56c7bcb134SLijun Ou __aligned_u64 buf_addr; 57c7bcb134SLijun Ou __aligned_u64 db_addr; 58c7bcb134SLijun Ou __aligned_u64 que_addr; 59c7bcb134SLijun Ou }; 60c7bcb134SLijun Ou 619d9d4ff7SLijun Ou struct hns_roce_ib_create_srq_resp { 629d9d4ff7SLijun Ou __u32 srqn; 639d9d4ff7SLijun Ou __u32 reserved; 649d9d4ff7SLijun Ou }; 659d9d4ff7SLijun Ou 664d409958SLeon Romanovsky struct hns_roce_ib_create_qp { 6726b99066SJason Gunthorpe __aligned_u64 buf_addr; 6826b99066SJason Gunthorpe __aligned_u64 db_addr; 694d409958SLeon Romanovsky __u8 log_sq_bb_count; 704d409958SLeon Romanovsky __u8 log_sq_stride; 714d409958SLeon Romanovsky __u8 sq_no_prefetch; 724d409958SLeon Romanovsky __u8 reserved[5]; 730425e3e6SYixian Liu __aligned_u64 sdb_addr; 744d409958SLeon Romanovsky }; 754d409958SLeon Romanovsky 7653ef4999SWeihang Li enum hns_roce_qp_cap_flags { 7753ef4999SWeihang Li HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0, 7853ef4999SWeihang Li HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1, 7953ef4999SWeihang Li HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2, 800045e0d3SYixing Liu HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5, 8153ef4999SWeihang Li }; 8253ef4999SWeihang Li 83e088a685SYixian Liu struct hns_roce_ib_create_qp_resp { 8426b99066SJason Gunthorpe __aligned_u64 cap_flags; 850045e0d3SYixing Liu __aligned_u64 dwqe_mmap_key; 86e088a685SYixian Liu }; 87e088a685SYixian Liu 880c5e259bSLuoyouming enum { 890c5e259bSLuoyouming HNS_ROCE_EXSGE_FLAGS = 1 << 0, 902bb185c6SLuoyouming HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1, 91*1d918553SLuoyouming HNS_ROCE_CQE_INLINE_FLAGS = 1 << 2, 920c5e259bSLuoyouming }; 930c5e259bSLuoyouming 940c5e259bSLuoyouming enum { 950c5e259bSLuoyouming HNS_ROCE_RSP_EXSGE_FLAGS = 1 << 0, 962bb185c6SLuoyouming HNS_ROCE_RSP_RQ_INLINE_FLAGS = 1 << 1, 97*1d918553SLuoyouming HNS_ROCE_RSP_CQE_INLINE_FLAGS = 1 << 2, 980c5e259bSLuoyouming }; 990c5e259bSLuoyouming 1004d409958SLeon Romanovsky struct hns_roce_ib_alloc_ucontext_resp { 1014d409958SLeon Romanovsky __u32 qp_tab_size; 10209a5f210SWenpeng Liang __u32 cqe_size; 10332548870SWenpeng Liang __u32 srq_tab_size; 10432548870SWenpeng Liang __u32 reserved; 1050c5e259bSLuoyouming __u32 config; 1060c5e259bSLuoyouming __u32 max_inline_data; 1070c5e259bSLuoyouming }; 1080c5e259bSLuoyouming 1090c5e259bSLuoyouming struct hns_roce_ib_alloc_ucontext { 1100c5e259bSLuoyouming __u32 config; 1110c5e259bSLuoyouming __u32 reserved; 1124d409958SLeon Romanovsky }; 113633fb4d9SJason Gunthorpe 114633fb4d9SJason Gunthorpe struct hns_roce_ib_alloc_pd_resp { 115633fb4d9SJason Gunthorpe __u32 pdn; 116633fb4d9SJason Gunthorpe }; 117633fb4d9SJason Gunthorpe 1184d409958SLeon Romanovsky #endif /* HNS_ABI_USER_H */ 119