Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
0002 /*
0003  * Copyright (c) 2016 Hisilicon Limited.
0004  *
0005  * This software is available to you under a choice of one of two
0006  * licenses.  You may choose to be licensed under the terms of the GNU
0007  * General Public License (GPL) Version 2, available from the file
0008  * COPYING in the main directory of this source tree, or the
0009  * OpenIB.org BSD license below:
0010  *
0011  *     Redistribution and use in source and binary forms, with or
0012  *     without modification, are permitted provided that the following
0013  *     conditions are met:
0014  *
0015  *      - Redistributions of source code must retain the above
0016  *        copyright notice, this list of conditions and the following
0017  *        disclaimer.
0018  *
0019  *      - Redistributions in binary form must reproduce the above
0020  *        copyright notice, this list of conditions and the following
0021  *        disclaimer in the documentation and/or other materials
0022  *        provided with the distribution.
0023  *
0024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0025  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0026  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0027  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0028  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0029  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0030  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0031  * SOFTWARE.
0032  */
0033 
0034 #ifndef HNS_ABI_USER_H
0035 #define HNS_ABI_USER_H
0036 
0037 #include <linux/types.h>
0038 
0039 struct hns_roce_ib_create_cq {
0040     __aligned_u64 buf_addr;
0041     __aligned_u64 db_addr;
0042     __u32 cqe_size;
0043     __u32 reserved;
0044 };
0045 
0046 enum hns_roce_cq_cap_flags {
0047     HNS_ROCE_CQ_FLAG_RECORD_DB = 1 << 0,
0048 };
0049 
0050 struct hns_roce_ib_create_cq_resp {
0051     __aligned_u64 cqn; /* Only 32 bits used, 64 for compat */
0052     __aligned_u64 cap_flags;
0053 };
0054 
0055 struct hns_roce_ib_create_srq {
0056     __aligned_u64 buf_addr;
0057     __aligned_u64 db_addr;
0058     __aligned_u64 que_addr;
0059 };
0060 
0061 struct hns_roce_ib_create_srq_resp {
0062     __u32   srqn;
0063     __u32   reserved;
0064 };
0065 
0066 struct hns_roce_ib_create_qp {
0067     __aligned_u64 buf_addr;
0068     __aligned_u64 db_addr;
0069     __u8    log_sq_bb_count;
0070     __u8    log_sq_stride;
0071     __u8    sq_no_prefetch;
0072     __u8    reserved[5];
0073     __aligned_u64 sdb_addr;
0074 };
0075 
0076 enum hns_roce_qp_cap_flags {
0077     HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
0078     HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
0079     HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
0080     HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5,
0081 };
0082 
0083 struct hns_roce_ib_create_qp_resp {
0084     __aligned_u64 cap_flags;
0085     __aligned_u64 dwqe_mmap_key;
0086 };
0087 
0088 struct hns_roce_ib_alloc_ucontext_resp {
0089     __u32   qp_tab_size;
0090     __u32   cqe_size;
0091     __u32   srq_tab_size;
0092     __u32   reserved;
0093 };
0094 
0095 struct hns_roce_ib_alloc_pd_resp {
0096     __u32 pdn;
0097 };
0098 
0099 #endif /* HNS_ABI_USER_H */