locks: fix vfs_test_lock() comment
[deliverable/linux.git] / drivers / infiniband / hw / ehca / ehca_iverbs.h
1 /*
2 * IBM eServer eHCA Infiniband device driver for Linux on POWER
3 *
4 * Function definitions for internal functions
5 *
6 * Authors: Heiko J Schick <schickhj@de.ibm.com>
7 * Dietmar Decker <ddecker@de.ibm.com>
8 *
9 * Copyright (c) 2005 IBM Corporation
10 *
11 * All rights reserved.
12 *
13 * This source code is distributed under a dual license of GPL v2.0 and OpenIB
14 * BSD.
15 *
16 * OpenIB BSD License
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are met:
20 *
21 * Redistributions of source code must retain the above copyright notice, this
22 * list of conditions and the following disclaimer.
23 *
24 * Redistributions in binary form must reproduce the above copyright notice,
25 * this list of conditions and the following disclaimer in the documentation
26 * and/or other materials
27 * provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
36 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
37 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42 #ifndef __EHCA_IVERBS_H__
43 #define __EHCA_IVERBS_H__
44
45 #include "ehca_classes.h"
46
47 int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props);
48
49 int ehca_query_port(struct ib_device *ibdev, u8 port,
50 struct ib_port_attr *props);
51
52 int ehca_query_sma_attr(struct ehca_shca *shca, u8 port,
53 struct ehca_sma_attr *attr);
54
55 int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 * pkey);
56
57 int ehca_query_gid(struct ib_device *ibdev, u8 port, int index,
58 union ib_gid *gid);
59
60 int ehca_modify_port(struct ib_device *ibdev, u8 port, int port_modify_mask,
61 struct ib_port_modify *props);
62
63 struct ib_pd *ehca_alloc_pd(struct ib_device *device,
64 struct ib_ucontext *context,
65 struct ib_udata *udata);
66
67 int ehca_dealloc_pd(struct ib_pd *pd);
68
69 struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
70
71 int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr);
72
73 int ehca_query_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr);
74
75 int ehca_destroy_ah(struct ib_ah *ah);
76
77 struct ib_mr *ehca_get_dma_mr(struct ib_pd *pd, int mr_access_flags);
78
79 struct ib_mr *ehca_reg_phys_mr(struct ib_pd *pd,
80 struct ib_phys_buf *phys_buf_array,
81 int num_phys_buf,
82 int mr_access_flags, u64 *iova_start);
83
84 struct ib_mr *ehca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, u64 virt,
85 int mr_access_flags, struct ib_udata *udata);
86
87 int ehca_rereg_phys_mr(struct ib_mr *mr,
88 int mr_rereg_mask,
89 struct ib_pd *pd,
90 struct ib_phys_buf *phys_buf_array,
91 int num_phys_buf, int mr_access_flags, u64 *iova_start);
92
93 int ehca_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr);
94
95 int ehca_dereg_mr(struct ib_mr *mr);
96
97 struct ib_mw *ehca_alloc_mw(struct ib_pd *pd);
98
99 int ehca_bind_mw(struct ib_qp *qp, struct ib_mw *mw,
100 struct ib_mw_bind *mw_bind);
101
102 int ehca_dealloc_mw(struct ib_mw *mw);
103
104 struct ib_fmr *ehca_alloc_fmr(struct ib_pd *pd,
105 int mr_access_flags,
106 struct ib_fmr_attr *fmr_attr);
107
108 int ehca_map_phys_fmr(struct ib_fmr *fmr,
109 u64 *page_list, int list_len, u64 iova);
110
111 int ehca_unmap_fmr(struct list_head *fmr_list);
112
113 int ehca_dealloc_fmr(struct ib_fmr *fmr);
114
115 enum ehca_eq_type {
116 EHCA_EQ = 0, /* Event Queue */
117 EHCA_NEQ /* Notification Event Queue */
118 };
119
120 int ehca_create_eq(struct ehca_shca *shca, struct ehca_eq *eq,
121 enum ehca_eq_type type, const u32 length);
122
123 int ehca_destroy_eq(struct ehca_shca *shca, struct ehca_eq *eq);
124
125 void *ehca_poll_eq(struct ehca_shca *shca, struct ehca_eq *eq);
126
127
128 struct ib_cq *ehca_create_cq(struct ib_device *device, int cqe, int comp_vector,
129 struct ib_ucontext *context,
130 struct ib_udata *udata);
131
132 int ehca_destroy_cq(struct ib_cq *cq);
133
134 int ehca_resize_cq(struct ib_cq *cq, int cqe, struct ib_udata *udata);
135
136 int ehca_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc);
137
138 int ehca_peek_cq(struct ib_cq *cq, int wc_cnt);
139
140 int ehca_req_notify_cq(struct ib_cq *cq, enum ib_cq_notify_flags notify_flags);
141
142 struct ib_qp *ehca_create_qp(struct ib_pd *pd,
143 struct ib_qp_init_attr *init_attr,
144 struct ib_udata *udata);
145
146 int ehca_destroy_qp(struct ib_qp *qp);
147
148 int ehca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
149 struct ib_udata *udata);
150
151 int ehca_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
152 int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr);
153
154 int ehca_post_send(struct ib_qp *qp, struct ib_send_wr *send_wr,
155 struct ib_send_wr **bad_send_wr);
156
157 int ehca_post_recv(struct ib_qp *qp, struct ib_recv_wr *recv_wr,
158 struct ib_recv_wr **bad_recv_wr);
159
160 int ehca_post_srq_recv(struct ib_srq *srq,
161 struct ib_recv_wr *recv_wr,
162 struct ib_recv_wr **bad_recv_wr);
163
164 struct ib_srq *ehca_create_srq(struct ib_pd *pd,
165 struct ib_srq_init_attr *init_attr,
166 struct ib_udata *udata);
167
168 int ehca_modify_srq(struct ib_srq *srq, struct ib_srq_attr *attr,
169 enum ib_srq_attr_mask attr_mask, struct ib_udata *udata);
170
171 int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr);
172
173 int ehca_destroy_srq(struct ib_srq *srq);
174
175 u64 ehca_define_sqp(struct ehca_shca *shca, struct ehca_qp *ibqp,
176 struct ib_qp_init_attr *qp_init_attr);
177
178 int ehca_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
179
180 int ehca_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
181
182 struct ib_ucontext *ehca_alloc_ucontext(struct ib_device *device,
183 struct ib_udata *udata);
184
185 int ehca_dealloc_ucontext(struct ib_ucontext *context);
186
187 int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
188
189 void ehca_poll_eqs(unsigned long data);
190
191 #ifdef CONFIG_PPC_64K_PAGES
192 void *ehca_alloc_fw_ctrlblock(gfp_t flags);
193 void ehca_free_fw_ctrlblock(void *ptr);
194 #else
195 #define ehca_alloc_fw_ctrlblock(flags) ((void *) get_zeroed_page(flags))
196 #define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
197 #endif
198
199 #endif
This page took 0.05085 seconds and 5 git commands to generate.