xref: /openbmc/linux/include/uapi/rdma/cxgb4-abi.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1d50e14abSJason Gunthorpe /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
2e44ee2fdSLeon Romanovsky /*
3e44ee2fdSLeon Romanovsky  * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved.
4e44ee2fdSLeon Romanovsky  *
5e44ee2fdSLeon Romanovsky  * This software is available to you under a choice of one of two
6e44ee2fdSLeon Romanovsky  * licenses.  You may choose to be licensed under the terms of the GNU
7e44ee2fdSLeon Romanovsky  * General Public License (GPL) Version 2, available from the file
8e44ee2fdSLeon Romanovsky  * COPYING in the main directory of this source tree, or the
9e44ee2fdSLeon Romanovsky  * OpenIB.org BSD license below:
10e44ee2fdSLeon Romanovsky  *
11e44ee2fdSLeon Romanovsky  *     Redistribution and use in source and binary forms, with or
12e44ee2fdSLeon Romanovsky  *     without modification, are permitted provided that the following
13e44ee2fdSLeon Romanovsky  *     conditions are met:
14e44ee2fdSLeon Romanovsky  *
15e44ee2fdSLeon Romanovsky  *      - Redistributions of source code must retain the above
16e44ee2fdSLeon Romanovsky  *        copyright notice, this list of conditions and the following
17e44ee2fdSLeon Romanovsky  *        disclaimer.
18e44ee2fdSLeon Romanovsky  *
19e44ee2fdSLeon Romanovsky  *      - Redistributions in binary form must reproduce the above
20e44ee2fdSLeon Romanovsky  *        copyright notice, this list of conditions and the following
21e44ee2fdSLeon Romanovsky  *        disclaimer in the documentation and/or other materials
22e44ee2fdSLeon Romanovsky  *        provided with the distribution.
23e44ee2fdSLeon Romanovsky  *
24e44ee2fdSLeon Romanovsky  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25e44ee2fdSLeon Romanovsky  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26e44ee2fdSLeon Romanovsky  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27e44ee2fdSLeon Romanovsky  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28e44ee2fdSLeon Romanovsky  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29e44ee2fdSLeon Romanovsky  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30e44ee2fdSLeon Romanovsky  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31e44ee2fdSLeon Romanovsky  * SOFTWARE.
32e44ee2fdSLeon Romanovsky  */
33e44ee2fdSLeon Romanovsky #ifndef CXGB4_ABI_USER_H
34e44ee2fdSLeon Romanovsky #define CXGB4_ABI_USER_H
35e44ee2fdSLeon Romanovsky 
36e44ee2fdSLeon Romanovsky #include <linux/types.h>
37e44ee2fdSLeon Romanovsky 
38e44ee2fdSLeon Romanovsky #define C4IW_UVERBS_ABI_VERSION	3
39e44ee2fdSLeon Romanovsky 
40e44ee2fdSLeon Romanovsky /*
41e44ee2fdSLeon Romanovsky  * Make sure that all structs defined in this file remain laid out so
42e44ee2fdSLeon Romanovsky  * that they pack the same way on 32-bit and 64-bit architectures (to
43e44ee2fdSLeon Romanovsky  * avoid incompatibility between 32-bit userspace and 64-bit kernels).
4426b99066SJason Gunthorpe  * In particular do not use pointer types -- pass pointers in __aligned_u64
45e44ee2fdSLeon Romanovsky  * instead.
46e44ee2fdSLeon Romanovsky  */
4765ca8d96SRaju Rangoju 
4865ca8d96SRaju Rangoju enum {
4965ca8d96SRaju Rangoju 	C4IW_64B_CQE = (1 << 0)
5065ca8d96SRaju Rangoju };
5165ca8d96SRaju Rangoju 
5265ca8d96SRaju Rangoju struct c4iw_create_cq {
5365ca8d96SRaju Rangoju 	__u32 flags;
5465ca8d96SRaju Rangoju 	__u32 reserved;
5565ca8d96SRaju Rangoju };
5665ca8d96SRaju Rangoju 
57e44ee2fdSLeon Romanovsky struct c4iw_create_cq_resp {
5826b99066SJason Gunthorpe 	__aligned_u64 key;
5926b99066SJason Gunthorpe 	__aligned_u64 gts_key;
6026b99066SJason Gunthorpe 	__aligned_u64 memsize;
61e44ee2fdSLeon Romanovsky 	__u32 cqid;
62e44ee2fdSLeon Romanovsky 	__u32 size;
63e44ee2fdSLeon Romanovsky 	__u32 qid_mask;
6465ca8d96SRaju Rangoju 	__u32 flags;
65e44ee2fdSLeon Romanovsky };
66e44ee2fdSLeon Romanovsky 
67e44ee2fdSLeon Romanovsky enum {
68*b9855f4cSPotnuri Bharat Teja 	C4IW_QPF_ONCHIP	= (1 << 0),
69*b9855f4cSPotnuri Bharat Teja 	C4IW_QPF_WRITE_W_IMM = (1 << 1)
70e44ee2fdSLeon Romanovsky };
71e44ee2fdSLeon Romanovsky 
72e44ee2fdSLeon Romanovsky struct c4iw_create_qp_resp {
7326b99066SJason Gunthorpe 	__aligned_u64 ma_sync_key;
7426b99066SJason Gunthorpe 	__aligned_u64 sq_key;
7526b99066SJason Gunthorpe 	__aligned_u64 rq_key;
7626b99066SJason Gunthorpe 	__aligned_u64 sq_db_gts_key;
7726b99066SJason Gunthorpe 	__aligned_u64 rq_db_gts_key;
7826b99066SJason Gunthorpe 	__aligned_u64 sq_memsize;
7926b99066SJason Gunthorpe 	__aligned_u64 rq_memsize;
80e44ee2fdSLeon Romanovsky 	__u32 sqid;
81e44ee2fdSLeon Romanovsky 	__u32 rqid;
82e44ee2fdSLeon Romanovsky 	__u32 sq_size;
83e44ee2fdSLeon Romanovsky 	__u32 rq_size;
84e44ee2fdSLeon Romanovsky 	__u32 qid_mask;
85e44ee2fdSLeon Romanovsky 	__u32 flags;
86e44ee2fdSLeon Romanovsky };
87e44ee2fdSLeon Romanovsky 
887fc7a7cfSRaju Rangoju struct c4iw_create_srq_resp {
897fc7a7cfSRaju Rangoju 	__aligned_u64 srq_key;
907fc7a7cfSRaju Rangoju 	__aligned_u64 srq_db_gts_key;
917fc7a7cfSRaju Rangoju 	__aligned_u64 srq_memsize;
927fc7a7cfSRaju Rangoju 	__u32 srqid;
937fc7a7cfSRaju Rangoju 	__u32 srq_size;
947fc7a7cfSRaju Rangoju 	__u32 rqt_abs_idx;
957fc7a7cfSRaju Rangoju 	__u32 qid_mask;
967fc7a7cfSRaju Rangoju 	__u32 flags;
977fc7a7cfSRaju Rangoju 	__u32 reserved; /* explicit padding */
987fc7a7cfSRaju Rangoju };
997fc7a7cfSRaju Rangoju 
1007fc7a7cfSRaju Rangoju enum {
1017fc7a7cfSRaju Rangoju 	/* HW supports SRQ_LIMIT_REACHED event */
1027fc7a7cfSRaju Rangoju 	T4_SRQ_LIMIT_SUPPORT = 1 << 0,
1037fc7a7cfSRaju Rangoju };
1047fc7a7cfSRaju Rangoju 
105e44ee2fdSLeon Romanovsky struct c4iw_alloc_ucontext_resp {
10626b99066SJason Gunthorpe 	__aligned_u64 status_page_key;
107e44ee2fdSLeon Romanovsky 	__u32 status_page_size;
108e44ee2fdSLeon Romanovsky 	__u32 reserved; /* explicit padding (optional for i386) */
109e44ee2fdSLeon Romanovsky };
1107f86260bSJason Gunthorpe 
1117f86260bSJason Gunthorpe struct c4iw_alloc_pd_resp {
1127f86260bSJason Gunthorpe 	__u32 pdid;
1137f86260bSJason Gunthorpe };
1147f86260bSJason Gunthorpe 
115e44ee2fdSLeon Romanovsky #endif /* CXGB4_ABI_USER_H */
116