Back to home page

OSCL-LXR

 
 

    


0001 /* This file is part of the Emulex RoCE Device Driver for
0002  * RoCE (RDMA over Converged Ethernet) adapters.
0003  * Copyright (C) 2012-2015 Emulex. All rights reserved.
0004  * EMULEX and SLI are trademarks of Emulex.
0005  * www.emulex.com
0006  *
0007  * This software is available to you under a choice of one of two licenses.
0008  * You may choose to be licensed under the terms of the GNU General Public
0009  * License (GPL) Version 2, available from the file COPYING in the main
0010  * directory of this source tree, or the BSD license below:
0011  *
0012  * Redistribution and use in source and binary forms, with or without
0013  * modification, are permitted provided that the following conditions
0014  * are met:
0015  *
0016  * - Redistributions of source code must retain the above copyright notice,
0017  *   this list of conditions and the following disclaimer.
0018  *
0019  * - Redistributions in binary form must reproduce the above copyright
0020  *   notice, this list of conditions and the following disclaimer in
0021  *   the documentation and/or other materials provided with the distribution.
0022  *
0023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
0025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
0027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
0030  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0031  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
0032  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
0033  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0034  *
0035  * Contact Information:
0036  * linux-drivers@emulex.com
0037  *
0038  * Emulex
0039  * 3333 Susan Street
0040  * Costa Mesa, CA 92626
0041  */
0042 
0043 #ifndef __OCRDMA_VERBS_H__
0044 #define __OCRDMA_VERBS_H__
0045 
0046 int ocrdma_post_send(struct ib_qp *, const struct ib_send_wr *,
0047              const struct ib_send_wr **bad_wr);
0048 int ocrdma_post_recv(struct ib_qp *, const struct ib_recv_wr *,
0049              const struct ib_recv_wr **bad_wr);
0050 
0051 int ocrdma_poll_cq(struct ib_cq *, int num_entries, struct ib_wc *wc);
0052 int ocrdma_arm_cq(struct ib_cq *, enum ib_cq_notify_flags flags);
0053 
0054 int ocrdma_query_device(struct ib_device *, struct ib_device_attr *props,
0055             struct ib_udata *uhw);
0056 int ocrdma_query_port(struct ib_device *ibdev, u32 port,
0057               struct ib_port_attr *props);
0058 
0059 enum rdma_protocol_type
0060 ocrdma_query_protocol(struct ib_device *device, u32 port_num);
0061 
0062 int ocrdma_query_pkey(struct ib_device *ibdev, u32 port, u16 index, u16 *pkey);
0063 
0064 int ocrdma_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata);
0065 void ocrdma_dealloc_ucontext(struct ib_ucontext *uctx);
0066 
0067 int ocrdma_mmap(struct ib_ucontext *, struct vm_area_struct *vma);
0068 
0069 int ocrdma_alloc_pd(struct ib_pd *pd, struct ib_udata *udata);
0070 int ocrdma_dealloc_pd(struct ib_pd *pd, struct ib_udata *udata);
0071 
0072 int ocrdma_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
0073              struct ib_udata *udata);
0074 int ocrdma_resize_cq(struct ib_cq *, int cqe, struct ib_udata *);
0075 int ocrdma_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata);
0076 
0077 int ocrdma_create_qp(struct ib_qp *qp, struct ib_qp_init_attr *attrs,
0078              struct ib_udata *udata);
0079 int _ocrdma_modify_qp(struct ib_qp *, struct ib_qp_attr *attr,
0080               int attr_mask);
0081 int ocrdma_modify_qp(struct ib_qp *, struct ib_qp_attr *attr,
0082              int attr_mask, struct ib_udata *udata);
0083 int ocrdma_query_qp(struct ib_qp *,
0084             struct ib_qp_attr *qp_attr,
0085             int qp_attr_mask, struct ib_qp_init_attr *);
0086 int ocrdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata);
0087 void ocrdma_del_flush_qp(struct ocrdma_qp *qp);
0088 
0089 int ocrdma_create_srq(struct ib_srq *srq, struct ib_srq_init_attr *attr,
0090               struct ib_udata *udata);
0091 int ocrdma_modify_srq(struct ib_srq *, struct ib_srq_attr *,
0092               enum ib_srq_attr_mask, struct ib_udata *);
0093 int ocrdma_query_srq(struct ib_srq *, struct ib_srq_attr *);
0094 int ocrdma_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata);
0095 int ocrdma_post_srq_recv(struct ib_srq *, const struct ib_recv_wr *,
0096              const struct ib_recv_wr **bad_recv_wr);
0097 
0098 int ocrdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata);
0099 struct ib_mr *ocrdma_get_dma_mr(struct ib_pd *, int acc);
0100 struct ib_mr *ocrdma_reg_user_mr(struct ib_pd *, u64 start, u64 length,
0101                  u64 virt, int acc, struct ib_udata *);
0102 struct ib_mr *ocrdma_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
0103                   u32 max_num_sg);
0104 int ocrdma_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents,
0105              unsigned int *sg_offset);
0106 
0107 #endif              /* __OCRDMA_VERBS_H__ */