fw.h 6.6 KB
Newer Older
1 2
/*
 * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
3
 * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved.
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 36 37 38 39 40
 * Copyright (c) 2006, 2007 Cisco Systems.  All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef MLX4_FW_H
#define MLX4_FW_H

#include "mlx4.h"
#include "icm.h"

41 42 43 44 45
struct mlx4_mod_stat_cfg {
	u8 log_pg_sz;
	u8 log_pg_sz_m;
};

M
Matan Barak 已提交
46
struct mlx4_port_cap {
47
	u8  link_state;
M
Matan Barak 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
	u8  supported_port_types;
	u8  suggested_type;
	u8  default_sense;
	u8  log_max_macs;
	u8  log_max_vlans;
	int ib_mtu;
	int max_port_width;
	int max_vl;
	int max_gids;
	int max_pkeys;
	u64 def_mac;
	u16 eth_mtu;
	int trans_type;
	int vendor_oui;
	u16 wavelength;
	u64 trans_code;
64
	u8 dmfs_optimized_state;
M
Matan Barak 已提交
65 66
};

67 68 69 70 71 72 73 74 75 76 77 78 79
struct mlx4_dev_cap {
	int max_srq_sz;
	int max_qp_sz;
	int reserved_qps;
	int max_qps;
	int reserved_srqs;
	int max_srqs;
	int max_cq_sz;
	int reserved_cqs;
	int max_cqs;
	int max_mpts;
	int reserved_eqs;
	int max_eqs;
80
	int num_sys_eqs;
81 82 83 84 85 86 87 88 89
	int reserved_mtts;
	int max_mrw_sz;
	int reserved_mrws;
	int max_mtt_seg;
	int max_requester_per_qp;
	int max_responder_per_qp;
	int max_rdma_global;
	int local_ca_ack_delay;
	int num_ports;
90
	u32 max_msg_sz;
91
	u16 stat_rate_support;
92 93
	int fs_log_max_ucast_qp_range_size;
	int fs_max_num_qp_per_entry;
94
	u64 flags;
95
	u64 flags2;
96 97 98 99 100 101 102 103 104 105 106 107 108 109
	int reserved_uars;
	int uar_size;
	int min_page_sz;
	int bf_reg_size;
	int bf_regs_per_page;
	int max_sq_sg;
	int max_sq_desc_sz;
	int max_rq_sg;
	int max_rq_desc_sz;
	int max_qp_per_mcg;
	int reserved_mgms;
	int max_mcgs;
	int reserved_pds;
	int max_pds;
S
Sean Hefty 已提交
110 111
	int reserved_xrcds;
	int max_xrcds;
112 113 114 115 116 117 118 119 120 121 122
	int qpc_entry_sz;
	int rdmarc_entry_sz;
	int altc_entry_sz;
	int aux_entry_sz;
	int srq_entry_sz;
	int cqc_entry_sz;
	int eqc_entry_sz;
	int dmpt_entry_sz;
	int cmpt_entry_sz;
	int mtt_entry_sz;
	int resize_srq;
123
	u32 bmme_flags;
124 125
	u32 reserved_lkey;
	u64 max_icm_sz;
E
Eli Cohen 已提交
126
	int max_gso_sz;
127
	int max_rss_tbl_sz;
128
	u32 max_counters;
129 130
	u32 dmfs_high_rate_qpn_base;
	u32 dmfs_high_rate_qpn_range;
131
	struct mlx4_rate_limit_caps rl_caps;
M
Matan Barak 已提交
132
	struct mlx4_port_cap port_cap[MLX4_MAX_PORTS + 1];
133 134
};

135 136 137 138 139 140 141 142 143 144 145 146
struct mlx4_func_cap {
	u8	num_ports;
	u8	flags;
	u32	pf_context_behaviour;
	int	qp_quota;
	int	cq_quota;
	int	srq_quota;
	int	mpt_quota;
	int	mtt_quota;
	int	max_eq;
	int	reserved_eq;
	int	mcg_quota;
147
	u32	qp0_qkey;
148 149 150 151
	u32	qp0_tunnel_qpn;
	u32	qp0_proxy_qpn;
	u32	qp1_tunnel_qpn;
	u32	qp1_proxy_qpn;
152
	u32	reserved_lkey;
153 154
	u8	physical_port;
	u8	port_flags;
155
	u8	flags1;
156
	u64	phys_port_id;
157
	u32	extra_flags;
158 159
};

160 161 162 163 164 165 166 167 168 169
struct mlx4_func {
	int	bus;
	int	device;
	int	function;
	int	physical_function;
	int	rsvd_eqs;
	int	max_eq;
	int	rsvd_uars;
};

170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
struct mlx4_adapter {
	char board_id[MLX4_BOARD_ID_LEN];
	u8   inta_pin;
};

struct mlx4_init_hca_param {
	u64 qpc_base;
	u64 rdmarc_base;
	u64 auxc_base;
	u64 altc_base;
	u64 srqc_base;
	u64 cqc_base;
	u64 eqc_base;
	u64 mc_base;
	u64 dmpt_base;
	u64 cmpt_base;
	u64 mtt_base;
187
	u64 global_caps;
188 189
	u16 log_mc_entry_sz;
	u16 log_mc_hash_sz;
190
	u16 hca_core_clock; /* Internal Clock Frequency (in MHz) */
191 192 193 194
	u8  log_num_qps;
	u8  log_num_srqs;
	u8  log_num_cqs;
	u8  log_num_eqs;
195
	u16 num_sys_eqs;
196 197 198 199
	u8  log_rd_per_qp;
	u8  log_mc_table_sz;
	u8  log_mpt_sz;
	u8  log_uar_sz;
200
	u8  mw_enabled;  /* Enable memory windows */
201
	u8  uar_page_sz; /* log pg sz in 4k chunks */
202
	u8  steering_mode; /* for QUERY_HCA */
203
	u8  dmfs_high_steer_mode; /* for QUERY_HCA */
O
Or Gerlitz 已提交
204
	u64 dev_cap_enabled;
205 206
	u16 cqe_size; /* For use only when CQE stride feature enabled */
	u16 eqe_size; /* For use only when EQE stride feature enabled */
207
	u8 rss_ip_frags;
208
	u8 phv_check_en; /* for QUERY_HCA */
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
};

struct mlx4_init_ib_param {
	int port_width;
	int vl_cap;
	int mtu_cap;
	u16 gid_cap;
	u16 pkey_cap;
	int set_guid0;
	u64 guid0;
	int set_node_guid;
	u64 node_guid;
	int set_si_guid;
	u64 si_guid;
};

struct mlx4_set_ib_param {
	int set_si_guid;
	int reset_qkey_viol;
	u64 si_guid;
	u32 cap_mask;
};

232
void mlx4_dev_cap_dump(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
233
int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
M
Matan Barak 已提交
234
int mlx4_QUERY_PORT(struct mlx4_dev *dev, int port, struct mlx4_port_cap *port_cap);
235
int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
236
			struct mlx4_func_cap *func_cap);
237 238 239 240 241
int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
				struct mlx4_vhcr *vhcr,
				struct mlx4_cmd_mailbox *inbox,
				struct mlx4_cmd_mailbox *outbox,
				struct mlx4_cmd_info *cmd);
242
int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave);
243 244 245 246 247 248
int mlx4_MAP_FA(struct mlx4_dev *dev, struct mlx4_icm *icm);
int mlx4_UNMAP_FA(struct mlx4_dev *dev);
int mlx4_RUN_FW(struct mlx4_dev *dev);
int mlx4_QUERY_FW(struct mlx4_dev *dev);
int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter);
int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
249
int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
250 251 252 253 254 255
int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic);
int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt);
int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
int mlx4_NOP(struct mlx4_dev *dev);
256
int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
257
void mlx4_opreq_action(struct work_struct *work);
258 259

#endif /* MLX4_FW_H */