/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */1/* QLogic qedr NIC Driver2* Copyright (c) 2015-2016 QLogic Corporation3*4* This software is available to you under a choice of one of two5* licenses. You may choose to be licensed under the terms of the GNU6* General Public License (GPL) Version 2, available from the file7* COPYING in the main directory of this source tree, or the8* OpenIB.org BSD license below:9*10* Redistribution and use in source and binary forms, with or11* without modification, are permitted provided that the following12* conditions are met:13*14* - Redistributions of source code must retain the above15* copyright notice, this list of conditions and the following16* disclaimer.17*18* - Redistributions in binary form must reproduce the above19* copyright notice, this list of conditions and the following20* disclaimer in the documentation and /or other materials21* provided with the distribution.22*23* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,24* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF25* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND26* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS27* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN28* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN29* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE30* SOFTWARE.31*/32#ifndef __QEDR_USER_H__33#define __QEDR_USER_H__3435#include <linux/types.h>3637#define QEDR_ABI_VERSION (8)3839/* user kernel communication data structures. */40enum qedr_alloc_ucontext_flags {41QEDR_ALLOC_UCTX_EDPM_MODE = 1 << 0,42QEDR_ALLOC_UCTX_DB_REC = 1 << 1,43QEDR_SUPPORT_DPM_SIZES = 1 << 2,44};4546struct qedr_alloc_ucontext_req {47__u32 context_flags;48__u32 reserved;49};5051#define QEDR_LDPM_MAX_SIZE (8192)52#define QEDR_EDPM_TRANS_SIZE (64)53#define QEDR_EDPM_MAX_SIZE (ROCE_REQ_MAX_INLINE_DATA_SIZE)5455enum qedr_rdma_dpm_type {56QEDR_DPM_TYPE_NONE = 0,57QEDR_DPM_TYPE_ROCE_ENHANCED = 1 << 0,58QEDR_DPM_TYPE_ROCE_LEGACY = 1 << 1,59QEDR_DPM_TYPE_IWARP_LEGACY = 1 << 2,60QEDR_DPM_TYPE_ROCE_EDPM_MODE = 1 << 3,61QEDR_DPM_SIZES_SET = 1 << 4,62};6364struct qedr_alloc_ucontext_resp {65__aligned_u64 db_pa;66__u32 db_size;6768__u32 max_send_wr;69__u32 max_recv_wr;70__u32 max_srq_wr;71__u32 sges_per_send_wr;72__u32 sges_per_recv_wr;73__u32 sges_per_srq_wr;74__u32 max_cqes;75__u8 dpm_flags;76__u8 wids_enabled;77__u16 wid_count;78__u16 ldpm_limit_size;79__u8 edpm_trans_size;80__u8 reserved;81__u16 edpm_limit_size;82__u8 padding[6];83};8485struct qedr_alloc_pd_ureq {86__aligned_u64 rsvd1;87};8889struct qedr_alloc_pd_uresp {90__u32 pd_id;91__u32 reserved;92};9394struct qedr_create_cq_ureq {95__aligned_u64 addr;96__aligned_u64 len;97};9899struct qedr_create_cq_uresp {100__u32 db_offset;101__u16 icid;102__u16 reserved;103__aligned_u64 db_rec_addr;104};105106struct qedr_create_qp_ureq {107__u32 qp_handle_hi;108__u32 qp_handle_lo;109110/* SQ */111/* user space virtual address of SQ buffer */112__aligned_u64 sq_addr;113114/* length of SQ buffer */115__aligned_u64 sq_len;116117/* RQ */118/* user space virtual address of RQ buffer */119__aligned_u64 rq_addr;120121/* length of RQ buffer */122__aligned_u64 rq_len;123};124125struct qedr_create_qp_uresp {126__u32 qp_id;127__u32 atomic_supported;128129/* SQ */130__u32 sq_db_offset;131__u16 sq_icid;132133/* RQ */134__u32 rq_db_offset;135__u16 rq_icid;136137__u32 rq_db2_offset;138__u32 reserved;139140/* address of SQ doorbell recovery user entry */141__aligned_u64 sq_db_rec_addr;142143/* address of RQ doorbell recovery user entry */144__aligned_u64 rq_db_rec_addr;145146};147148struct qedr_create_srq_ureq {149/* user space virtual address of producer pair */150__aligned_u64 prod_pair_addr;151152/* user space virtual address of SRQ buffer */153__aligned_u64 srq_addr;154155/* length of SRQ buffer */156__aligned_u64 srq_len;157};158159struct qedr_create_srq_uresp {160__u16 srq_id;161__u16 reserved0;162__u32 reserved1;163};164165/* doorbell recovery entry allocated and populated by userspace doorbelling166* entities and mapped to kernel. Kernel uses this to register doorbell167* information with doorbell drop recovery mechanism.168*/169struct qedr_user_db_rec {170__aligned_u64 db_data; /* doorbell data */171};172173#endif /* __QEDR_USER_H__ */174175176