18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2005 Topspin Communications.  All rights reserved.
48c2ecf20Sopenharmony_ci * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This software is available to you under a choice of one of two
78c2ecf20Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
88c2ecf20Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
98c2ecf20Sopenharmony_ci * COPYING in the main directory of this source tree, or the
108c2ecf20Sopenharmony_ci * OpenIB.org BSD license below:
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
138c2ecf20Sopenharmony_ci *     without modification, are permitted provided that the following
148c2ecf20Sopenharmony_ci *     conditions are met:
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci *      - Redistributions of source code must retain the above
178c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
188c2ecf20Sopenharmony_ci *        disclaimer.
198c2ecf20Sopenharmony_ci *
208c2ecf20Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
218c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
228c2ecf20Sopenharmony_ci *        disclaimer in the documentation and/or other materials
238c2ecf20Sopenharmony_ci *        provided with the distribution.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
268c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
278c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
288c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
298c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
308c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
318c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
328c2ecf20Sopenharmony_ci * SOFTWARE.
338c2ecf20Sopenharmony_ci */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#ifndef MTHCA_ABI_USER_H
368c2ecf20Sopenharmony_ci#define MTHCA_ABI_USER_H
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#include <linux/types.h>
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/*
418c2ecf20Sopenharmony_ci * Increment this value if any changes that break userspace ABI
428c2ecf20Sopenharmony_ci * compatibility are made.
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_ci#define MTHCA_UVERBS_ABI_VERSION	1
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/*
478c2ecf20Sopenharmony_ci * Make sure that all structs defined in this file remain laid out so
488c2ecf20Sopenharmony_ci * that they pack the same way on 32-bit and 64-bit architectures (to
498c2ecf20Sopenharmony_ci * avoid incompatibility between 32-bit userspace and 64-bit kernels).
508c2ecf20Sopenharmony_ci * In particular do not use pointer types -- pass pointers in __u64
518c2ecf20Sopenharmony_ci * instead.
528c2ecf20Sopenharmony_ci */
538c2ecf20Sopenharmony_cistruct mthca_alloc_ucontext_resp {
548c2ecf20Sopenharmony_ci	__u32 qp_tab_size;
558c2ecf20Sopenharmony_ci	__u32 uarc_size;
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_cistruct mthca_alloc_pd_resp {
598c2ecf20Sopenharmony_ci	__u32 pdn;
608c2ecf20Sopenharmony_ci	__u32 reserved;
618c2ecf20Sopenharmony_ci};
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci/*
648c2ecf20Sopenharmony_ci * Mark the memory region with a DMA attribute that causes
658c2ecf20Sopenharmony_ci * in-flight DMA to be flushed when the region is written to:
668c2ecf20Sopenharmony_ci */
678c2ecf20Sopenharmony_ci#define MTHCA_MR_DMASYNC	0x1
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cistruct mthca_reg_mr {
708c2ecf20Sopenharmony_ci	__u32 mr_attrs;
718c2ecf20Sopenharmony_ci	__u32 reserved;
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_cistruct mthca_create_cq {
758c2ecf20Sopenharmony_ci	__u32 lkey;
768c2ecf20Sopenharmony_ci	__u32 pdn;
778c2ecf20Sopenharmony_ci	__aligned_u64 arm_db_page;
788c2ecf20Sopenharmony_ci	__aligned_u64 set_db_page;
798c2ecf20Sopenharmony_ci	__u32 arm_db_index;
808c2ecf20Sopenharmony_ci	__u32 set_db_index;
818c2ecf20Sopenharmony_ci};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cistruct mthca_create_cq_resp {
848c2ecf20Sopenharmony_ci	__u32 cqn;
858c2ecf20Sopenharmony_ci	__u32 reserved;
868c2ecf20Sopenharmony_ci};
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_cistruct mthca_resize_cq {
898c2ecf20Sopenharmony_ci	__u32 lkey;
908c2ecf20Sopenharmony_ci	__u32 reserved;
918c2ecf20Sopenharmony_ci};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_cistruct mthca_create_srq {
948c2ecf20Sopenharmony_ci	__u32 lkey;
958c2ecf20Sopenharmony_ci	__u32 db_index;
968c2ecf20Sopenharmony_ci	__aligned_u64 db_page;
978c2ecf20Sopenharmony_ci};
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_cistruct mthca_create_srq_resp {
1008c2ecf20Sopenharmony_ci	__u32 srqn;
1018c2ecf20Sopenharmony_ci	__u32 reserved;
1028c2ecf20Sopenharmony_ci};
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_cistruct mthca_create_qp {
1058c2ecf20Sopenharmony_ci	__u32 lkey;
1068c2ecf20Sopenharmony_ci	__u32 reserved;
1078c2ecf20Sopenharmony_ci	__aligned_u64 sq_db_page;
1088c2ecf20Sopenharmony_ci	__aligned_u64 rq_db_page;
1098c2ecf20Sopenharmony_ci	__u32 sq_db_index;
1108c2ecf20Sopenharmony_ci	__u32 rq_db_index;
1118c2ecf20Sopenharmony_ci};
1128c2ecf20Sopenharmony_ci#endif /* MTHCA_ABI_USER_H */
113