1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35#ifndef MLX4_FW_H
36#define MLX4_FW_H
37
38#include "mlx4.h"
39#include "icm.h"
40
41struct mlx4_mod_stat_cfg {
42 u8 log_pg_sz;
43 u8 log_pg_sz_m;
44};
45
46struct mlx4_port_cap {
47 u8 link_state;
48 u8 supported_port_types;
49 u8 suggested_type;
50 u8 default_sense;
51 u8 log_max_macs;
52 u8 log_max_vlans;
53 int ib_mtu;
54 int max_port_width;
55 int max_vl;
56 int max_gids;
57 int max_pkeys;
58 u64 def_mac;
59 u16 eth_mtu;
60 int trans_type;
61 int vendor_oui;
62 u16 wavelength;
63 u64 trans_code;
64 u8 dmfs_optimized_state;
65};
66
67struct mlx4_dev_cap {
68 int max_srq_sz;
69 int max_qp_sz;
70 int reserved_qps;
71 int max_qps;
72 int reserved_srqs;
73 int max_srqs;
74 int max_cq_sz;
75 int reserved_cqs;
76 int max_cqs;
77 int max_mpts;
78 int reserved_eqs;
79 int max_eqs;
80 int num_sys_eqs;
81 int reserved_mtts;
82 int max_mrw_sz;
83 int reserved_mrws;
84 int max_mtt_seg;
85 int max_requester_per_qp;
86 int max_responder_per_qp;
87 int max_rdma_global;
88 int local_ca_ack_delay;
89 int num_ports;
90 u32 max_msg_sz;
91 u16 stat_rate_support;
92 int fs_log_max_ucast_qp_range_size;
93 int fs_max_num_qp_per_entry;
94 u64 flags;
95 u64 flags2;
96 int reserved_uars;
97 int uar_size;
98 int min_page_sz;
99 int bf_reg_size;
100 int bf_regs_per_page;
101 int max_sq_sg;
102 int max_sq_desc_sz;
103 int max_rq_sg;
104 int max_rq_desc_sz;
105 int max_qp_per_mcg;
106 int reserved_mgms;
107 int max_mcgs;
108 int reserved_pds;
109 int max_pds;
110 int reserved_xrcds;
111 int max_xrcds;
112 int qpc_entry_sz;
113 int rdmarc_entry_sz;
114 int altc_entry_sz;
115 int aux_entry_sz;
116 int srq_entry_sz;
117 int cqc_entry_sz;
118 int eqc_entry_sz;
119 int dmpt_entry_sz;
120 int cmpt_entry_sz;
121 int mtt_entry_sz;
122 int resize_srq;
123 u32 bmme_flags;
124 u32 reserved_lkey;
125 u64 max_icm_sz;
126 int max_gso_sz;
127 int max_rss_tbl_sz;
128 u32 max_counters;
129 u32 dmfs_high_rate_qpn_base;
130 u32 dmfs_high_rate_qpn_range;
131 struct mlx4_rate_limit_caps rl_caps;
132 struct mlx4_port_cap port_cap[MLX4_MAX_PORTS + 1];
133};
134
135struct mlx4_func_cap {
136 u8 num_ports;
137 u8 flags;
138 u32 pf_context_behaviour;
139 int qp_quota;
140 int cq_quota;
141 int srq_quota;
142 int mpt_quota;
143 int mtt_quota;
144 int max_eq;
145 int reserved_eq;
146 int mcg_quota;
147 u32 qp0_qkey;
148 u32 qp0_tunnel_qpn;
149 u32 qp0_proxy_qpn;
150 u32 qp1_tunnel_qpn;
151 u32 qp1_proxy_qpn;
152 u32 reserved_lkey;
153 u8 physical_port;
154 u8 port_flags;
155 u8 flags1;
156 u64 phys_port_id;
157 u32 extra_flags;
158};
159
160struct mlx4_func {
161 int bus;
162 int device;
163 int function;
164 int physical_function;
165 int rsvd_eqs;
166 int max_eq;
167 int rsvd_uars;
168};
169
170struct mlx4_adapter {
171 char board_id[MLX4_BOARD_ID_LEN];
172 u8 inta_pin;
173};
174
175struct mlx4_init_hca_param {
176 u64 qpc_base;
177 u64 rdmarc_base;
178 u64 auxc_base;
179 u64 altc_base;
180 u64 srqc_base;
181 u64 cqc_base;
182 u64 eqc_base;
183 u64 mc_base;
184 u64 dmpt_base;
185 u64 cmpt_base;
186 u64 mtt_base;
187 u64 global_caps;
188 u16 log_mc_entry_sz;
189 u16 log_mc_hash_sz;
190 u16 hca_core_clock;
191 u8 log_num_qps;
192 u8 log_num_srqs;
193 u8 log_num_cqs;
194 u8 log_num_eqs;
195 u16 num_sys_eqs;
196 u8 log_rd_per_qp;
197 u8 log_mc_table_sz;
198 u8 log_mpt_sz;
199 u8 log_uar_sz;
200 u8 mw_enabled;
201 u8 uar_page_sz;
202 u8 steering_mode;
203 u8 dmfs_high_steer_mode;
204 u64 dev_cap_enabled;
205 u16 cqe_size;
206 u16 eqe_size;
207 u8 rss_ip_frags;
208 u8 phv_check_en;
209};
210
211struct mlx4_init_ib_param {
212 int port_width;
213 int vl_cap;
214 int mtu_cap;
215 u16 gid_cap;
216 u16 pkey_cap;
217 int set_guid0;
218 u64 guid0;
219 int set_node_guid;
220 u64 node_guid;
221 int set_si_guid;
222 u64 si_guid;
223};
224
225struct mlx4_set_ib_param {
226 int set_si_guid;
227 int reset_qkey_viol;
228 u64 si_guid;
229 u32 cap_mask;
230};
231
232void mlx4_dev_cap_dump(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
233int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
234int mlx4_QUERY_PORT(struct mlx4_dev *dev, int port, struct mlx4_port_cap *port_cap);
235int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
236 struct mlx4_func_cap *func_cap);
237int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
238 struct mlx4_vhcr *vhcr,
239 struct mlx4_cmd_mailbox *inbox,
240 struct mlx4_cmd_mailbox *outbox,
241 struct mlx4_cmd_info *cmd);
242int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave);
243int mlx4_MAP_FA(struct mlx4_dev *dev, struct mlx4_icm *icm);
244int mlx4_UNMAP_FA(struct mlx4_dev *dev);
245int mlx4_RUN_FW(struct mlx4_dev *dev);
246int mlx4_QUERY_FW(struct mlx4_dev *dev);
247int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter);
248int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
249int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
250int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic);
251int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt);
252int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
253int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
254int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
255int mlx4_NOP(struct mlx4_dev *dev);
256int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
257void mlx4_opreq_action(struct work_struct *work);
258
259#endif
260