fw.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /*
  2. * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
  3. * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved.
  4. * Copyright (c) 2006, 2007 Cisco Systems. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef MLX4_FW_H
  35. #define MLX4_FW_H
  36. #include "mlx4.h"
  37. #include "icm.h"
  38. struct mlx4_mod_stat_cfg {
  39. u8 log_pg_sz;
  40. u8 log_pg_sz_m;
  41. };
  42. struct mlx4_dev_cap {
  43. int max_srq_sz;
  44. int max_qp_sz;
  45. int reserved_qps;
  46. int max_qps;
  47. int reserved_srqs;
  48. int max_srqs;
  49. int max_cq_sz;
  50. int reserved_cqs;
  51. int max_cqs;
  52. int max_mpts;
  53. int reserved_eqs;
  54. int max_eqs;
  55. int reserved_mtts;
  56. int max_mrw_sz;
  57. int reserved_mrws;
  58. int max_mtt_seg;
  59. int max_requester_per_qp;
  60. int max_responder_per_qp;
  61. int max_rdma_global;
  62. int local_ca_ack_delay;
  63. int num_ports;
  64. u32 max_msg_sz;
  65. int ib_mtu[MLX4_MAX_PORTS + 1];
  66. int max_port_width[MLX4_MAX_PORTS + 1];
  67. int max_vl[MLX4_MAX_PORTS + 1];
  68. int max_gids[MLX4_MAX_PORTS + 1];
  69. int max_pkeys[MLX4_MAX_PORTS + 1];
  70. u64 def_mac[MLX4_MAX_PORTS + 1];
  71. u16 eth_mtu[MLX4_MAX_PORTS + 1];
  72. int trans_type[MLX4_MAX_PORTS + 1];
  73. int vendor_oui[MLX4_MAX_PORTS + 1];
  74. u16 wavelength[MLX4_MAX_PORTS + 1];
  75. u64 trans_code[MLX4_MAX_PORTS + 1];
  76. u16 stat_rate_support;
  77. u64 flags;
  78. int reserved_uars;
  79. int uar_size;
  80. int min_page_sz;
  81. int bf_reg_size;
  82. int bf_regs_per_page;
  83. int max_sq_sg;
  84. int max_sq_desc_sz;
  85. int max_rq_sg;
  86. int max_rq_desc_sz;
  87. int max_qp_per_mcg;
  88. int reserved_mgms;
  89. int max_mcgs;
  90. int reserved_pds;
  91. int max_pds;
  92. int reserved_xrcds;
  93. int max_xrcds;
  94. int qpc_entry_sz;
  95. int rdmarc_entry_sz;
  96. int altc_entry_sz;
  97. int aux_entry_sz;
  98. int srq_entry_sz;
  99. int cqc_entry_sz;
  100. int eqc_entry_sz;
  101. int dmpt_entry_sz;
  102. int cmpt_entry_sz;
  103. int mtt_entry_sz;
  104. int resize_srq;
  105. u32 bmme_flags;
  106. u32 reserved_lkey;
  107. u64 max_icm_sz;
  108. int max_gso_sz;
  109. u8 supported_port_types[MLX4_MAX_PORTS + 1];
  110. u8 suggested_type[MLX4_MAX_PORTS + 1];
  111. u8 default_sense[MLX4_MAX_PORTS + 1];
  112. u8 log_max_macs[MLX4_MAX_PORTS + 1];
  113. u8 log_max_vlans[MLX4_MAX_PORTS + 1];
  114. u32 max_counters;
  115. };
  116. struct mlx4_func_cap {
  117. u8 num_ports;
  118. u8 flags;
  119. u32 pf_context_behaviour;
  120. int qp_quota;
  121. int cq_quota;
  122. int srq_quota;
  123. int mpt_quota;
  124. int mtt_quota;
  125. int max_eq;
  126. int reserved_eq;
  127. int mcg_quota;
  128. u8 physical_port[MLX4_MAX_PORTS + 1];
  129. u8 port_flags[MLX4_MAX_PORTS + 1];
  130. };
  131. struct mlx4_adapter {
  132. char board_id[MLX4_BOARD_ID_LEN];
  133. u8 inta_pin;
  134. };
  135. struct mlx4_init_hca_param {
  136. u64 qpc_base;
  137. u64 rdmarc_base;
  138. u64 auxc_base;
  139. u64 altc_base;
  140. u64 srqc_base;
  141. u64 cqc_base;
  142. u64 eqc_base;
  143. u64 mc_base;
  144. u64 dmpt_base;
  145. u64 cmpt_base;
  146. u64 mtt_base;
  147. u64 global_caps;
  148. u16 log_mc_entry_sz;
  149. u16 log_mc_hash_sz;
  150. u8 log_num_qps;
  151. u8 log_num_srqs;
  152. u8 log_num_cqs;
  153. u8 log_num_eqs;
  154. u8 log_rd_per_qp;
  155. u8 log_mc_table_sz;
  156. u8 log_mpt_sz;
  157. u8 log_uar_sz;
  158. u8 uar_page_sz; /* log pg sz in 4k chunks */
  159. };
  160. struct mlx4_init_ib_param {
  161. int port_width;
  162. int vl_cap;
  163. int mtu_cap;
  164. u16 gid_cap;
  165. u16 pkey_cap;
  166. int set_guid0;
  167. u64 guid0;
  168. int set_node_guid;
  169. u64 node_guid;
  170. int set_si_guid;
  171. u64 si_guid;
  172. };
  173. struct mlx4_set_ib_param {
  174. int set_si_guid;
  175. int reset_qkey_viol;
  176. u64 si_guid;
  177. u32 cap_mask;
  178. };
  179. int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
  180. int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, struct mlx4_func_cap *func_cap);
  181. int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
  182. struct mlx4_vhcr *vhcr,
  183. struct mlx4_cmd_mailbox *inbox,
  184. struct mlx4_cmd_mailbox *outbox,
  185. struct mlx4_cmd_info *cmd);
  186. int mlx4_MAP_FA(struct mlx4_dev *dev, struct mlx4_icm *icm);
  187. int mlx4_UNMAP_FA(struct mlx4_dev *dev);
  188. int mlx4_RUN_FW(struct mlx4_dev *dev);
  189. int mlx4_QUERY_FW(struct mlx4_dev *dev);
  190. int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter);
  191. int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
  192. int mlx4_QUERY_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param);
  193. int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic);
  194. int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt);
  195. int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
  196. int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
  197. int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
  198. int mlx4_NOP(struct mlx4_dev *dev);
  199. int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
  200. #endif /* MLX4_FW_H */