xref: /freebsd/sys/dev/irdma/irdma_main.h (revision 777e472cd86b9394d07bf96c19dbafc2e1ff4fdc)
1cdcd52d4SBartosz Sobczak /*-
2cdcd52d4SBartosz Sobczak  * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB
3cdcd52d4SBartosz Sobczak  *
4cdcd52d4SBartosz Sobczak  * Copyright (c) 2015 - 2022 Intel Corporation
5cdcd52d4SBartosz Sobczak  *
6cdcd52d4SBartosz Sobczak  * This software is available to you under a choice of one of two
7cdcd52d4SBartosz Sobczak  * licenses.  You may choose to be licensed under the terms of the GNU
8cdcd52d4SBartosz Sobczak  * General Public License (GPL) Version 2, available from the file
9cdcd52d4SBartosz Sobczak  * COPYING in the main directory of this source tree, or the
10cdcd52d4SBartosz Sobczak  * OpenFabrics.org BSD license below:
11cdcd52d4SBartosz Sobczak  *
12cdcd52d4SBartosz Sobczak  *   Redistribution and use in source and binary forms, with or
13cdcd52d4SBartosz Sobczak  *   without modification, are permitted provided that the following
14cdcd52d4SBartosz Sobczak  *   conditions are met:
15cdcd52d4SBartosz Sobczak  *
16cdcd52d4SBartosz Sobczak  *    - Redistributions of source code must retain the above
17cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
18cdcd52d4SBartosz Sobczak  *	disclaimer.
19cdcd52d4SBartosz Sobczak  *
20cdcd52d4SBartosz Sobczak  *    - Redistributions in binary form must reproduce the above
21cdcd52d4SBartosz Sobczak  *	copyright notice, this list of conditions and the following
22cdcd52d4SBartosz Sobczak  *	disclaimer in the documentation and/or other materials
23cdcd52d4SBartosz Sobczak  *	provided with the distribution.
24cdcd52d4SBartosz Sobczak  *
25cdcd52d4SBartosz Sobczak  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26cdcd52d4SBartosz Sobczak  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27cdcd52d4SBartosz Sobczak  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28cdcd52d4SBartosz Sobczak  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29cdcd52d4SBartosz Sobczak  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30cdcd52d4SBartosz Sobczak  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31cdcd52d4SBartosz Sobczak  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32cdcd52d4SBartosz Sobczak  * SOFTWARE.
33cdcd52d4SBartosz Sobczak  */
34cdcd52d4SBartosz Sobczak /*$FreeBSD$*/
35cdcd52d4SBartosz Sobczak 
36cdcd52d4SBartosz Sobczak #ifndef IRDMA_MAIN_H
37cdcd52d4SBartosz Sobczak #define IRDMA_MAIN_H
38cdcd52d4SBartosz Sobczak 
39cdcd52d4SBartosz Sobczak #include <linux/in.h>
40cdcd52d4SBartosz Sobczak #include <netinet/ip6.h>
41cdcd52d4SBartosz Sobczak #include <netinet/udp.h>
42cdcd52d4SBartosz Sobczak #include <netinet/tcp.h>
43cdcd52d4SBartosz Sobczak #include <sys/socket.h>
44cdcd52d4SBartosz Sobczak #include <netinet/if_ether.h>
45cdcd52d4SBartosz Sobczak #include <linux/slab.h>
46cdcd52d4SBartosz Sobczak #include <linux/rculist.h>
47*777e472cSBartosz Sobczak #include <rdma/uverbs_ioctl.h>
48cdcd52d4SBartosz Sobczak #include <rdma/ib_smi.h>
49cdcd52d4SBartosz Sobczak #include <rdma/ib_verbs.h>
50cdcd52d4SBartosz Sobczak #include <rdma/ib_pack.h>
51cdcd52d4SBartosz Sobczak #include <rdma/rdma_cm.h>
52cdcd52d4SBartosz Sobczak #include <rdma/iw_cm.h>
53cdcd52d4SBartosz Sobczak #include <rdma/ib_user_verbs.h>
54cdcd52d4SBartosz Sobczak #include <rdma/ib_umem.h>
55cdcd52d4SBartosz Sobczak #include <rdma/ib_cache.h>
56cdcd52d4SBartosz Sobczak #include "osdep.h"
57cdcd52d4SBartosz Sobczak #include "irdma_defs.h"
58cdcd52d4SBartosz Sobczak #include "irdma_hmc.h"
59cdcd52d4SBartosz Sobczak #include "irdma_type.h"
60cdcd52d4SBartosz Sobczak #include "irdma_ws.h"
61cdcd52d4SBartosz Sobczak #include "irdma_protos.h"
62cdcd52d4SBartosz Sobczak #include "irdma_pble.h"
63cdcd52d4SBartosz Sobczak #include "irdma_cm.h"
64cdcd52d4SBartosz Sobczak #include "fbsd_kcompat.h"
65cdcd52d4SBartosz Sobczak #include "irdma-abi.h"
66cdcd52d4SBartosz Sobczak #include "irdma_verbs.h"
67cdcd52d4SBartosz Sobczak #include "irdma_user.h"
68cdcd52d4SBartosz Sobczak #include "irdma_puda.h"
69cdcd52d4SBartosz Sobczak 
70cdcd52d4SBartosz Sobczak extern struct list_head irdma_handlers;
71cdcd52d4SBartosz Sobczak extern spinlock_t irdma_handler_lock;
72cdcd52d4SBartosz Sobczak extern bool irdma_upload_context;
73cdcd52d4SBartosz Sobczak 
74cdcd52d4SBartosz Sobczak #define IRDMA_FW_VER_DEFAULT	2
75cdcd52d4SBartosz Sobczak #define IRDMA_HW_VER	        2
76cdcd52d4SBartosz Sobczak 
77cdcd52d4SBartosz Sobczak #define IRDMA_ARP_ADD		1
78cdcd52d4SBartosz Sobczak #define IRDMA_ARP_DELETE	2
79cdcd52d4SBartosz Sobczak #define IRDMA_ARP_RESOLVE	3
80cdcd52d4SBartosz Sobczak 
81cdcd52d4SBartosz Sobczak #define IRDMA_MACIP_ADD		1
82cdcd52d4SBartosz Sobczak #define IRDMA_MACIP_DELETE	2
83cdcd52d4SBartosz Sobczak 
84cdcd52d4SBartosz Sobczak #define IW_CCQ_SIZE	(IRDMA_CQP_SW_SQSIZE_2048 + 1)
85cdcd52d4SBartosz Sobczak #define IW_CEQ_SIZE	2048
86cdcd52d4SBartosz Sobczak #define IW_AEQ_SIZE	2048
87cdcd52d4SBartosz Sobczak 
88cdcd52d4SBartosz Sobczak #define RX_BUF_SIZE	(1536 + 8)
89cdcd52d4SBartosz Sobczak #define IW_REG0_SIZE	(4 * 1024)
90cdcd52d4SBartosz Sobczak #define IW_TX_TIMEOUT	(6 * HZ)
91cdcd52d4SBartosz Sobczak #define IW_FIRST_QPN	1
92cdcd52d4SBartosz Sobczak 
93cdcd52d4SBartosz Sobczak #define IW_SW_CONTEXT_ALIGN	1024
94cdcd52d4SBartosz Sobczak 
95cdcd52d4SBartosz Sobczak #define MAX_DPC_ITERATIONS	128
96cdcd52d4SBartosz Sobczak 
97cdcd52d4SBartosz Sobczak #define IRDMA_EVENT_TIMEOUT_MS		5000
98cdcd52d4SBartosz Sobczak #define IRDMA_VCHNL_EVENT_TIMEOUT_MS	10000
99cdcd52d4SBartosz Sobczak #define IRDMA_RST_TIMEOUT_HZ		4
100cdcd52d4SBartosz Sobczak 
101cdcd52d4SBartosz Sobczak #define	IRDMA_NO_QSET	0xffff
102cdcd52d4SBartosz Sobczak 
103cdcd52d4SBartosz Sobczak #define IW_CFG_FPM_QP_COUNT		32768
104*777e472cSBartosz Sobczak #define IRDMA_MAX_PAGES_PER_FMR		262144
105cdcd52d4SBartosz Sobczak #define IRDMA_MIN_PAGES_PER_FMR		1
106cdcd52d4SBartosz Sobczak #define IRDMA_CQP_COMPL_RQ_WQE_FLUSHED	2
107cdcd52d4SBartosz Sobczak #define IRDMA_CQP_COMPL_SQ_WQE_FLUSHED	3
108cdcd52d4SBartosz Sobczak 
109cdcd52d4SBartosz Sobczak #define IRDMA_Q_TYPE_PE_AEQ	0x80
110cdcd52d4SBartosz Sobczak #define IRDMA_Q_INVALID_IDX	0xffff
111cdcd52d4SBartosz Sobczak #define IRDMA_REM_ENDPOINT_TRK_QPID	3
112cdcd52d4SBartosz Sobczak 
113cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_MPA_VER_0		0x00000001
114cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_MPA_CRC		0x00000002
115cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_FIRST_WRITE	0x00000004
116cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_INTF		0x00000008
117cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_MSI			0x00000010
118cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DUAL_LOGICAL_PORT		0x00000020
119cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_NO_INLINE_DATA		0x00000080
120cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_INT_MOD		0x00000100
121cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_DISABLE_VIRT_WQ		0x00000200
122cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_ENA_PAU			0x00000400
123cdcd52d4SBartosz Sobczak #define IRDMA_DRV_OPT_MCAST_LOGPORT_MAP		0x00000800
124cdcd52d4SBartosz Sobczak 
125cdcd52d4SBartosz Sobczak #define IW_HMC_OBJ_TYPE_NUM	ARRAY_SIZE(iw_hmc_obj_types)
126cdcd52d4SBartosz Sobczak #define IRDMA_ROCE_CWND_DEFAULT			0x400
127cdcd52d4SBartosz Sobczak #define IRDMA_ROCE_ACKCREDS_DEFAULT		0x1E
128cdcd52d4SBartosz Sobczak 
129cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_SQ		BIT(0)
130cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_RQ		BIT(1)
131cdcd52d4SBartosz Sobczak #define IRDMA_REFLUSH		BIT(2)
132cdcd52d4SBartosz Sobczak #define IRDMA_FLUSH_WAIT	BIT(3)
133cdcd52d4SBartosz Sobczak 
134cdcd52d4SBartosz Sobczak enum init_completion_state {
135cdcd52d4SBartosz Sobczak 	INVALID_STATE = 0,
136cdcd52d4SBartosz Sobczak 	INITIAL_STATE,
137cdcd52d4SBartosz Sobczak 	CQP_CREATED,
138cdcd52d4SBartosz Sobczak 	HMC_OBJS_CREATED,
139cdcd52d4SBartosz Sobczak 	HW_RSRC_INITIALIZED,
140cdcd52d4SBartosz Sobczak 	CCQ_CREATED,
141cdcd52d4SBartosz Sobczak 	CEQ0_CREATED, /* Last state of probe */
142cdcd52d4SBartosz Sobczak 	ILQ_CREATED,
143cdcd52d4SBartosz Sobczak 	IEQ_CREATED,
144cdcd52d4SBartosz Sobczak 	REM_ENDPOINT_TRK_CREATED,
145cdcd52d4SBartosz Sobczak 	CEQS_CREATED,
146cdcd52d4SBartosz Sobczak 	PBLE_CHUNK_MEM,
147cdcd52d4SBartosz Sobczak 	AEQ_CREATED,
148cdcd52d4SBartosz Sobczak 	IP_ADDR_REGISTERED,  /* Last state of open */
149cdcd52d4SBartosz Sobczak };
150cdcd52d4SBartosz Sobczak 
151cdcd52d4SBartosz Sobczak struct irdma_rsrc_limits {
152cdcd52d4SBartosz Sobczak 	u32 qplimit;
153cdcd52d4SBartosz Sobczak 	u32 mrlimit;
154cdcd52d4SBartosz Sobczak 	u32 cqlimit;
155cdcd52d4SBartosz Sobczak };
156cdcd52d4SBartosz Sobczak 
157cdcd52d4SBartosz Sobczak struct irdma_cqp_err_info {
158cdcd52d4SBartosz Sobczak 	u16 maj;
159cdcd52d4SBartosz Sobczak 	u16 min;
160cdcd52d4SBartosz Sobczak 	const char *desc;
161cdcd52d4SBartosz Sobczak };
162cdcd52d4SBartosz Sobczak 
163cdcd52d4SBartosz Sobczak struct irdma_cqp_compl_info {
164cdcd52d4SBartosz Sobczak 	u32 op_ret_val;
165cdcd52d4SBartosz Sobczak 	u16 maj_err_code;
166cdcd52d4SBartosz Sobczak 	u16 min_err_code;
167cdcd52d4SBartosz Sobczak 	bool error;
168cdcd52d4SBartosz Sobczak 	u8 op_code;
169cdcd52d4SBartosz Sobczak };
170cdcd52d4SBartosz Sobczak 
171cdcd52d4SBartosz Sobczak struct irdma_cqp_request {
172cdcd52d4SBartosz Sobczak 	struct cqp_cmds_info info;
173cdcd52d4SBartosz Sobczak 	wait_queue_head_t waitq;
174cdcd52d4SBartosz Sobczak 	struct list_head list;
175cdcd52d4SBartosz Sobczak 	atomic_t refcnt;
176cdcd52d4SBartosz Sobczak 	void (*callback_fcn)(struct irdma_cqp_request *cqp_request);
177cdcd52d4SBartosz Sobczak 	void *param;
178cdcd52d4SBartosz Sobczak 	struct irdma_cqp_compl_info compl_info;
179cdcd52d4SBartosz Sobczak 	bool waiting:1;
180cdcd52d4SBartosz Sobczak 	bool request_done:1;
181cdcd52d4SBartosz Sobczak 	bool dynamic:1;
182cdcd52d4SBartosz Sobczak };
183cdcd52d4SBartosz Sobczak 
184cdcd52d4SBartosz Sobczak struct irdma_cqp {
185cdcd52d4SBartosz Sobczak 	struct irdma_sc_cqp sc_cqp;
186cdcd52d4SBartosz Sobczak 	spinlock_t req_lock; /* protect CQP request list */
187cdcd52d4SBartosz Sobczak 	spinlock_t compl_lock; /* protect CQP completion processing */
188cdcd52d4SBartosz Sobczak 	wait_queue_head_t waitq;
189cdcd52d4SBartosz Sobczak 	wait_queue_head_t remove_wq;
190cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem sq;
191cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem host_ctx;
192cdcd52d4SBartosz Sobczak 	u64 *scratch_array;
193cdcd52d4SBartosz Sobczak 	struct irdma_cqp_request *cqp_requests;
194cdcd52d4SBartosz Sobczak 	struct list_head cqp_avail_reqs;
195cdcd52d4SBartosz Sobczak 	struct list_head cqp_pending_reqs;
196cdcd52d4SBartosz Sobczak };
197cdcd52d4SBartosz Sobczak 
198cdcd52d4SBartosz Sobczak struct irdma_ccq {
199cdcd52d4SBartosz Sobczak 	struct irdma_sc_cq sc_cq;
200cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem_cq;
201cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem shadow_area;
202cdcd52d4SBartosz Sobczak };
203cdcd52d4SBartosz Sobczak 
204cdcd52d4SBartosz Sobczak struct irdma_ceq {
205cdcd52d4SBartosz Sobczak 	struct irdma_sc_ceq sc_ceq;
206cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem;
207cdcd52d4SBartosz Sobczak 	u32 irq;
208cdcd52d4SBartosz Sobczak 	u32 msix_idx;
209cdcd52d4SBartosz Sobczak 	struct irdma_pci_f *rf;
210cdcd52d4SBartosz Sobczak 	struct tasklet_struct dpc_tasklet;
211cdcd52d4SBartosz Sobczak 	spinlock_t ce_lock; /* sync cq destroy with cq completion event notification */
212cdcd52d4SBartosz Sobczak };
213cdcd52d4SBartosz Sobczak 
214cdcd52d4SBartosz Sobczak struct irdma_aeq {
215cdcd52d4SBartosz Sobczak 	struct irdma_sc_aeq sc_aeq;
216cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem mem;
217cdcd52d4SBartosz Sobczak 	struct irdma_pble_alloc palloc;
218cdcd52d4SBartosz Sobczak 	bool virtual_map;
219cdcd52d4SBartosz Sobczak };
220cdcd52d4SBartosz Sobczak 
221cdcd52d4SBartosz Sobczak struct irdma_arp_entry {
222cdcd52d4SBartosz Sobczak 	u32 ip_addr[4];
223cdcd52d4SBartosz Sobczak 	u8 mac_addr[ETH_ALEN];
224cdcd52d4SBartosz Sobczak };
225cdcd52d4SBartosz Sobczak 
226cdcd52d4SBartosz Sobczak struct irdma_msix_vector {
227cdcd52d4SBartosz Sobczak 	u32 idx;
228cdcd52d4SBartosz Sobczak 	u32 irq;
229cdcd52d4SBartosz Sobczak 	u32 cpu_affinity;
230cdcd52d4SBartosz Sobczak 	u32 ceq_id;
231cdcd52d4SBartosz Sobczak 	struct resource *res;
232cdcd52d4SBartosz Sobczak 	void  *tag;
233cdcd52d4SBartosz Sobczak };
234cdcd52d4SBartosz Sobczak 
235cdcd52d4SBartosz Sobczak struct irdma_mc_table_info {
236cdcd52d4SBartosz Sobczak 	u32 mgn;
237cdcd52d4SBartosz Sobczak 	u32 dest_ip[4];
238cdcd52d4SBartosz Sobczak 	bool lan_fwd:1;
239cdcd52d4SBartosz Sobczak 	bool ipv4_valid:1;
240cdcd52d4SBartosz Sobczak };
241cdcd52d4SBartosz Sobczak 
242cdcd52d4SBartosz Sobczak struct mc_table_list {
243cdcd52d4SBartosz Sobczak 	struct list_head list;
244cdcd52d4SBartosz Sobczak 	struct irdma_mc_table_info mc_info;
245cdcd52d4SBartosz Sobczak 	struct irdma_mcast_grp_info mc_grp_ctx;
246cdcd52d4SBartosz Sobczak };
247cdcd52d4SBartosz Sobczak 
248cdcd52d4SBartosz Sobczak struct irdma_qv_info {
249cdcd52d4SBartosz Sobczak 	u32 v_idx; /* msix_vector */
250cdcd52d4SBartosz Sobczak 	u16 ceq_idx;
251cdcd52d4SBartosz Sobczak 	u16 aeq_idx;
252cdcd52d4SBartosz Sobczak 	u8 itr_idx;
253cdcd52d4SBartosz Sobczak };
254cdcd52d4SBartosz Sobczak 
255cdcd52d4SBartosz Sobczak struct irdma_qvlist_info {
256cdcd52d4SBartosz Sobczak 	u32 num_vectors;
257cdcd52d4SBartosz Sobczak 	struct irdma_qv_info qv_info[1];
258cdcd52d4SBartosz Sobczak };
259cdcd52d4SBartosz Sobczak 
260cdcd52d4SBartosz Sobczak struct irdma_gen_ops {
261cdcd52d4SBartosz Sobczak 	void (*request_reset)(struct irdma_pci_f *rf);
262cdcd52d4SBartosz Sobczak 	int (*register_qset)(struct irdma_sc_vsi *vsi,
263cdcd52d4SBartosz Sobczak 			     struct irdma_ws_node *tc_node);
264cdcd52d4SBartosz Sobczak 	void (*unregister_qset)(struct irdma_sc_vsi *vsi,
265cdcd52d4SBartosz Sobczak 				struct irdma_ws_node *tc_node);
266cdcd52d4SBartosz Sobczak };
267cdcd52d4SBartosz Sobczak 
268cdcd52d4SBartosz Sobczak struct irdma_pci_f {
269cdcd52d4SBartosz Sobczak 	bool reset:1;
270cdcd52d4SBartosz Sobczak 	bool rsrc_created:1;
271cdcd52d4SBartosz Sobczak 	bool msix_shared:1;
272cdcd52d4SBartosz Sobczak 	bool ftype:1;
273cdcd52d4SBartosz Sobczak 	u8 rsrc_profile;
274cdcd52d4SBartosz Sobczak 	u8 *hmc_info_mem;
275cdcd52d4SBartosz Sobczak 	u8 *mem_rsrc;
276cdcd52d4SBartosz Sobczak 	u8 rdma_ver;
277cdcd52d4SBartosz Sobczak 	u8 rst_to;
278*777e472cSBartosz Sobczak 	/* Not used in SRIOV VF mode */
279*777e472cSBartosz Sobczak 	u8 pf_id;
280cdcd52d4SBartosz Sobczak 	enum irdma_protocol_used protocol_used;
281cdcd52d4SBartosz Sobczak 	bool en_rem_endpoint_trk:1;
282cdcd52d4SBartosz Sobczak 	bool dcqcn_ena:1;
283cdcd52d4SBartosz Sobczak 	u32 sd_type;
284cdcd52d4SBartosz Sobczak 	u32 msix_count;
285cdcd52d4SBartosz Sobczak 	u32 max_mr;
286cdcd52d4SBartosz Sobczak 	u32 max_qp;
287cdcd52d4SBartosz Sobczak 	u32 max_cq;
288cdcd52d4SBartosz Sobczak 	u32 max_ah;
289cdcd52d4SBartosz Sobczak 	u32 next_ah;
290cdcd52d4SBartosz Sobczak 	u32 max_mcg;
291cdcd52d4SBartosz Sobczak 	u32 next_mcg;
292cdcd52d4SBartosz Sobczak 	u32 max_pd;
293cdcd52d4SBartosz Sobczak 	u32 next_qp;
294cdcd52d4SBartosz Sobczak 	u32 next_cq;
295cdcd52d4SBartosz Sobczak 	u32 next_pd;
296cdcd52d4SBartosz Sobczak 	u32 max_mr_size;
297cdcd52d4SBartosz Sobczak 	u32 max_cqe;
298cdcd52d4SBartosz Sobczak 	u32 mr_stagmask;
299cdcd52d4SBartosz Sobczak 	u32 used_pds;
300cdcd52d4SBartosz Sobczak 	u32 used_cqs;
301cdcd52d4SBartosz Sobczak 	u32 used_mrs;
302cdcd52d4SBartosz Sobczak 	u32 used_qps;
303cdcd52d4SBartosz Sobczak 	u32 arp_table_size;
304cdcd52d4SBartosz Sobczak 	u32 next_arp_index;
305cdcd52d4SBartosz Sobczak 	u32 ceqs_count;
306cdcd52d4SBartosz Sobczak 	u32 next_ws_node_id;
307cdcd52d4SBartosz Sobczak 	u32 max_ws_node_id;
308cdcd52d4SBartosz Sobczak 	u32 limits_sel;
309cdcd52d4SBartosz Sobczak 	unsigned long *allocated_ws_nodes;
310cdcd52d4SBartosz Sobczak 	unsigned long *allocated_qps;
311cdcd52d4SBartosz Sobczak 	unsigned long *allocated_cqs;
312cdcd52d4SBartosz Sobczak 	unsigned long *allocated_mrs;
313cdcd52d4SBartosz Sobczak 	unsigned long *allocated_pds;
314cdcd52d4SBartosz Sobczak 	unsigned long *allocated_mcgs;
315cdcd52d4SBartosz Sobczak 	unsigned long *allocated_ahs;
316cdcd52d4SBartosz Sobczak 	unsigned long *allocated_arps;
317cdcd52d4SBartosz Sobczak 	enum init_completion_state init_state;
318cdcd52d4SBartosz Sobczak 	struct irdma_sc_dev sc_dev;
319cdcd52d4SBartosz Sobczak 	struct irdma_dev_ctx dev_ctx;
320cdcd52d4SBartosz Sobczak 	struct irdma_tunable_info tun_info;
321cdcd52d4SBartosz Sobczak 	eventhandler_tag irdma_ifaddr_event;
322cdcd52d4SBartosz Sobczak 	struct irdma_handler *hdl;
323cdcd52d4SBartosz Sobczak 	struct pci_dev *pcidev;
324cdcd52d4SBartosz Sobczak 	struct ice_rdma_peer *peer_info;
325cdcd52d4SBartosz Sobczak 	struct irdma_hw hw;
326cdcd52d4SBartosz Sobczak 	struct irdma_cqp cqp;
327cdcd52d4SBartosz Sobczak 	struct irdma_ccq ccq;
328cdcd52d4SBartosz Sobczak 	struct irdma_aeq aeq;
329cdcd52d4SBartosz Sobczak 	struct irdma_ceq *ceqlist;
330cdcd52d4SBartosz Sobczak 	struct irdma_hmc_pble_rsrc *pble_rsrc;
331cdcd52d4SBartosz Sobczak 	struct irdma_arp_entry *arp_table;
332cdcd52d4SBartosz Sobczak 	spinlock_t arp_lock; /*protect ARP table access*/
333cdcd52d4SBartosz Sobczak 	spinlock_t rsrc_lock; /* protect HW resource array access */
334cdcd52d4SBartosz Sobczak 	spinlock_t qptable_lock; /*protect QP table access*/
335cdcd52d4SBartosz Sobczak 	spinlock_t cqtable_lock; /*protect CQ table access*/
336cdcd52d4SBartosz Sobczak 	struct irdma_qp **qp_table;
337cdcd52d4SBartosz Sobczak 	struct irdma_cq **cq_table;
338cdcd52d4SBartosz Sobczak 	spinlock_t qh_list_lock; /* protect mc_qht_list */
339cdcd52d4SBartosz Sobczak 	struct mc_table_list mc_qht_list;
340cdcd52d4SBartosz Sobczak 	struct irdma_msix_vector *iw_msixtbl;
341cdcd52d4SBartosz Sobczak 	struct irdma_qvlist_info *iw_qvlist;
342cdcd52d4SBartosz Sobczak 	struct tasklet_struct dpc_tasklet;
343cdcd52d4SBartosz Sobczak 	struct msix_entry msix_info;
344cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem obj_mem;
345cdcd52d4SBartosz Sobczak 	struct irdma_dma_mem obj_next;
346cdcd52d4SBartosz Sobczak 	atomic_t vchnl_msgs;
347cdcd52d4SBartosz Sobczak 	wait_queue_head_t vchnl_waitq;
348cdcd52d4SBartosz Sobczak 	struct workqueue_struct *cqp_cmpl_wq;
349cdcd52d4SBartosz Sobczak 	struct work_struct cqp_cmpl_work;
350cdcd52d4SBartosz Sobczak 	struct irdma_sc_vsi default_vsi;
351cdcd52d4SBartosz Sobczak 	void *back_fcn;
352cdcd52d4SBartosz Sobczak 	struct irdma_gen_ops gen_ops;
353cdcd52d4SBartosz Sobczak 	void (*check_fc)(struct irdma_sc_vsi *vsi, struct irdma_sc_qp *sc_qp);
354cdcd52d4SBartosz Sobczak 	struct irdma_dcqcn_cc_params dcqcn_params;
355cdcd52d4SBartosz Sobczak 	struct irdma_device *iwdev;
356cdcd52d4SBartosz Sobczak };
357cdcd52d4SBartosz Sobczak 
358cdcd52d4SBartosz Sobczak struct irdma_device {
359cdcd52d4SBartosz Sobczak 	struct ib_device ibdev;
360cdcd52d4SBartosz Sobczak 	struct irdma_pci_f *rf;
361cdcd52d4SBartosz Sobczak 	struct ifnet *netdev;
362*777e472cSBartosz Sobczak 	struct notifier_block nb_netdevice_event;
363cdcd52d4SBartosz Sobczak 	struct irdma_handler *hdl;
364cdcd52d4SBartosz Sobczak 	struct workqueue_struct *cleanup_wq;
365cdcd52d4SBartosz Sobczak 	struct irdma_sc_vsi vsi;
366cdcd52d4SBartosz Sobczak 	struct irdma_cm_core cm_core;
367cdcd52d4SBartosz Sobczak 	u32 roce_cwnd;
368cdcd52d4SBartosz Sobczak 	u32 roce_ackcreds;
369cdcd52d4SBartosz Sobczak 	u32 vendor_id;
370cdcd52d4SBartosz Sobczak 	u32 vendor_part_id;
371cdcd52d4SBartosz Sobczak 	u32 push_mode;
372cdcd52d4SBartosz Sobczak 	u32 rcv_wnd;
373cdcd52d4SBartosz Sobczak 	u16 mac_ip_table_idx;
374cdcd52d4SBartosz Sobczak 	u16 vsi_num;
375cdcd52d4SBartosz Sobczak 	u8 rcv_wscale;
376cdcd52d4SBartosz Sobczak 	u8 iw_status;
377cdcd52d4SBartosz Sobczak 	u8 rd_fence_rate;
378*777e472cSBartosz Sobczak 	bool override_rcv_wnd:1;
379*777e472cSBartosz Sobczak 	bool override_cwnd:1;
380*777e472cSBartosz Sobczak 	bool override_ackcreds:1;
381*777e472cSBartosz Sobczak 	bool override_ooo:1;
382*777e472cSBartosz Sobczak 	bool override_rd_fence_rate:1;
383*777e472cSBartosz Sobczak 	bool override_rtomin:1;
384cdcd52d4SBartosz Sobczak 	bool roce_mode:1;
385cdcd52d4SBartosz Sobczak 	bool roce_dcqcn_en:1;
386cdcd52d4SBartosz Sobczak 	bool dcb_vlan_mode:1;
387cdcd52d4SBartosz Sobczak 	bool iw_ooo:1;
388cdcd52d4SBartosz Sobczak 	enum init_completion_state init_state;
389cdcd52d4SBartosz Sobczak 
390cdcd52d4SBartosz Sobczak 	wait_queue_head_t suspend_wq;
391cdcd52d4SBartosz Sobczak };
392cdcd52d4SBartosz Sobczak 
393cdcd52d4SBartosz Sobczak struct irdma_handler {
394cdcd52d4SBartosz Sobczak 	struct list_head list;
395cdcd52d4SBartosz Sobczak 	struct irdma_device *iwdev;
396cdcd52d4SBartosz Sobczak 	struct task deferred_task;
397cdcd52d4SBartosz Sobczak 	struct taskqueue *deferred_tq;
398cdcd52d4SBartosz Sobczak 	bool shared_res_created;
399cdcd52d4SBartosz Sobczak };
400cdcd52d4SBartosz Sobczak 
401cdcd52d4SBartosz Sobczak static inline struct irdma_device *to_iwdev(struct ib_device *ibdev)
402cdcd52d4SBartosz Sobczak {
403cdcd52d4SBartosz Sobczak 	return container_of(ibdev, struct irdma_device, ibdev);
404cdcd52d4SBartosz Sobczak }
405cdcd52d4SBartosz Sobczak 
406cdcd52d4SBartosz Sobczak static inline struct irdma_ucontext *to_ucontext(struct ib_ucontext *ibucontext)
407cdcd52d4SBartosz Sobczak {
408cdcd52d4SBartosz Sobczak 	return container_of(ibucontext, struct irdma_ucontext, ibucontext);
409cdcd52d4SBartosz Sobczak }
410cdcd52d4SBartosz Sobczak 
411cdcd52d4SBartosz Sobczak static inline struct irdma_user_mmap_entry *
412cdcd52d4SBartosz Sobczak to_irdma_mmap_entry(struct rdma_user_mmap_entry *rdma_entry)
413cdcd52d4SBartosz Sobczak {
414cdcd52d4SBartosz Sobczak 	return container_of(rdma_entry, struct irdma_user_mmap_entry,
415cdcd52d4SBartosz Sobczak 			    rdma_entry);
416cdcd52d4SBartosz Sobczak }
417cdcd52d4SBartosz Sobczak 
418cdcd52d4SBartosz Sobczak static inline struct irdma_pd *to_iwpd(struct ib_pd *ibpd)
419cdcd52d4SBartosz Sobczak {
420cdcd52d4SBartosz Sobczak 	return container_of(ibpd, struct irdma_pd, ibpd);
421cdcd52d4SBartosz Sobczak }
422cdcd52d4SBartosz Sobczak 
423cdcd52d4SBartosz Sobczak static inline struct irdma_ah *to_iwah(struct ib_ah *ibah)
424cdcd52d4SBartosz Sobczak {
425cdcd52d4SBartosz Sobczak 	return container_of(ibah, struct irdma_ah, ibah);
426cdcd52d4SBartosz Sobczak }
427cdcd52d4SBartosz Sobczak 
428cdcd52d4SBartosz Sobczak static inline struct irdma_mr *to_iwmr(struct ib_mr *ibmr)
429cdcd52d4SBartosz Sobczak {
430cdcd52d4SBartosz Sobczak 	return container_of(ibmr, struct irdma_mr, ibmr);
431cdcd52d4SBartosz Sobczak }
432cdcd52d4SBartosz Sobczak 
433cdcd52d4SBartosz Sobczak static inline struct irdma_mr *to_iwmw(struct ib_mw *ibmw)
434cdcd52d4SBartosz Sobczak {
435cdcd52d4SBartosz Sobczak 	return container_of(ibmw, struct irdma_mr, ibmw);
436cdcd52d4SBartosz Sobczak }
437cdcd52d4SBartosz Sobczak 
438cdcd52d4SBartosz Sobczak static inline struct irdma_cq *to_iwcq(struct ib_cq *ibcq)
439cdcd52d4SBartosz Sobczak {
440cdcd52d4SBartosz Sobczak 	return container_of(ibcq, struct irdma_cq, ibcq);
441cdcd52d4SBartosz Sobczak }
442cdcd52d4SBartosz Sobczak 
443cdcd52d4SBartosz Sobczak static inline struct irdma_qp *to_iwqp(struct ib_qp *ibqp)
444cdcd52d4SBartosz Sobczak {
445cdcd52d4SBartosz Sobczak 	return container_of(ibqp, struct irdma_qp, ibqp);
446cdcd52d4SBartosz Sobczak }
447cdcd52d4SBartosz Sobczak 
448cdcd52d4SBartosz Sobczak static inline struct irdma_pci_f *dev_to_rf(struct irdma_sc_dev *dev)
449cdcd52d4SBartosz Sobczak {
450cdcd52d4SBartosz Sobczak 	return container_of(dev, struct irdma_pci_f, sc_dev);
451cdcd52d4SBartosz Sobczak }
452cdcd52d4SBartosz Sobczak 
453cdcd52d4SBartosz Sobczak /**
454cdcd52d4SBartosz Sobczak  * irdma_alloc_resource - allocate a resource
455cdcd52d4SBartosz Sobczak  * @iwdev: device pointer
456cdcd52d4SBartosz Sobczak  * @resource_array: resource bit array:
457cdcd52d4SBartosz Sobczak  * @max_resources: maximum resource number
458cdcd52d4SBartosz Sobczak  * @req_resources_num: Allocated resource number
459cdcd52d4SBartosz Sobczak  * @next: next free id
460cdcd52d4SBartosz Sobczak  **/
461cdcd52d4SBartosz Sobczak static inline int irdma_alloc_rsrc(struct irdma_pci_f *rf,
462cdcd52d4SBartosz Sobczak 				   unsigned long *rsrc_array, u32 max_rsrc,
463cdcd52d4SBartosz Sobczak 				   u32 *req_rsrc_num, u32 *next)
464cdcd52d4SBartosz Sobczak {
465cdcd52d4SBartosz Sobczak 	u32 rsrc_num;
466cdcd52d4SBartosz Sobczak 	unsigned long flags;
467cdcd52d4SBartosz Sobczak 
468cdcd52d4SBartosz Sobczak 	spin_lock_irqsave(&rf->rsrc_lock, flags);
469cdcd52d4SBartosz Sobczak 	rsrc_num = find_next_zero_bit(rsrc_array, max_rsrc, *next);
470cdcd52d4SBartosz Sobczak 	if (rsrc_num >= max_rsrc) {
471cdcd52d4SBartosz Sobczak 		rsrc_num = find_first_zero_bit(rsrc_array, max_rsrc);
472cdcd52d4SBartosz Sobczak 		if (rsrc_num >= max_rsrc) {
473cdcd52d4SBartosz Sobczak 			spin_unlock_irqrestore(&rf->rsrc_lock, flags);
474cdcd52d4SBartosz Sobczak 			irdma_debug(&rf->sc_dev, IRDMA_DEBUG_ERR,
475cdcd52d4SBartosz Sobczak 				    "resource [%d] allocation failed\n",
476cdcd52d4SBartosz Sobczak 				    rsrc_num);
477cdcd52d4SBartosz Sobczak 			return -EOVERFLOW;
478cdcd52d4SBartosz Sobczak 		}
479cdcd52d4SBartosz Sobczak 	}
480cdcd52d4SBartosz Sobczak 	__set_bit(rsrc_num, rsrc_array);
481cdcd52d4SBartosz Sobczak 	*next = rsrc_num + 1;
482cdcd52d4SBartosz Sobczak 	if (*next == max_rsrc)
483cdcd52d4SBartosz Sobczak 		*next = 0;
484cdcd52d4SBartosz Sobczak 	*req_rsrc_num = rsrc_num;
485cdcd52d4SBartosz Sobczak 	spin_unlock_irqrestore(&rf->rsrc_lock, flags);
486cdcd52d4SBartosz Sobczak 
487cdcd52d4SBartosz Sobczak 	return 0;
488cdcd52d4SBartosz Sobczak }
489cdcd52d4SBartosz Sobczak 
490cdcd52d4SBartosz Sobczak /**
491cdcd52d4SBartosz Sobczak  * irdma_free_resource - free a resource
492cdcd52d4SBartosz Sobczak  * @iwdev: device pointer
493cdcd52d4SBartosz Sobczak  * @resource_array: resource array for the resource_num
494cdcd52d4SBartosz Sobczak  * @resource_num: resource number to free
495cdcd52d4SBartosz Sobczak  **/
496cdcd52d4SBartosz Sobczak static inline void irdma_free_rsrc(struct irdma_pci_f *rf,
497cdcd52d4SBartosz Sobczak 				   unsigned long *rsrc_array, u32 rsrc_num)
498cdcd52d4SBartosz Sobczak {
499cdcd52d4SBartosz Sobczak 	unsigned long flags;
500cdcd52d4SBartosz Sobczak 
501cdcd52d4SBartosz Sobczak 	spin_lock_irqsave(&rf->rsrc_lock, flags);
502cdcd52d4SBartosz Sobczak 	__clear_bit(rsrc_num, rsrc_array);
503cdcd52d4SBartosz Sobczak 	spin_unlock_irqrestore(&rf->rsrc_lock, flags);
504cdcd52d4SBartosz Sobczak }
505cdcd52d4SBartosz Sobczak 
506cdcd52d4SBartosz Sobczak int irdma_ctrl_init_hw(struct irdma_pci_f *rf);
507cdcd52d4SBartosz Sobczak void irdma_ctrl_deinit_hw(struct irdma_pci_f *rf);
508cdcd52d4SBartosz Sobczak int irdma_rt_init_hw(struct irdma_device *iwdev,
509cdcd52d4SBartosz Sobczak 		     struct irdma_l2params *l2params);
510cdcd52d4SBartosz Sobczak void irdma_rt_deinit_hw(struct irdma_device *iwdev);
511cdcd52d4SBartosz Sobczak void irdma_qp_add_ref(struct ib_qp *ibqp);
512cdcd52d4SBartosz Sobczak void irdma_qp_rem_ref(struct ib_qp *ibqp);
513cdcd52d4SBartosz Sobczak void irdma_free_lsmm_rsrc(struct irdma_qp *iwqp);
514cdcd52d4SBartosz Sobczak struct ib_qp *irdma_get_qp(struct ib_device *ibdev, int qpn);
515cdcd52d4SBartosz Sobczak void irdma_flush_wqes(struct irdma_qp *iwqp, u32 flush_mask);
516*777e472cSBartosz Sobczak void irdma_manage_arp_cache(struct irdma_pci_f *rf, const unsigned char *mac_addr,
517cdcd52d4SBartosz Sobczak 			    u32 *ip_addr, u32 action);
518cdcd52d4SBartosz Sobczak struct irdma_apbvt_entry *irdma_add_apbvt(struct irdma_device *iwdev, u16 port);
519cdcd52d4SBartosz Sobczak void irdma_del_apbvt(struct irdma_device *iwdev,
520cdcd52d4SBartosz Sobczak 		     struct irdma_apbvt_entry *entry);
521cdcd52d4SBartosz Sobczak struct irdma_cqp_request *irdma_alloc_and_get_cqp_request(struct irdma_cqp *cqp,
522cdcd52d4SBartosz Sobczak 							  bool wait);
523cdcd52d4SBartosz Sobczak void irdma_free_cqp_request(struct irdma_cqp *cqp,
524cdcd52d4SBartosz Sobczak 			    struct irdma_cqp_request *cqp_request);
525cdcd52d4SBartosz Sobczak void irdma_put_cqp_request(struct irdma_cqp *cqp,
526cdcd52d4SBartosz Sobczak 			   struct irdma_cqp_request *cqp_request);
527cdcd52d4SBartosz Sobczak int irdma_alloc_local_mac_entry(struct irdma_pci_f *rf, u16 *mac_tbl_idx);
528cdcd52d4SBartosz Sobczak int irdma_add_local_mac_entry(struct irdma_pci_f *rf, u8 *mac_addr, u16 idx);
529cdcd52d4SBartosz Sobczak void irdma_del_local_mac_entry(struct irdma_pci_f *rf, u16 idx);
530cdcd52d4SBartosz Sobczak 
531cdcd52d4SBartosz Sobczak u32 irdma_initialize_hw_rsrc(struct irdma_pci_f *rf);
532cdcd52d4SBartosz Sobczak void irdma_port_ibevent(struct irdma_device *iwdev);
533cdcd52d4SBartosz Sobczak void irdma_cm_disconn(struct irdma_qp *qp);
534cdcd52d4SBartosz Sobczak 
535cdcd52d4SBartosz Sobczak bool irdma_cqp_crit_err(struct irdma_sc_dev *dev, u8 cqp_cmd,
536cdcd52d4SBartosz Sobczak 			u16 maj_err_code, u16 min_err_code);
537cdcd52d4SBartosz Sobczak int irdma_handle_cqp_op(struct irdma_pci_f *rf,
538cdcd52d4SBartosz Sobczak 			struct irdma_cqp_request *cqp_request);
539cdcd52d4SBartosz Sobczak 
540cdcd52d4SBartosz Sobczak int irdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
541cdcd52d4SBartosz Sobczak 		    struct ib_udata *udata);
542cdcd52d4SBartosz Sobczak int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
543cdcd52d4SBartosz Sobczak 			 int attr_mask, struct ib_udata *udata);
544cdcd52d4SBartosz Sobczak void irdma_cq_add_ref(struct ib_cq *ibcq);
545cdcd52d4SBartosz Sobczak void irdma_cq_rem_ref(struct ib_cq *ibcq);
546cdcd52d4SBartosz Sobczak void irdma_cq_wq_destroy(struct irdma_pci_f *rf, struct irdma_sc_cq *cq);
547cdcd52d4SBartosz Sobczak 
548cdcd52d4SBartosz Sobczak void irdma_cleanup_pending_cqp_op(struct irdma_pci_f *rf);
549cdcd52d4SBartosz Sobczak int irdma_hw_modify_qp(struct irdma_device *iwdev, struct irdma_qp *iwqp,
550cdcd52d4SBartosz Sobczak 		       struct irdma_modify_qp_info *info, bool wait);
551cdcd52d4SBartosz Sobczak int irdma_qp_suspend_resume(struct irdma_sc_qp *qp, bool suspend);
552cdcd52d4SBartosz Sobczak int irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo,
553cdcd52d4SBartosz Sobczak 		       enum irdma_quad_entry_type etype,
554cdcd52d4SBartosz Sobczak 		       enum irdma_quad_hash_manage_type mtype, void *cmnode,
555cdcd52d4SBartosz Sobczak 		       bool wait);
556cdcd52d4SBartosz Sobczak void irdma_receive_ilq(struct irdma_sc_vsi *vsi, struct irdma_puda_buf *rbuf);
557cdcd52d4SBartosz Sobczak void irdma_free_sqbuf(struct irdma_sc_vsi *vsi, void *bufp);
558cdcd52d4SBartosz Sobczak void irdma_free_qp_rsrc(struct irdma_qp *iwqp);
559cdcd52d4SBartosz Sobczak int irdma_setup_cm_core(struct irdma_device *iwdev, u8 ver);
560cdcd52d4SBartosz Sobczak void irdma_cleanup_cm_core(struct irdma_cm_core *cm_core);
561cdcd52d4SBartosz Sobczak void irdma_next_iw_state(struct irdma_qp *iwqp, u8 state, u8 del_hash, u8 term,
562cdcd52d4SBartosz Sobczak 			 u8 term_len);
563cdcd52d4SBartosz Sobczak int irdma_send_syn(struct irdma_cm_node *cm_node, u32 sendack);
564cdcd52d4SBartosz Sobczak int irdma_send_reset(struct irdma_cm_node *cm_node);
565cdcd52d4SBartosz Sobczak struct irdma_cm_node *irdma_find_node(struct irdma_cm_core *cm_core,
566cdcd52d4SBartosz Sobczak 				      u16 rem_port, u32 *rem_addr, u16 loc_port,
567cdcd52d4SBartosz Sobczak 				      u32 *loc_addr, u16 vlan_id);
568cdcd52d4SBartosz Sobczak int irdma_hw_flush_wqes(struct irdma_pci_f *rf, struct irdma_sc_qp *qp,
569cdcd52d4SBartosz Sobczak 			struct irdma_qp_flush_info *info, bool wait);
570cdcd52d4SBartosz Sobczak void irdma_gen_ae(struct irdma_pci_f *rf, struct irdma_sc_qp *qp,
571cdcd52d4SBartosz Sobczak 		  struct irdma_gen_ae_info *info, bool wait);
572cdcd52d4SBartosz Sobczak void irdma_copy_ip_ntohl(u32 *dst, __be32 *src);
573cdcd52d4SBartosz Sobczak void irdma_copy_ip_htonl(__be32 *dst, u32 *src);
574cdcd52d4SBartosz Sobczak u16 irdma_get_vlan_ipv4(u32 *addr);
575cdcd52d4SBartosz Sobczak struct ifnet *irdma_netdev_vlan_ipv6(u32 *addr, u16 *vlan_id, u8 *mac);
576cdcd52d4SBartosz Sobczak struct ib_mr *irdma_reg_phys_mr(struct ib_pd *ib_pd, u64 addr, u64 size,
577cdcd52d4SBartosz Sobczak 				int acc, u64 *iova_start);
578cdcd52d4SBartosz Sobczak int irdma_upload_qp_context(struct irdma_qp *iwqp, bool freeze, bool raw);
579cdcd52d4SBartosz Sobczak void irdma_del_hmc_objects(struct irdma_sc_dev *dev,
580cdcd52d4SBartosz Sobczak 			   struct irdma_hmc_info *hmc_info, bool privileged,
581cdcd52d4SBartosz Sobczak 			   bool reset, enum irdma_vers vers);
582cdcd52d4SBartosz Sobczak void irdma_cqp_ce_handler(struct irdma_pci_f *rf, struct irdma_sc_cq *cq);
583cdcd52d4SBartosz Sobczak int irdma_ah_cqp_op(struct irdma_pci_f *rf, struct irdma_sc_ah *sc_ah, u8 cmd,
584cdcd52d4SBartosz Sobczak 		    bool wait,
585cdcd52d4SBartosz Sobczak 		    void (*callback_fcn)(struct irdma_cqp_request *cqp_request),
586cdcd52d4SBartosz Sobczak 		    void *cb_param);
587cdcd52d4SBartosz Sobczak void irdma_gsi_ud_qp_ah_cb(struct irdma_cqp_request *cqp_request);
588cdcd52d4SBartosz Sobczak bool irdma_cq_empty(struct irdma_cq *iwcq);
589*777e472cSBartosz Sobczak int irdma_netdevice_event(struct notifier_block *notifier, unsigned long event,
590*777e472cSBartosz Sobczak 			  void *ptr);
591*777e472cSBartosz Sobczak void irdma_unregister_notifiers(struct irdma_device *iwdev);
592*777e472cSBartosz Sobczak int irdma_register_notifiers(struct irdma_device *iwdev);
593cdcd52d4SBartosz Sobczak void irdma_set_rf_user_cfg_params(struct irdma_pci_f *rf);
594cdcd52d4SBartosz Sobczak void irdma_add_ip(struct irdma_device *iwdev);
595cdcd52d4SBartosz Sobczak void irdma_add_handler(struct irdma_handler *hdl);
596cdcd52d4SBartosz Sobczak void irdma_del_handler(struct irdma_handler *hdl);
597cdcd52d4SBartosz Sobczak void cqp_compl_worker(struct work_struct *work);
598cdcd52d4SBartosz Sobczak #endif /* IRDMA_MAIN_H */
599