4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_IB_ADAPTERS_HERMON_CFG_H
28 #define _SYS_IB_ADAPTERS_HERMON_CFG_H
32 * Contains some prototypes and the structure needed to provided the
33 * Hermon Configuration Profile variables.
36 #include <sys/types.h>
39 #include <sys/sunddi.h>
45 /* For PCIe Relaxed Ordering implementation */
46 #define HERMON_RO_DISABLED 0
47 #define HERMON_RO_ENABLED 1
50 * Configuration profiles
52 #define HERMON_CFG_MEMFREE 0x0001
54 #define HERMON_MAX_PORTS 2
56 #define HERMON_LOG_CMPT_PER_TYPE 24 /* for now, allot 2**24 per */
59 * The hermon_cfg_profile_t structure is used internally by the Hermon driver
60 * to hold all of the configuration information for the driver. It contains
61 * information such as the maximum number (and size) of Hermon's queue pairs.
62 * completion queues, translation tables, etc. It also contains configuration
63 * information such as whether the device is using agents in the Hermon
64 * firmware (i.e. SMA, PMA, BMA) or whether it must register with the IBMF
65 * for management requests. Each of the fields is described below.
67 typedef struct hermon_cfg_profile_s
{
68 /* Number of supported QPs and their maximum size */
69 uint32_t cp_log_num_qp
;
70 uint32_t cp_log_max_qp_sz
;
72 /* Number of supported SGL per WQE */
73 uint32_t cp_wqe_max_sgl
;
74 uint32_t cp_wqe_real_max_sgl
;
76 /* Number of supported CQs and their maximum size */
77 uint32_t cp_log_num_cq
;
78 uint32_t cp_log_max_cq_sz
;
80 /* Number of supported SRQs and their maximum size */
81 uint32_t cp_log_num_srq
;
82 uint32_t cp_log_max_srq_sz
;
83 uint32_t cp_srq_max_sgl
;
84 uint32_t cp_srq_resize_enabled
;
86 /* The max remaps of a particular fmr */
87 uint32_t cp_fmr_max_remaps
;
89 /* Number of EQs, and their default size */
90 uint32_t cp_log_num_eq
;
91 uint32_t cp_log_eq_sz
;
93 /* Number of supported RDBs and their default size */
94 uint32_t cp_log_num_rdb
;
95 uint32_t cp_log_default_rdb_sz
;
98 * Number of support multicast groups, number of QP per multicast
99 * group, and the number of entries (from the total number) in
100 * the multicast group "hash table"
102 uint32_t cp_log_num_mcg
;
103 uint32_t cp_num_qp_per_mcg
;
104 uint32_t cp_log_num_mcg_hash
;
107 * Number of supported MPTs (memory regions and windows) and their
108 * maximum size. Also the number of MTTs.
110 uint32_t cp_log_num_cmpt
; /* control MPTs */
111 uint32_t cp_log_num_dmpt
; /* data MPTs */
112 uint32_t cp_log_max_mrw_sz
;
113 uint32_t cp_log_num_mtt
;
116 * Number of supported Hermon mailboxes ("In" and "Out") and their
117 * maximum sizes, respectively
119 uint32_t cp_log_num_inmbox
;
120 uint32_t cp_log_num_outmbox
;
121 uint32_t cp_log_num_intr_inmbox
;
122 uint32_t cp_log_num_intr_outmbox
;
123 uint32_t cp_log_inmbox_size
;
124 uint32_t cp_log_outmbox_size
;
126 /* Number of supported UAR pages */
127 uint32_t cp_log_num_uar
;
129 /* Number of ICM (4KB) pages per UAR context entry */
130 uint32_t cp_num_pgs_per_uce
;
132 /* Number of supported Protection Domains (PD) */
133 uint32_t cp_log_num_pd
;
135 /* Number of supported Address Handles (AH) */
136 uint32_t cp_log_num_ah
;
139 * Number of supported PKeys per PKey table (i.e. per port). Also the
140 * number of SGID per GID table.
142 uint32_t cp_log_max_pkeytbl
;
143 uint32_t cp_log_max_gidtbl
;
145 /* Maximum "responder resources" and "initiator depth" per QP */
146 uint32_t cp_hca_max_rdma_in_qp
;
147 uint32_t cp_hca_max_rdma_out_qp
;
149 /* Maximum supported MTU and port width */
151 uint32_t cp_max_port_width
;
153 /* Number of supported Virtual Lanes (VL) */
154 uint32_t cp_max_vlcap
;
156 /* Number of supported ports (1 or 2) */
157 uint32_t cp_num_ports
;
160 * Whether or not to use the built-in (i.e. in firmware) agents
161 * for QP0 and QP1, respectively
163 uint32_t cp_qp0_agents_in_fw
;
164 uint32_t cp_qp1_agents_in_fw
;
166 /* Whether DMA mappings should bypass the PCI IOMMU or not */
167 uint32_t cp_iommu_bypass
;
169 /* Delay after software reset */
170 uint32_t cp_sw_reset_delay
;
172 /* Time to wait in-between attempts to poll the 'go' bit */
173 uint32_t cp_cmd_poll_delay
;
175 /* Max time to continue to poll the 'go bit */
176 uint32_t cp_cmd_poll_max
;
178 /* Default AckReq frequency */
179 uint32_t cp_ackreq_freq
;
181 /* Specify whether to use MSI (if available) */
182 uint32_t cp_use_msi_if_avail
;
185 * Used to override SystemImageGUID, NodeGUID and PortGUID(s) as
186 * specified by the Hermon device node properties
188 uint64_t cp_sysimgguid
;
189 uint64_t cp_nodeguid
;
190 uint64_t cp_portguid
[HERMON_MAX_PORTS
];
192 } hermon_cfg_profile_t
;
194 int hermon_cfg_profile_init_phase1(hermon_state_t
*state
);
195 int hermon_cfg_profile_init_phase2(hermon_state_t
*state
);
196 void hermon_cfg_profile_fini(hermon_state_t
*state
);
202 #endif /* _SYS_IB_ADAPTERS_HERMON_CFG_H */