2 * IBM eServer eHCA Infiniband device driver for Linux on POWER
4 * Firmware Infiniband Interface code for POWER
6 * Authors: Christoph Raisch <raisch@de.ibm.com>
7 * Hoang-Nam Nguyen <hnguyen@de.ibm.com>
8 * Gerd Bayer <gerd.bayer@de.ibm.com>
9 * Waleri Fomin <fomin@de.ibm.com>
11 * Copyright (c) 2005 IBM Corporation
13 * All rights reserved.
15 * This source code is distributed under a dual license of GPL v2.0 and OpenIB
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions are met:
23 * Redistributions of source code must retain the above copyright notice, this
24 * list of conditions and the following disclaimer.
26 * Redistributions in binary form must reproduce the above copyright notice,
27 * this list of conditions and the following disclaimer in the documentation
28 * and/or other materials
29 * provided with the distribution.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
35 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
38 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
39 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGE.
47 #include "ehca_classes.h"
48 #include "ehca_tools.h"
52 * hipz_h_alloc_resource_eq allocates EQ resources in HW and FW, initalize
53 * resources, create the empty EQPT (ring).
55 u64
hipz_h_alloc_resource_eq(const struct ipz_adapter_handle adapter_handle
,
56 struct ehca_pfeq
*pfeq
,
57 const u32 neq_control
,
58 const u32 number_of_entries
,
59 struct ipz_eq_handle
*eq_handle
,
60 u32
* act_nr_of_entries
,
64 u64
hipz_h_reset_event(const struct ipz_adapter_handle adapter_handle
,
65 struct ipz_eq_handle eq_handle
,
66 const u64 event_mask
);
68 * hipz_h_allocate_resource_cq allocates CQ resources in HW and FW, initialize
69 * resources, create the empty CQPT (ring).
71 u64
hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle
,
73 struct ehca_alloc_cq_parms
*param
);
77 * hipz_h_alloc_resource_qp allocates QP resources in HW and FW,
78 * initialize resources, create empty QPPTs (2 rings).
80 u64
hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle
,
81 struct ehca_alloc_qp_parms
*parms
, int is_user
);
83 u64
hipz_h_query_port(const struct ipz_adapter_handle adapter_handle
,
85 struct hipz_query_port
*query_port_response_block
);
87 u64
hipz_h_modify_port(const struct ipz_adapter_handle adapter_handle
,
88 const u8 port_id
, const u32 port_cap
,
89 const u8 init_type
, const int modify_mask
);
91 u64
hipz_h_query_hca(const struct ipz_adapter_handle adapter_handle
,
92 struct hipz_query_hca
*query_hca_rblock
);
95 * hipz_h_register_rpage internal function in hcp_if.h for all
96 * hcp_H_REGISTER_RPAGE calls.
98 u64
hipz_h_register_rpage(const struct ipz_adapter_handle adapter_handle
,
101 const u64 resource_handle
,
102 const u64 logical_address_of_page
,
105 u64
hipz_h_register_rpage_eq(const struct ipz_adapter_handle adapter_handle
,
106 const struct ipz_eq_handle eq_handle
,
107 struct ehca_pfeq
*pfeq
,
110 const u64 logical_address_of_page
,
113 u64
hipz_h_query_int_state(const struct ipz_adapter_handle
117 u64
hipz_h_register_rpage_cq(const struct ipz_adapter_handle adapter_handle
,
118 const struct ipz_cq_handle cq_handle
,
119 struct ehca_pfcq
*pfcq
,
122 const u64 logical_address_of_page
,
124 const struct h_galpa gal
);
126 u64
hipz_h_register_rpage_qp(const struct ipz_adapter_handle adapter_handle
,
127 const struct ipz_qp_handle qp_handle
,
128 struct ehca_pfqp
*pfqp
,
131 const u64 logical_address_of_page
,
133 const struct h_galpa galpa
);
135 u64
hipz_h_disable_and_get_wqe(const struct ipz_adapter_handle adapter_handle
,
136 const struct ipz_qp_handle qp_handle
,
137 struct ehca_pfqp
*pfqp
,
138 void **log_addr_next_sq_wqe_tb_processed
,
139 void **log_addr_next_rq_wqe_tb_processed
,
140 int dis_and_get_function_code
);
142 HCALL_SIGT_NO_CQE
= 0,
143 HCALL_SIGT_BY_WQE
= 1,
147 u64
hipz_h_modify_qp(const struct ipz_adapter_handle adapter_handle
,
148 const struct ipz_qp_handle qp_handle
,
149 struct ehca_pfqp
*pfqp
,
150 const u64 update_mask
,
151 struct hcp_modify_qp_control_block
*mqpcb
,
154 u64
hipz_h_query_qp(const struct ipz_adapter_handle adapter_handle
,
155 const struct ipz_qp_handle qp_handle
,
156 struct ehca_pfqp
*pfqp
,
157 struct hcp_modify_qp_control_block
*qqpcb
,
160 u64
hipz_h_destroy_qp(const struct ipz_adapter_handle adapter_handle
,
163 u64
hipz_h_define_aqp0(const struct ipz_adapter_handle adapter_handle
,
164 const struct ipz_qp_handle qp_handle
,
168 u64
hipz_h_define_aqp1(const struct ipz_adapter_handle adapter_handle
,
169 const struct ipz_qp_handle qp_handle
,
171 u32 port
, u32
* pma_qp_nr
,
174 u64
hipz_h_attach_mcqp(const struct ipz_adapter_handle adapter_handle
,
175 const struct ipz_qp_handle qp_handle
,
178 u64 subnet_prefix
, u64 interface_id
);
180 u64
hipz_h_detach_mcqp(const struct ipz_adapter_handle adapter_handle
,
181 const struct ipz_qp_handle qp_handle
,
184 u64 subnet_prefix
, u64 interface_id
);
186 u64
hipz_h_destroy_cq(const struct ipz_adapter_handle adapter_handle
,
190 u64
hipz_h_destroy_eq(const struct ipz_adapter_handle adapter_handle
,
194 * hipz_h_alloc_resource_mr allocates MR resources in HW and FW, initialize
197 u64
hipz_h_alloc_resource_mr(const struct ipz_adapter_handle adapter_handle
,
198 const struct ehca_mr
*mr
,
201 const u32 access_ctrl
,
202 const struct ipz_pd pd
,
203 struct ehca_mr_hipzout_parms
*outparms
);
205 /* hipz_h_register_rpage_mr registers MR resource pages in HW and FW */
206 u64
hipz_h_register_rpage_mr(const struct ipz_adapter_handle adapter_handle
,
207 const struct ehca_mr
*mr
,
210 const u64 logical_address_of_page
,
213 /* hipz_h_query_mr queries MR in HW and FW */
214 u64
hipz_h_query_mr(const struct ipz_adapter_handle adapter_handle
,
215 const struct ehca_mr
*mr
,
216 struct ehca_mr_hipzout_parms
*outparms
);
218 /* hipz_h_free_resource_mr frees MR resources in HW and FW */
219 u64
hipz_h_free_resource_mr(const struct ipz_adapter_handle adapter_handle
,
220 const struct ehca_mr
*mr
);
222 /* hipz_h_reregister_pmr reregisters MR in HW and FW */
223 u64
hipz_h_reregister_pmr(const struct ipz_adapter_handle adapter_handle
,
224 const struct ehca_mr
*mr
,
227 const u32 access_ctrl
,
228 const struct ipz_pd pd
,
229 const u64 mr_addr_cb
,
230 struct ehca_mr_hipzout_parms
*outparms
);
232 /* hipz_h_register_smr register shared MR in HW and FW */
233 u64
hipz_h_register_smr(const struct ipz_adapter_handle adapter_handle
,
234 const struct ehca_mr
*mr
,
235 const struct ehca_mr
*orig_mr
,
237 const u32 access_ctrl
,
238 const struct ipz_pd pd
,
239 struct ehca_mr_hipzout_parms
*outparms
);
242 * hipz_h_alloc_resource_mw allocates MW resources in HW and FW, initialize
245 u64
hipz_h_alloc_resource_mw(const struct ipz_adapter_handle adapter_handle
,
246 const struct ehca_mw
*mw
,
247 const struct ipz_pd pd
,
248 struct ehca_mw_hipzout_parms
*outparms
);
250 /* hipz_h_query_mw queries MW in HW and FW */
251 u64
hipz_h_query_mw(const struct ipz_adapter_handle adapter_handle
,
252 const struct ehca_mw
*mw
,
253 struct ehca_mw_hipzout_parms
*outparms
);
255 /* hipz_h_free_resource_mw frees MW resources in HW and FW */
256 u64
hipz_h_free_resource_mw(const struct ipz_adapter_handle adapter_handle
,
257 const struct ehca_mw
*mw
);
259 u64
hipz_h_error_data(const struct ipz_adapter_handle adapter_handle
,
260 const u64 ressource_handle
,
262 unsigned long *byte_count
);
263 u64
hipz_h_eoi(int irq
);
265 #endif /* __HCP_IF_H__ */