xref: /onnv-gate/usr/src/uts/common/sys/ib/adapters/hermon/hermon_cq.h (revision 12965:b65a8427f8fe)
19517SBill.Taylor@Sun.COM /*
29517SBill.Taylor@Sun.COM  * CDDL HEADER START
39517SBill.Taylor@Sun.COM  *
49517SBill.Taylor@Sun.COM  * The contents of this file are subject to the terms of the
59517SBill.Taylor@Sun.COM  * Common Development and Distribution License (the "License").
69517SBill.Taylor@Sun.COM  * You may not use this file except in compliance with the License.
79517SBill.Taylor@Sun.COM  *
89517SBill.Taylor@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99517SBill.Taylor@Sun.COM  * or http://www.opensolaris.org/os/licensing.
109517SBill.Taylor@Sun.COM  * See the License for the specific language governing permissions
119517SBill.Taylor@Sun.COM  * and limitations under the License.
129517SBill.Taylor@Sun.COM  *
139517SBill.Taylor@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
149517SBill.Taylor@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159517SBill.Taylor@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
169517SBill.Taylor@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
179517SBill.Taylor@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
189517SBill.Taylor@Sun.COM  *
199517SBill.Taylor@Sun.COM  * CDDL HEADER END
209517SBill.Taylor@Sun.COM  */
219517SBill.Taylor@Sun.COM 
229517SBill.Taylor@Sun.COM /*
23*12965SWilliam.Taylor@Oracle.COM  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
249517SBill.Taylor@Sun.COM  */
259517SBill.Taylor@Sun.COM 
269517SBill.Taylor@Sun.COM #ifndef	_SYS_IB_ADAPTERS_HERMON_CQ_H
279517SBill.Taylor@Sun.COM #define	_SYS_IB_ADAPTERS_HERMON_CQ_H
289517SBill.Taylor@Sun.COM 
299517SBill.Taylor@Sun.COM /*
309517SBill.Taylor@Sun.COM  * hermon_cq.h
319517SBill.Taylor@Sun.COM  *    Contains all of the prototypes, #defines, and structures necessary
329517SBill.Taylor@Sun.COM  *    for the Completion Queue Processing routines.
339517SBill.Taylor@Sun.COM  *    Specifically it contains the various completion types, flags,
349517SBill.Taylor@Sun.COM  *    structures used for managing Hermon completion queues, and prototypes
359517SBill.Taylor@Sun.COM  *    for many of the functions consumed by other parts of the Hermon driver
369517SBill.Taylor@Sun.COM  *    (including those routines directly exposed through the IBTF CI
379517SBill.Taylor@Sun.COM  *    interface).
389517SBill.Taylor@Sun.COM  *
399517SBill.Taylor@Sun.COM  *    Most of the values defined below establish default values which,
409517SBill.Taylor@Sun.COM  *    where indicated, can be controlled via their related patchable values,
419517SBill.Taylor@Sun.COM  *    if 'hermon_alt_config_enable' is set.
429517SBill.Taylor@Sun.COM  */
439517SBill.Taylor@Sun.COM 
449517SBill.Taylor@Sun.COM #include <sys/types.h>
459517SBill.Taylor@Sun.COM #include <sys/conf.h>
469517SBill.Taylor@Sun.COM #include <sys/ddi.h>
479517SBill.Taylor@Sun.COM #include <sys/sunddi.h>
489517SBill.Taylor@Sun.COM 
499517SBill.Taylor@Sun.COM #include <sys/ib/adapters/hermon/hermon_misc.h>
509517SBill.Taylor@Sun.COM 
519517SBill.Taylor@Sun.COM #ifdef __cplusplus
529517SBill.Taylor@Sun.COM extern "C" {
539517SBill.Taylor@Sun.COM #endif
549517SBill.Taylor@Sun.COM 
559517SBill.Taylor@Sun.COM /*
569517SBill.Taylor@Sun.COM  * The following defines the default number of Completion Queues. This
579517SBill.Taylor@Sun.COM  * is controllable via the "hermon_log_num_cq" configuration variable.
589517SBill.Taylor@Sun.COM  * We also have a define for the minimum size of a CQ.  CQs allocated
59*12965SWilliam.Taylor@Oracle.COM  * with size "less than a page" will always get back a page.
609517SBill.Taylor@Sun.COM  */
61*12965SWilliam.Taylor@Oracle.COM #define	HERMON_NUM_CQ_SHIFT		0x12
629517SBill.Taylor@Sun.COM 
639517SBill.Taylor@Sun.COM #define	HERMON_CQ_MIN_SIZE	((PAGESIZE / 32) - 1)
649517SBill.Taylor@Sun.COM 
659517SBill.Taylor@Sun.COM /*
669517SBill.Taylor@Sun.COM  * These are the defines for the Hermon CQ completion statuses.
679517SBill.Taylor@Sun.COM  */
689517SBill.Taylor@Sun.COM #define	HERMON_CQE_SUCCESS		0x0
699517SBill.Taylor@Sun.COM #define	HERMON_CQE_LOC_LEN_ERR		0x1
709517SBill.Taylor@Sun.COM #define	HERMON_CQE_LOC_OP_ERR		0x2
719517SBill.Taylor@Sun.COM #define	HERMON_CQE_LOC_PROT_ERR		0x4
729517SBill.Taylor@Sun.COM #define	HERMON_CQE_WR_FLUSHED_ERR	0x5
739517SBill.Taylor@Sun.COM #define	HERMON_CQE_MW_BIND_ERR		0x6
749517SBill.Taylor@Sun.COM #define	HERMON_CQE_BAD_RESPONSE_ERR	0x10
759517SBill.Taylor@Sun.COM #define	HERMON_CQE_LOCAL_ACCESS_ERR	0x11
769517SBill.Taylor@Sun.COM #define	HERMON_CQE_REM_INV_REQ_ERR	0x12
779517SBill.Taylor@Sun.COM #define	HERMON_CQE_REM_ACC_ERR		0x13
789517SBill.Taylor@Sun.COM #define	HERMON_CQE_REM_OP_ERR		0x14
799517SBill.Taylor@Sun.COM #define	HERMON_CQE_TRANS_TO_ERR		0x15
809517SBill.Taylor@Sun.COM #define	HERMON_CQE_RNRNAK_TO_ERR	0x16
819517SBill.Taylor@Sun.COM #define	HERMON_CQE_EEC_REM_ABORTED_ERR	0x22
829517SBill.Taylor@Sun.COM 
839517SBill.Taylor@Sun.COM /*
849517SBill.Taylor@Sun.COM  * These are the defines for the Hermon CQ entry types. They indicate what type
859517SBill.Taylor@Sun.COM  * of work request is completing (for successful completions).  Note: The
869517SBill.Taylor@Sun.COM  * "SND" or "RCV" in each define is used to indicate whether the completion
879517SBill.Taylor@Sun.COM  * work request was from the Send work queue or the Receive work queue on
889517SBill.Taylor@Sun.COM  * the associated QP.
899517SBill.Taylor@Sun.COM  */
909517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_NOP		0x0
91*12965SWilliam.Taylor@Oracle.COM #define	HERMON_CQE_SND_SEND_INV		0x1
929517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_RDMAWR		0x8
939517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_RDMAWR_IMM	0x9
949517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_SEND		0xA
959517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_SEND_IMM		0xB
969517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_LSO		0xE
979517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_RDMARD		0x10
989517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_ATOMIC_CS	0x11
999517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_ATOMIC_FA	0x12
1009517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_ATOMIC_CS_EX	0x14
1019517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_ATOMIC_FC_EX	0x15
1029517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_FRWR		0x19
1039517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_LCL_INV		0x1B
1049517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_CONFIG		0x1F
1059517SBill.Taylor@Sun.COM #define	HERMON_CQE_SND_BIND_MW		0x18
1069517SBill.Taylor@Sun.COM 
1079517SBill.Taylor@Sun.COM #define	HERMON_CQE_RCV_RDMAWR_IMM	0x00
1089517SBill.Taylor@Sun.COM #define	HERMON_CQE_RCV_SEND		0x01
1099517SBill.Taylor@Sun.COM #define	HERMON_CQE_RCV_SEND_IMM		0x02
110*12965SWilliam.Taylor@Oracle.COM #define	HERMON_CQE_RCV_SEND_INV		0x03
1119517SBill.Taylor@Sun.COM #define	HERMON_CQE_RCV_ERROR_CODE	0x1E
1129517SBill.Taylor@Sun.COM #define	HERMON_CQE_RCV_RESIZE_CODE	0x16
1139517SBill.Taylor@Sun.COM 
1149517SBill.Taylor@Sun.COM 
1159517SBill.Taylor@Sun.COM /* Define for maximum CQ number mask (CQ number is 24 bits) */
1169517SBill.Taylor@Sun.COM #define	HERMON_CQ_MAXNUMBER_MSK		0xFFFFFF
1179517SBill.Taylor@Sun.COM 
118*12965SWilliam.Taylor@Oracle.COM /*
119*12965SWilliam.Taylor@Oracle.COM  * CQ Sched Management
120*12965SWilliam.Taylor@Oracle.COM  *
121*12965SWilliam.Taylor@Oracle.COM  *	Each hermon_cq_sched struct defines a range of cq handler_id's
122*12965SWilliam.Taylor@Oracle.COM  *	assigned to the cq_sched instance.  Also, the "next_alloc"
123*12965SWilliam.Taylor@Oracle.COM  *	member is used to allocate handler_id's in a round robin fashion.
124*12965SWilliam.Taylor@Oracle.COM  *
125*12965SWilliam.Taylor@Oracle.COM  *	Valid cq handler_id's are in the range of 1 to hs_intrmsi_allocd.
126*12965SWilliam.Taylor@Oracle.COM  *	They are indexes into the hs_intrmsi_hdl array.
127*12965SWilliam.Taylor@Oracle.COM  */
128*12965SWilliam.Taylor@Oracle.COM #define	HERMON_CQH_MAX	32
129*12965SWilliam.Taylor@Oracle.COM typedef struct hermon_cq_sched_s {
130*12965SWilliam.Taylor@Oracle.COM 	char	cqs_name[HERMON_CQH_MAX];
131*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_start_hid;
132*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_len;
133*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_next_alloc;
134*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_desired;
135*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_minimum;
136*12965SWilliam.Taylor@Oracle.COM 	uint_t	cqs_refcnt;	/* could be alloc'ed more than once */
137*12965SWilliam.Taylor@Oracle.COM } hermon_cq_sched_t;
1389517SBill.Taylor@Sun.COM 
1399517SBill.Taylor@Sun.COM /*
1409517SBill.Taylor@Sun.COM  * new EQ mgmt - per domain (when it gets there).
141*12965SWilliam.Taylor@Oracle.COM  * The first hs_rsvd_eqs are reserved by the firmware.
142*12965SWilliam.Taylor@Oracle.COM  * The next hs_intrmsi_allocd are for CQ Completions.
143*12965SWilliam.Taylor@Oracle.COM  * Each of these "completion" EQs has a unique interrupt vector.
144*12965SWilliam.Taylor@Oracle.COM  * The EQs following that are:
1459517SBill.Taylor@Sun.COM  *
1469517SBill.Taylor@Sun.COM  *	1 for CQ Errors
1479517SBill.Taylor@Sun.COM  *	1 for Asyncs and Command Completions, and finally
1489517SBill.Taylor@Sun.COM  *	1 for All Other events.
1499517SBill.Taylor@Sun.COM  *
150*12965SWilliam.Taylor@Oracle.COM  * share the last of the interrupt vectors.
1519517SBill.Taylor@Sun.COM  */
152*12965SWilliam.Taylor@Oracle.COM #define	HERMON_CQSCHED_NEXT_HID(cq_schedp)				\
153*12965SWilliam.Taylor@Oracle.COM 	((atomic_inc_uint_nv(&(cq_schedp)->cqs_next_alloc) %		\
154*12965SWilliam.Taylor@Oracle.COM 	    (cq_schedp)->cqs_len) + (cq_schedp)->cqs_start_hid)
1559517SBill.Taylor@Sun.COM 
156*12965SWilliam.Taylor@Oracle.COM #define	HERMON_HID_TO_EQNUM(state, hid)					\
157*12965SWilliam.Taylor@Oracle.COM 	((state)->hs_rsvd_eqs + (hid) - 1)
158*12965SWilliam.Taylor@Oracle.COM 
159*12965SWilliam.Taylor@Oracle.COM #define	HERMON_HID_VALID(state, hid)					\
160*12965SWilliam.Taylor@Oracle.COM 	((uint_t)((hid) - 1) < (state)->hs_intrmsi_allocd)
161*12965SWilliam.Taylor@Oracle.COM 
162*12965SWilliam.Taylor@Oracle.COM #define	HERMON_EQNUM_TO_HID(state, eqnum)				\
163*12965SWilliam.Taylor@Oracle.COM 	((eqnum) - (state)->hs_rsvd_eqs + 1)
1649517SBill.Taylor@Sun.COM 
1659517SBill.Taylor@Sun.COM #define	HERMON_CQ_ERREQNUM_GET(state)					\
166*12965SWilliam.Taylor@Oracle.COM 	(state)->hs_cq_erreqnum
167*12965SWilliam.Taylor@Oracle.COM 
1689517SBill.Taylor@Sun.COM /*
1699517SBill.Taylor@Sun.COM  * The following defines are used for Hermon CQ error handling.  Note: For
1709517SBill.Taylor@Sun.COM  * CQEs which correspond to error events, the Hermon device requires some
1719517SBill.Taylor@Sun.COM  * special handling by software.  These defines are used to identify and
1729517SBill.Taylor@Sun.COM  * extract the necessary information from each error CQE, including status
1739517SBill.Taylor@Sun.COM  * code (above), doorbell count, and whether a error completion is for a
1749517SBill.Taylor@Sun.COM  * send or receive work request.
1759517SBill.Taylor@Sun.COM  */
1769517SBill.Taylor@Sun.COM #define	HERMON_CQE_ERR_STATUS_SHIFT	0
1779517SBill.Taylor@Sun.COM #define	HERMON_CQE_ERR_STATUS_MASK	0xFF
1789517SBill.Taylor@Sun.COM #define	HERMON_CQE_ERR_DBDCNT_MASK	0xFFFF
1799517SBill.Taylor@Sun.COM #define	HERMON_CQE_SEND_ERR_OPCODE	0x1E
1809517SBill.Taylor@Sun.COM #define	HERMON_CQE_RECV_ERR_OPCODE	0x1E
1819517SBill.Taylor@Sun.COM 
1829517SBill.Taylor@Sun.COM /* Defines for tracking whether a CQ is being used with special QP or not */
1839517SBill.Taylor@Sun.COM #define	HERMON_CQ_IS_NORMAL		0
1849517SBill.Taylor@Sun.COM #define	HERMON_CQ_IS_SPECIAL		1
1859517SBill.Taylor@Sun.COM 
1869517SBill.Taylor@Sun.COM /*
1879517SBill.Taylor@Sun.COM  * The hermon_sw_cq_s structure is also referred to using the "hermon_cqhdl_t"
1889517SBill.Taylor@Sun.COM  * typedef (see hermon_typedef.h).  It encodes all the information necessary
1899517SBill.Taylor@Sun.COM  * to track the various resources needed to allocate, initialize, poll, resize,
1909517SBill.Taylor@Sun.COM  * and (later) free a completion queue (CQ).
1919517SBill.Taylor@Sun.COM  *
1929517SBill.Taylor@Sun.COM  * Specifically, it has a consumer index and a lock to ensure single threaded
1939517SBill.Taylor@Sun.COM  * access to it.  It has pointers to the various resources allocated for the
1949517SBill.Taylor@Sun.COM  * completion queue, i.e. a CQC resource and the memory for the completion
1959517SBill.Taylor@Sun.COM  * queue itself. It also has a reference count and the number(s) of the EQs
1969517SBill.Taylor@Sun.COM  * to which it is associated (for success and for errors).
1979517SBill.Taylor@Sun.COM  *
1989517SBill.Taylor@Sun.COM  * Additionally, it has a pointer to the associated MR handle (for the mapped
1999517SBill.Taylor@Sun.COM  * queue memory) and a void pointer that holds the argument that should be
2009517SBill.Taylor@Sun.COM  * passed back to the IBTF when events are generated on the CQ.
2019517SBill.Taylor@Sun.COM  *
2029517SBill.Taylor@Sun.COM  * We also have the always necessary backpointer to the resource for the
2039517SBill.Taylor@Sun.COM  * CQ handle structure itself.  But we also have pointers to the "Work Request
2049517SBill.Taylor@Sun.COM  * ID" processing lists (both the lock and the regular list, as well as the
2059517SBill.Taylor@Sun.COM  * head and tail for the "reapable" list).  See hermon_wrid.c for more details.
2069517SBill.Taylor@Sun.COM  */
2079517SBill.Taylor@Sun.COM 
2089517SBill.Taylor@Sun.COM #define	HERMON_CQ_DEF_UAR_DOORBELL	0x11	/* cmd_sn = 1, req solicited */
2099517SBill.Taylor@Sun.COM #define	HERMON_CD_DEF_UAR_DB_SHIFT	0x38	/* decimal 56 */
2109517SBill.Taylor@Sun.COM 
2119517SBill.Taylor@Sun.COM struct hermon_sw_cq_s {
2129517SBill.Taylor@Sun.COM 	kmutex_t		cq_lock;
2139517SBill.Taylor@Sun.COM 	struct hermon_sw_cq_s 	*cq_resize_hdl; /* points to tranistory hdl */
2149517SBill.Taylor@Sun.COM 	uint32_t		cq_consindx;
2159517SBill.Taylor@Sun.COM 	uint32_t		cq_cqnum;
2169517SBill.Taylor@Sun.COM 	hermon_hw_cqe_t		*cq_buf;
2179517SBill.Taylor@Sun.COM 	hermon_mrhdl_t		cq_mrhdl;
2189517SBill.Taylor@Sun.COM 	uint32_t		cq_bufsz;
2199517SBill.Taylor@Sun.COM 	uint32_t		cq_log_cqsz;
2209517SBill.Taylor@Sun.COM 	uint_t			cq_refcnt;
2219517SBill.Taylor@Sun.COM 	uint32_t		cq_eqnum;
2229517SBill.Taylor@Sun.COM 	uint32_t		cq_erreqnum;
2239517SBill.Taylor@Sun.COM 	uint_t			cq_is_special;
2249517SBill.Taylor@Sun.COM 	uint_t			cq_is_umap;
2259517SBill.Taylor@Sun.COM 	uint32_t		cq_uarpg;
2269517SBill.Taylor@Sun.COM 	devmap_cookie_t		cq_umap_dhp;
2279517SBill.Taylor@Sun.COM 	hermon_rsrc_t		*cq_cqcrsrcp;
2289517SBill.Taylor@Sun.COM 	hermon_rsrc_t		*cq_rsrcp;
2299517SBill.Taylor@Sun.COM 	uint_t			cq_intmod_count;
2309517SBill.Taylor@Sun.COM 	uint_t			cq_intmod_usec;
2319517SBill.Taylor@Sun.COM 
2329517SBill.Taylor@Sun.COM 	/* DoorBell Record Information */
2339517SBill.Taylor@Sun.COM 	ddi_acc_handle_t	cq_arm_ci_dbr_acchdl;
2349517SBill.Taylor@Sun.COM 	hermon_dbr_t		*cq_arm_ci_vdbr;
2359517SBill.Taylor@Sun.COM 	uint64_t		cq_arm_ci_pdbr;
2369517SBill.Taylor@Sun.COM 	uint64_t		cq_dbr_mapoffset;	/* user mode access */
2379517SBill.Taylor@Sun.COM 
2389517SBill.Taylor@Sun.COM 	void			*cq_hdlrarg;
2399517SBill.Taylor@Sun.COM 
2409517SBill.Taylor@Sun.COM 	/* For Work Request ID processing */
2419517SBill.Taylor@Sun.COM 	avl_tree_t		cq_wrid_wqhdr_avl_tree;
2429517SBill.Taylor@Sun.COM 
2439517SBill.Taylor@Sun.COM 	struct hermon_qalloc_info_s cq_cqinfo;
2449517SBill.Taylor@Sun.COM };
2459517SBill.Taylor@Sun.COM _NOTE(READ_ONLY_DATA(hermon_sw_cq_s::cq_cqnum
2469517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_erreqnum
2479517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_cqcrsrcp
2489517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_rsrcp
2499517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_hdlrarg
2509517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_is_umap
2519517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_uarpg))
2529517SBill.Taylor@Sun.COM _NOTE(DATA_READABLE_WITHOUT_LOCK(hermon_sw_cq_s::cq_bufsz
2539517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_consindx
2549517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_cqinfo))
2559517SBill.Taylor@Sun.COM _NOTE(MUTEX_PROTECTS_DATA(hermon_sw_cq_s::cq_lock,
2569517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_buf
257*12965SWilliam.Taylor@Oracle.COM     hermon_sw_cq_s::cq_eqnum
2589517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_mrhdl
2599517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_refcnt
2609517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_is_special
2619517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_umap_dhp))
2629517SBill.Taylor@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("safe sharing",
2639517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_intmod_count
2649517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_intmod_usec
2659517SBill.Taylor@Sun.COM     hermon_sw_cq_s::cq_resize_hdl))
2669517SBill.Taylor@Sun.COM 
2679517SBill.Taylor@Sun.COM int hermon_cq_alloc(hermon_state_t *state, ibt_cq_hdl_t ibt_cqhdl,
2689517SBill.Taylor@Sun.COM     ibt_cq_attr_t *attr_p, uint_t *actual_size, hermon_cqhdl_t *cqhdl,
2699517SBill.Taylor@Sun.COM     uint_t sleepflag);
2709517SBill.Taylor@Sun.COM int hermon_cq_free(hermon_state_t *state, hermon_cqhdl_t *cqhdl,
2719517SBill.Taylor@Sun.COM     uint_t sleepflag);
2729517SBill.Taylor@Sun.COM int hermon_cq_resize(hermon_state_t *state, hermon_cqhdl_t cqhdl,
2739517SBill.Taylor@Sun.COM     uint_t req_size, uint_t *actual_size, uint_t sleepflag);
2749517SBill.Taylor@Sun.COM int hermon_cq_modify(hermon_state_t *state, hermon_cqhdl_t cqhdl,
2759517SBill.Taylor@Sun.COM     uint_t count, uint_t usec, ibt_cq_handler_id_t hid, uint_t sleepflag);
2769517SBill.Taylor@Sun.COM int hermon_cq_notify(hermon_state_t *state, hermon_cqhdl_t cqhdl,
2779517SBill.Taylor@Sun.COM     ibt_cq_notify_flags_t flags);
2789517SBill.Taylor@Sun.COM int hermon_cq_poll(hermon_state_t *state, hermon_cqhdl_t cqhdl, ibt_wc_t *wc_p,
2799517SBill.Taylor@Sun.COM     uint_t num_wc, uint_t *num_polled);
280*12965SWilliam.Taylor@Oracle.COM int hermon_cq_sched_alloc(hermon_state_t *state, ibt_cq_sched_attr_t *attr,
281*12965SWilliam.Taylor@Oracle.COM     hermon_cq_sched_t **cq_sched_pp);
282*12965SWilliam.Taylor@Oracle.COM int hermon_cq_sched_free(hermon_state_t *state, hermon_cq_sched_t *cq_schedp);
2839517SBill.Taylor@Sun.COM int hermon_cq_handler(hermon_state_t *state, hermon_eqhdl_t eq,
2849517SBill.Taylor@Sun.COM     hermon_hw_eqe_t *eqe);
2859517SBill.Taylor@Sun.COM int hermon_cq_err_handler(hermon_state_t *state, hermon_eqhdl_t eq,
2869517SBill.Taylor@Sun.COM     hermon_hw_eqe_t *eqe);
2879517SBill.Taylor@Sun.COM int hermon_cq_refcnt_inc(hermon_cqhdl_t cq, uint_t is_special);
2889517SBill.Taylor@Sun.COM void hermon_cq_refcnt_dec(hermon_cqhdl_t cq);
2899517SBill.Taylor@Sun.COM hermon_cqhdl_t hermon_cqhdl_from_cqnum(hermon_state_t *state, uint_t cqnum);
2909517SBill.Taylor@Sun.COM void hermon_cq_entries_flush(hermon_state_t *state, hermon_qphdl_t qp);
2919517SBill.Taylor@Sun.COM void hermon_cq_resize_helper(hermon_state_t *state, hermon_cqhdl_t cq);
292*12965SWilliam.Taylor@Oracle.COM int hermon_cq_sched_init(hermon_state_t *state);
293*12965SWilliam.Taylor@Oracle.COM void hermon_cq_sched_fini(hermon_state_t *state);
2949517SBill.Taylor@Sun.COM 
2959517SBill.Taylor@Sun.COM #ifdef __cplusplus
2969517SBill.Taylor@Sun.COM }
2979517SBill.Taylor@Sun.COM #endif
2989517SBill.Taylor@Sun.COM 
2999517SBill.Taylor@Sun.COM #endif	/* _SYS_IB_ADAPTERS_HERMON_CQ_H */
300