Path: blob/master/drivers/infiniband/hw/nes/nes_user.h
15112 views
/*1* Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.2* Copyright (c) 2005 Topspin Communications. All rights reserved.3* Copyright (c) 2005 Cisco Systems. All rights reserved.4* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.5*6* This software is available to you under a choice of one of two7* licenses. You may choose to be licensed under the terms of the GNU8* General Public License (GPL) Version 2, available from the file9* COPYING in the main directory of this source tree, or the10* OpenIB.org BSD license below:11*12* Redistribution and use in source and binary forms, with or13* without modification, are permitted provided that the following14* conditions are met:15*16* - Redistributions of source code must retain the above17* copyright notice, this list of conditions and the following18* disclaimer.19*20* - Redistributions in binary form must reproduce the above21* copyright notice, this list of conditions and the following22* disclaimer in the documentation and/or other materials23* provided with the distribution.24*25* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,26* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF27* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND28* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS29* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN30* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN31* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE32* SOFTWARE.33*34*/3536#ifndef NES_USER_H37#define NES_USER_H3839#include <linux/types.h>4041#define NES_ABI_USERSPACE_VER 142#define NES_ABI_KERNEL_VER 14344/*45* Make sure that all structs defined in this file remain laid out so46* that they pack the same way on 32-bit and 64-bit architectures (to47* avoid incompatibility between 32-bit userspace and 64-bit kernels).48* In particular do not use pointer types -- pass pointers in __u6449* instead.50*/5152struct nes_alloc_ucontext_req {53__u32 reserved32;54__u8 userspace_ver;55__u8 reserved8[3];56};5758struct nes_alloc_ucontext_resp {59__u32 max_pds; /* maximum pds allowed for this user process */60__u32 max_qps; /* maximum qps allowed for this user process */61__u32 wq_size; /* size of the WQs (sq+rq) allocated to the mmaped area */62__u8 virtwq; /* flag to indicate if virtual WQ are to be used or not */63__u8 kernel_ver;64__u8 reserved[2];65};6667struct nes_alloc_pd_resp {68__u32 pd_id;69__u32 mmap_db_index;70};7172struct nes_create_cq_req {73__u64 user_cq_buffer;74__u32 mcrqf;75__u8 reserved[4];76};7778struct nes_create_qp_req {79__u64 user_wqe_buffers;80};8182enum iwnes_memreg_type {83IWNES_MEMREG_TYPE_MEM = 0x0000,84IWNES_MEMREG_TYPE_QP = 0x0001,85IWNES_MEMREG_TYPE_CQ = 0x0002,86IWNES_MEMREG_TYPE_MW = 0x0003,87IWNES_MEMREG_TYPE_FMR = 0x0004,88IWNES_MEMREG_TYPE_FMEM = 0x0005,89};9091struct nes_mem_reg_req {92__u32 reg_type; /* indicates if id is memory, QP or CQ */93__u32 reserved;94};9596struct nes_create_cq_resp {97__u32 cq_id;98__u32 cq_size;99__u32 mmap_db_index;100__u32 reserved;101};102103struct nes_create_qp_resp {104__u32 qp_id;105__u32 actual_sq_size;106__u32 actual_rq_size;107__u32 mmap_sq_db_index;108__u32 mmap_rq_db_index;109__u32 nes_drv_opt;110};111112#endif /* NES_USER_H */113114115