1fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit/******************************************************************* 2fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * This file is part of the Emulex RoCE Device Driver for * 3fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * RoCE (RDMA over Converged Ethernet) adapters. * 4fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * Copyright (C) 2008-2012 Emulex. All rights reserved. * 5fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * EMULEX and SLI are trademarks of Emulex. * 6fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * www.emulex.com * 7fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * * 8fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * This program is free software; you can redistribute it and/or * 9fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * modify it under the terms of version 2 of the GNU General * 10fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * Public License as published by the Free Software Foundation. * 11fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * This program is distributed in the hope that it will be useful. * 12fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * 13fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * 14fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * 15fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * 16fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * TO BE LEGALLY INVALID. See the GNU General Public License for * 17fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * more details, a copy of which can be found in the file COPYING * 18fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * included with this package. * 19fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * 20fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * Contact Information: 21fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * linux-drivers@emulex.com 22fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * 23fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * Emulex 24fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * 3333 Susan Street 25fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit * Costa Mesa, CA 92626 26fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit *******************************************************************/ 27fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 28fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit#ifndef __OCRDMA_VERBS_H__ 29fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit#define __OCRDMA_VERBS_H__ 30fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 31fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_post_send(struct ib_qp *, struct ib_send_wr *, 32fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_send_wr **bad_wr); 33fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_post_recv(struct ib_qp *, struct ib_recv_wr *, 34fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_recv_wr **bad_wr); 35fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 36fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_poll_cq(struct ib_cq *, int num_entries, struct ib_wc *wc); 37fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_arm_cq(struct ib_cq *, enum ib_cq_notify_flags flags); 38fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 39fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_device(struct ib_device *, struct ib_device_attr *props); 40fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_port(struct ib_device *, u8 port, struct ib_port_attr *props); 41fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_modify_port(struct ib_device *, u8 port, int mask, 42fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_port_modify *props); 43fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 44fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditvoid ocrdma_get_guid(struct ocrdma_dev *, u8 *guid); 45fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_gid(struct ib_device *, u8 port, 46fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit int index, union ib_gid *gid); 47fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_pkey(struct ib_device *, u8 port, u16 index, u16 *pkey); 48fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 49fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_ucontext *ocrdma_alloc_ucontext(struct ib_device *, 50fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_udata *); 51fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_dealloc_ucontext(struct ib_ucontext *); 52fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 53fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_mmap(struct ib_ucontext *, struct vm_area_struct *vma); 54fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 55fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_pd *ocrdma_alloc_pd(struct ib_device *, 56fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_ucontext *, struct ib_udata *); 57fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_dealloc_pd(struct ib_pd *pd); 58fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 59fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_cq *ocrdma_create_cq(struct ib_device *, int entries, int vector, 60fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_ucontext *, struct ib_udata *); 61fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_resize_cq(struct ib_cq *, int cqe, struct ib_udata *); 62fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_destroy_cq(struct ib_cq *); 63fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 64fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_qp *ocrdma_create_qp(struct ib_pd *, 65fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_qp_init_attr *attrs, 66fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_udata *); 67fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint _ocrdma_modify_qp(struct ib_qp *, struct ib_qp_attr *attr, 68fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit int attr_mask); 69fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_modify_qp(struct ib_qp *, struct ib_qp_attr *attr, 70fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit int attr_mask, struct ib_udata *udata); 71fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_qp(struct ib_qp *, 72fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_qp_attr *qp_attr, 73fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit int qp_attr_mask, struct ib_qp_init_attr *); 74fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_destroy_qp(struct ib_qp *); 75f11220ee69f72cf08479f28fd494264ac6a9349bNaresh Gottumukkalavoid ocrdma_del_flush_qp(struct ocrdma_qp *qp); 76fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 77fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_srq *ocrdma_create_srq(struct ib_pd *, struct ib_srq_init_attr *, 78fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_udata *); 79fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_modify_srq(struct ib_srq *, struct ib_srq_attr *, 80fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit enum ib_srq_attr_mask, struct ib_udata *); 81fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_query_srq(struct ib_srq *, struct ib_srq_attr *); 82fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_destroy_srq(struct ib_srq *); 83fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_post_srq_recv(struct ib_srq *, struct ib_recv_wr *, 84fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_recv_wr **bad_recv_wr); 85fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 86fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditint ocrdma_dereg_mr(struct ib_mr *); 87fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_mr *ocrdma_get_dma_mr(struct ib_pd *, int acc); 88fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_mr *ocrdma_reg_kernel_mr(struct ib_pd *, 89fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit struct ib_phys_buf *buffer_list, 90fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit int num_phys_buf, int acc, u64 *iova_start); 91fe2caefcdf5869f308c102e3d64d40683bfad711Parav Panditstruct ib_mr *ocrdma_reg_user_mr(struct ib_pd *, u64 start, u64 length, 92fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit u64 virt, int acc, struct ib_udata *); 937c33880c3cb2cda816d4d64852c6a81018b9bc1fNaresh Gottumukkalastruct ib_mr *ocrdma_alloc_frmr(struct ib_pd *pd, int max_page_list_len); 947c33880c3cb2cda816d4d64852c6a81018b9bc1fNaresh Gottumukkalastruct ib_fast_reg_page_list *ocrdma_alloc_frmr_page_list(struct ib_device 957c33880c3cb2cda816d4d64852c6a81018b9bc1fNaresh Gottumukkala *ibdev, 967c33880c3cb2cda816d4d64852c6a81018b9bc1fNaresh Gottumukkala int page_list_len); 977c33880c3cb2cda816d4d64852c6a81018b9bc1fNaresh Gottumukkalavoid ocrdma_free_frmr_page_list(struct ib_fast_reg_page_list *page_list); 98fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit 99fe2caefcdf5869f308c102e3d64d40683bfad711Parav Pandit#endif /* __OCRDMA_VERBS_H__ */ 100