162306a36Sopenharmony_ci/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2016 Hisilicon Limited. 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * This software is available to you under a choice of one of two 662306a36Sopenharmony_ci * licenses. You may choose to be licensed under the terms of the GNU 762306a36Sopenharmony_ci * General Public License (GPL) Version 2, available from the file 862306a36Sopenharmony_ci * COPYING in the main directory of this source tree, or the 962306a36Sopenharmony_ci * OpenIB.org BSD license below: 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * Redistribution and use in source and binary forms, with or 1262306a36Sopenharmony_ci * without modification, are permitted provided that the following 1362306a36Sopenharmony_ci * conditions are met: 1462306a36Sopenharmony_ci * 1562306a36Sopenharmony_ci * - Redistributions of source code must retain the above 1662306a36Sopenharmony_ci * copyright notice, this list of conditions and the following 1762306a36Sopenharmony_ci * disclaimer. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * - Redistributions in binary form must reproduce the above 2062306a36Sopenharmony_ci * copyright notice, this list of conditions and the following 2162306a36Sopenharmony_ci * disclaimer in the documentation and/or other materials 2262306a36Sopenharmony_ci * provided with the distribution. 2362306a36Sopenharmony_ci * 2462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 2562306a36Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 2662306a36Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 2762306a36Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 2862306a36Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 2962306a36Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 3062306a36Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 3162306a36Sopenharmony_ci * SOFTWARE. 3262306a36Sopenharmony_ci */ 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#ifndef HNS_ABI_USER_H 3562306a36Sopenharmony_ci#define HNS_ABI_USER_H 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#include <linux/types.h> 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_cistruct hns_roce_ib_create_cq { 4062306a36Sopenharmony_ci __aligned_u64 buf_addr; 4162306a36Sopenharmony_ci __aligned_u64 db_addr; 4262306a36Sopenharmony_ci __u32 cqe_size; 4362306a36Sopenharmony_ci __u32 reserved; 4462306a36Sopenharmony_ci}; 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_cienum hns_roce_cq_cap_flags { 4762306a36Sopenharmony_ci HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0, 4862306a36Sopenharmony_ci}; 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_cistruct hns_roce_ib_create_cq_resp { 5162306a36Sopenharmony_ci __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */ 5262306a36Sopenharmony_ci __aligned_u64 cap_flags; 5362306a36Sopenharmony_ci}; 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_cistruct hns_roce_ib_create_srq { 5662306a36Sopenharmony_ci __aligned_u64 buf_addr; 5762306a36Sopenharmony_ci __aligned_u64 db_addr; 5862306a36Sopenharmony_ci __aligned_u64 que_addr; 5962306a36Sopenharmony_ci}; 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_cistruct hns_roce_ib_create_srq_resp { 6262306a36Sopenharmony_ci __u32 srqn; 6362306a36Sopenharmony_ci __u32 reserved; 6462306a36Sopenharmony_ci}; 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_cistruct hns_roce_ib_create_qp { 6762306a36Sopenharmony_ci __aligned_u64 buf_addr; 6862306a36Sopenharmony_ci __aligned_u64 db_addr; 6962306a36Sopenharmony_ci __u8 log_sq_bb_count; 7062306a36Sopenharmony_ci __u8 log_sq_stride; 7162306a36Sopenharmony_ci __u8 sq_no_prefetch; 7262306a36Sopenharmony_ci __u8 reserved[5]; 7362306a36Sopenharmony_ci __aligned_u64 sdb_addr; 7462306a36Sopenharmony_ci}; 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_cienum hns_roce_qp_cap_flags { 7762306a36Sopenharmony_ci HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0, 7862306a36Sopenharmony_ci HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1, 7962306a36Sopenharmony_ci HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2, 8062306a36Sopenharmony_ci HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5, 8162306a36Sopenharmony_ci}; 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_cistruct hns_roce_ib_create_qp_resp { 8462306a36Sopenharmony_ci __aligned_u64 cap_flags; 8562306a36Sopenharmony_ci __aligned_u64 dwqe_mmap_key; 8662306a36Sopenharmony_ci}; 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_cienum { 8962306a36Sopenharmony_ci HNS_ROCE_EXSGE_FLAGS = 1 << 0, 9062306a36Sopenharmony_ci HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1, 9162306a36Sopenharmony_ci HNS_ROCE_CQE_INLINE_FLAGS = 1 << 2, 9262306a36Sopenharmony_ci}; 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_cienum { 9562306a36Sopenharmony_ci HNS_ROCE_RSP_EXSGE_FLAGS = 1 << 0, 9662306a36Sopenharmony_ci HNS_ROCE_RSP_RQ_INLINE_FLAGS = 1 << 1, 9762306a36Sopenharmony_ci HNS_ROCE_RSP_CQE_INLINE_FLAGS = 1 << 2, 9862306a36Sopenharmony_ci}; 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_cistruct hns_roce_ib_alloc_ucontext_resp { 10162306a36Sopenharmony_ci __u32 qp_tab_size; 10262306a36Sopenharmony_ci __u32 cqe_size; 10362306a36Sopenharmony_ci __u32 srq_tab_size; 10462306a36Sopenharmony_ci __u32 reserved; 10562306a36Sopenharmony_ci __u32 config; 10662306a36Sopenharmony_ci __u32 max_inline_data; 10762306a36Sopenharmony_ci}; 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_cistruct hns_roce_ib_alloc_ucontext { 11062306a36Sopenharmony_ci __u32 config; 11162306a36Sopenharmony_ci __u32 reserved; 11262306a36Sopenharmony_ci}; 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_cistruct hns_roce_ib_alloc_pd_resp { 11562306a36Sopenharmony_ci __u32 pdn; 11662306a36Sopenharmony_ci}; 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci#endif /* HNS_ABI_USER_H */ 119