1 /*
2  * Copyright (c) 2014, Cisco Systems, Inc. All rights reserved.
3  *
4  * LICENSE_BEGIN
5  *
6  * This software is available to you under a choice of one of two
7  * licenses.  You may choose to be licensed under the terms of the GNU
8  * General Public License (GPL) Version 2, available from the file
9  * COPYING in the main directory of this source tree, or the
10  * BSD license below:
11  *
12  *     Redistribution and use in source and binary forms, with or
13  *     without modification, are permitted provided that the following
14  *     conditions are met:
15  *
16  *      - Redistributions of source code must retain the above
17  *        copyright notice, this list of conditions and the following
18  *        disclaimer.
19  *
20  *      - Redistributions in binary form must reproduce the above
21  *        copyright notice, this list of conditions and the following
22  *        disclaimer in the documentation and/or other materials
23  *        provided with the distribution.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  *
38  * LICENSE_END
39  *
40  *
41  */
42 
43 #ifndef _USD_IB_CMD_
44 #define _USD_IB_CMD_
45 
46 #include "usd.h"
47 
48 int usd_ib_cmd_get_context(struct usd_context *uctx);
49 int usd_ib_cmd_alloc_pd(struct usd_device *dev, uint32_t * pd_handle_o);
50 int usd_ib_cmd_reg_mr(struct usd_device *dev, void *vaddr, size_t length,
51                       struct usd_mr *mr);
52 int usd_ib_cmd_dereg_mr(struct usd_device *dev, struct usd_mr *mr);
53 int usd_ib_cmd_create_cq(struct usd_device *dev, struct usd_cq_impl *cq,
54                         void *ibv_cq, int comp_channel, int comp_vector);
55 int usd_ib_cmd_destroy_cq(struct usd_device *dev, struct usd_cq_impl *cq);
56 int usd_ib_cmd_create_qp(struct usd_device *dev, struct usd_qp_impl *qp,
57                          struct usd_vf_info *vfip);
58 int usd_ib_cmd_modify_qp(struct usd_device *dev, struct usd_qp_impl *qp,
59                          int state);
60 int usd_ib_cmd_destroy_qp(struct usd_device *dev, struct usd_qp_impl *qp);
61 
62 int usd_ib_query_dev(struct usd_device *dev);
63 int usd_ib_cmd_devcmd(struct usd_device *dev, enum vnic_devcmd_cmd devcmd,
64                         u64 *a0, u64 *a1, int wait);
65 
66 int usd_ib_cmd_create_comp_channel(struct usd_device *dev, int *comp_fd_o);
67 int usd_ib_cmd_destroy_comp_channel(struct usd_device *dev, int comp_fd);
68 
69 #endif /* _USD_IB_CMD_ */
70