18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
38c2ecf20Sopenharmony_ci * Copyright (c) 2005 Mellanox Technologies. All rights reserved.
48c2ecf20Sopenharmony_ci * Copyright (c) 2006 Cisco Systems.  All rights reserved.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This software is available to you under a choice of one of two
78c2ecf20Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
88c2ecf20Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
98c2ecf20Sopenharmony_ci * COPYING in the main directory of this source tree, or the
108c2ecf20Sopenharmony_ci * OpenIB.org BSD license below:
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
138c2ecf20Sopenharmony_ci *     without modification, are permitted provided that the following
148c2ecf20Sopenharmony_ci *     conditions are met:
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci *      - Redistributions of source code must retain the above
178c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
188c2ecf20Sopenharmony_ci *        disclaimer.
198c2ecf20Sopenharmony_ci *
208c2ecf20Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
218c2ecf20Sopenharmony_ci *        copyright notice, this list of conditions and the following
228c2ecf20Sopenharmony_ci *        disclaimer in the documentation and/or other materials
238c2ecf20Sopenharmony_ci *        provided with the distribution.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
268c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
278c2ecf20Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
288c2ecf20Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
298c2ecf20Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
308c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
318c2ecf20Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
328c2ecf20Sopenharmony_ci * SOFTWARE.
338c2ecf20Sopenharmony_ci */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#ifndef MTHCA_CMD_H
368c2ecf20Sopenharmony_ci#define MTHCA_CMD_H
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#include <rdma/ib_verbs.h>
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define MTHCA_MAILBOX_SIZE 4096
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cienum {
438c2ecf20Sopenharmony_ci	/* command completed successfully: */
448c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_OK 	      = 0x00,
458c2ecf20Sopenharmony_ci	/* Internal error (such as a bus error) occurred while processing command: */
468c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_INTERNAL_ERR   = 0x01,
478c2ecf20Sopenharmony_ci	/* Operation/command not supported or opcode modifier not supported: */
488c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_OP 	      = 0x02,
498c2ecf20Sopenharmony_ci	/* Parameter not supported or parameter out of range: */
508c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_PARAM      = 0x03,
518c2ecf20Sopenharmony_ci	/* System not enabled or bad system state: */
528c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_SYS_STATE  = 0x04,
538c2ecf20Sopenharmony_ci	/* Attempt to access reserved or unallocaterd resource: */
548c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_RESOURCE   = 0x05,
558c2ecf20Sopenharmony_ci	/* Requested resource is currently executing a command, or is otherwise busy: */
568c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_RESOURCE_BUSY  = 0x06,
578c2ecf20Sopenharmony_ci	/* memory error: */
588c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_DDR_MEM_ERR    = 0x07,
598c2ecf20Sopenharmony_ci	/* Required capability exceeds device limits: */
608c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_EXCEED_LIM     = 0x08,
618c2ecf20Sopenharmony_ci	/* Resource is not in the appropriate state or ownership: */
628c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_RES_STATE  = 0x09,
638c2ecf20Sopenharmony_ci	/* Index out of range: */
648c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_INDEX      = 0x0a,
658c2ecf20Sopenharmony_ci	/* FW image corrupted: */
668c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_NVMEM      = 0x0b,
678c2ecf20Sopenharmony_ci	/* Attempt to modify a QP/EE which is not in the presumed state: */
688c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_QPEE_STATE = 0x10,
698c2ecf20Sopenharmony_ci	/* Bad segment parameters (Address/Size): */
708c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_SEG_PARAM  = 0x20,
718c2ecf20Sopenharmony_ci	/* Memory Region has Memory Windows bound to: */
728c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_REG_BOUND      = 0x21,
738c2ecf20Sopenharmony_ci	/* HCA local attached memory not present: */
748c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_LAM_NOT_PRE    = 0x22,
758c2ecf20Sopenharmony_ci	/* Bad management packet (silently discarded): */
768c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_PKT 	      = 0x30,
778c2ecf20Sopenharmony_ci	/* More outstanding CQEs in CQ than new CQ size: */
788c2ecf20Sopenharmony_ci	MTHCA_CMD_STAT_BAD_SIZE       = 0x40
798c2ecf20Sopenharmony_ci};
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_cienum {
828c2ecf20Sopenharmony_ci	MTHCA_TRANS_INVALID = 0,
838c2ecf20Sopenharmony_ci	MTHCA_TRANS_RST2INIT,
848c2ecf20Sopenharmony_ci	MTHCA_TRANS_INIT2INIT,
858c2ecf20Sopenharmony_ci	MTHCA_TRANS_INIT2RTR,
868c2ecf20Sopenharmony_ci	MTHCA_TRANS_RTR2RTS,
878c2ecf20Sopenharmony_ci	MTHCA_TRANS_RTS2RTS,
888c2ecf20Sopenharmony_ci	MTHCA_TRANS_SQERR2RTS,
898c2ecf20Sopenharmony_ci	MTHCA_TRANS_ANY2ERR,
908c2ecf20Sopenharmony_ci	MTHCA_TRANS_RTS2SQD,
918c2ecf20Sopenharmony_ci	MTHCA_TRANS_SQD2SQD,
928c2ecf20Sopenharmony_ci	MTHCA_TRANS_SQD2RTS,
938c2ecf20Sopenharmony_ci	MTHCA_TRANS_ANY2RST,
948c2ecf20Sopenharmony_ci};
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cienum {
978c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_RC                 = 1 << 0,
988c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_UC                 = 1 << 1,
998c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_UD                 = 1 << 2,
1008c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_RD                 = 1 << 3,
1018c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_RAW_IPV6           = 1 << 4,
1028c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_RAW_ETHER          = 1 << 5,
1038c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_SRQ                = 1 << 6,
1048c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_IPOIB_CSUM		= 1 << 7,
1058c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_BAD_PKEY_CNTR      = 1 << 8,
1068c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_BAD_QKEY_CNTR      = 1 << 9,
1078c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_MW                 = 1 << 16,
1088c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_AUTO_PATH_MIG      = 1 << 17,
1098c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_ATOMIC             = 1 << 18,
1108c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_RAW_MULTI          = 1 << 19,
1118c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_UD_AV_PORT_ENFORCE = 1 << 20,
1128c2ecf20Sopenharmony_ci	DEV_LIM_FLAG_UD_MULTI           = 1 << 21,
1138c2ecf20Sopenharmony_ci};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cistruct mthca_mailbox {
1168c2ecf20Sopenharmony_ci	dma_addr_t dma;
1178c2ecf20Sopenharmony_ci	void      *buf;
1188c2ecf20Sopenharmony_ci};
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_cistruct mthca_dev_lim {
1218c2ecf20Sopenharmony_ci	int max_srq_sz;
1228c2ecf20Sopenharmony_ci	int max_qp_sz;
1238c2ecf20Sopenharmony_ci	int reserved_qps;
1248c2ecf20Sopenharmony_ci	int max_qps;
1258c2ecf20Sopenharmony_ci	int reserved_srqs;
1268c2ecf20Sopenharmony_ci	int max_srqs;
1278c2ecf20Sopenharmony_ci	int reserved_eecs;
1288c2ecf20Sopenharmony_ci	int max_eecs;
1298c2ecf20Sopenharmony_ci	int max_cq_sz;
1308c2ecf20Sopenharmony_ci	int reserved_cqs;
1318c2ecf20Sopenharmony_ci	int max_cqs;
1328c2ecf20Sopenharmony_ci	int max_mpts;
1338c2ecf20Sopenharmony_ci	int reserved_eqs;
1348c2ecf20Sopenharmony_ci	int max_eqs;
1358c2ecf20Sopenharmony_ci	int reserved_mtts;
1368c2ecf20Sopenharmony_ci	int max_mrw_sz;
1378c2ecf20Sopenharmony_ci	int reserved_mrws;
1388c2ecf20Sopenharmony_ci	int max_mtt_seg;
1398c2ecf20Sopenharmony_ci	int max_requester_per_qp;
1408c2ecf20Sopenharmony_ci	int max_responder_per_qp;
1418c2ecf20Sopenharmony_ci	int max_rdma_global;
1428c2ecf20Sopenharmony_ci	int local_ca_ack_delay;
1438c2ecf20Sopenharmony_ci	int max_mtu;
1448c2ecf20Sopenharmony_ci	int max_port_width;
1458c2ecf20Sopenharmony_ci	int max_vl;
1468c2ecf20Sopenharmony_ci	int num_ports;
1478c2ecf20Sopenharmony_ci	int max_gids;
1488c2ecf20Sopenharmony_ci	u16 stat_rate_support;
1498c2ecf20Sopenharmony_ci	int max_pkeys;
1508c2ecf20Sopenharmony_ci	u32 flags;
1518c2ecf20Sopenharmony_ci	int reserved_uars;
1528c2ecf20Sopenharmony_ci	int uar_size;
1538c2ecf20Sopenharmony_ci	int min_page_sz;
1548c2ecf20Sopenharmony_ci	int max_sg;
1558c2ecf20Sopenharmony_ci	int max_desc_sz;
1568c2ecf20Sopenharmony_ci	int max_qp_per_mcg;
1578c2ecf20Sopenharmony_ci	int reserved_mgms;
1588c2ecf20Sopenharmony_ci	int max_mcgs;
1598c2ecf20Sopenharmony_ci	int reserved_pds;
1608c2ecf20Sopenharmony_ci	int max_pds;
1618c2ecf20Sopenharmony_ci	int reserved_rdds;
1628c2ecf20Sopenharmony_ci	int max_rdds;
1638c2ecf20Sopenharmony_ci	int eec_entry_sz;
1648c2ecf20Sopenharmony_ci	int qpc_entry_sz;
1658c2ecf20Sopenharmony_ci	int eeec_entry_sz;
1668c2ecf20Sopenharmony_ci	int eqpc_entry_sz;
1678c2ecf20Sopenharmony_ci	int eqc_entry_sz;
1688c2ecf20Sopenharmony_ci	int cqc_entry_sz;
1698c2ecf20Sopenharmony_ci	int srq_entry_sz;
1708c2ecf20Sopenharmony_ci	int uar_scratch_entry_sz;
1718c2ecf20Sopenharmony_ci	int mpt_entry_sz;
1728c2ecf20Sopenharmony_ci	union {
1738c2ecf20Sopenharmony_ci		struct {
1748c2ecf20Sopenharmony_ci			int max_avs;
1758c2ecf20Sopenharmony_ci		} tavor;
1768c2ecf20Sopenharmony_ci		struct {
1778c2ecf20Sopenharmony_ci			int resize_srq;
1788c2ecf20Sopenharmony_ci			int max_pbl_sz;
1798c2ecf20Sopenharmony_ci			u8  bmme_flags;
1808c2ecf20Sopenharmony_ci			u32 reserved_lkey;
1818c2ecf20Sopenharmony_ci			int lam_required;
1828c2ecf20Sopenharmony_ci			u64 max_icm_sz;
1838c2ecf20Sopenharmony_ci		} arbel;
1848c2ecf20Sopenharmony_ci	} hca;
1858c2ecf20Sopenharmony_ci};
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_cistruct mthca_adapter {
1888c2ecf20Sopenharmony_ci	u32  vendor_id;
1898c2ecf20Sopenharmony_ci	u32  device_id;
1908c2ecf20Sopenharmony_ci	u32  revision_id;
1918c2ecf20Sopenharmony_ci	char board_id[MTHCA_BOARD_ID_LEN];
1928c2ecf20Sopenharmony_ci	u8   inta_pin;
1938c2ecf20Sopenharmony_ci};
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_cistruct mthca_init_hca_param {
1968c2ecf20Sopenharmony_ci	u64 qpc_base;
1978c2ecf20Sopenharmony_ci	u64 eec_base;
1988c2ecf20Sopenharmony_ci	u64 srqc_base;
1998c2ecf20Sopenharmony_ci	u64 cqc_base;
2008c2ecf20Sopenharmony_ci	u64 eqpc_base;
2018c2ecf20Sopenharmony_ci	u64 eeec_base;
2028c2ecf20Sopenharmony_ci	u64 eqc_base;
2038c2ecf20Sopenharmony_ci	u64 rdb_base;
2048c2ecf20Sopenharmony_ci	u64 mc_base;
2058c2ecf20Sopenharmony_ci	u64 mpt_base;
2068c2ecf20Sopenharmony_ci	u64 mtt_base;
2078c2ecf20Sopenharmony_ci	u64 uar_scratch_base;
2088c2ecf20Sopenharmony_ci	u64 uarc_base;
2098c2ecf20Sopenharmony_ci	u16 log_mc_entry_sz;
2108c2ecf20Sopenharmony_ci	u16 mc_hash_sz;
2118c2ecf20Sopenharmony_ci	u8  log_num_qps;
2128c2ecf20Sopenharmony_ci	u8  log_num_eecs;
2138c2ecf20Sopenharmony_ci	u8  log_num_srqs;
2148c2ecf20Sopenharmony_ci	u8  log_num_cqs;
2158c2ecf20Sopenharmony_ci	u8  log_num_eqs;
2168c2ecf20Sopenharmony_ci	u8  log_mc_table_sz;
2178c2ecf20Sopenharmony_ci	u8  mtt_seg_sz;
2188c2ecf20Sopenharmony_ci	u8  log_mpt_sz;
2198c2ecf20Sopenharmony_ci	u8  log_uar_sz;
2208c2ecf20Sopenharmony_ci	u8  log_uarc_sz;
2218c2ecf20Sopenharmony_ci};
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_cistruct mthca_init_ib_param {
2248c2ecf20Sopenharmony_ci	int port_width;
2258c2ecf20Sopenharmony_ci	int vl_cap;
2268c2ecf20Sopenharmony_ci	int mtu_cap;
2278c2ecf20Sopenharmony_ci	u16 gid_cap;
2288c2ecf20Sopenharmony_ci	u16 pkey_cap;
2298c2ecf20Sopenharmony_ci	int set_guid0;
2308c2ecf20Sopenharmony_ci	u64 guid0;
2318c2ecf20Sopenharmony_ci	int set_node_guid;
2328c2ecf20Sopenharmony_ci	u64 node_guid;
2338c2ecf20Sopenharmony_ci	int set_si_guid;
2348c2ecf20Sopenharmony_ci	u64 si_guid;
2358c2ecf20Sopenharmony_ci};
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_cistruct mthca_set_ib_param {
2388c2ecf20Sopenharmony_ci	int set_si_guid;
2398c2ecf20Sopenharmony_ci	int reset_qkey_viol;
2408c2ecf20Sopenharmony_ci	u64 si_guid;
2418c2ecf20Sopenharmony_ci	u32 cap_mask;
2428c2ecf20Sopenharmony_ci};
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ciint mthca_cmd_init(struct mthca_dev *dev);
2458c2ecf20Sopenharmony_civoid mthca_cmd_cleanup(struct mthca_dev *dev);
2468c2ecf20Sopenharmony_ciint mthca_cmd_use_events(struct mthca_dev *dev);
2478c2ecf20Sopenharmony_civoid mthca_cmd_use_polling(struct mthca_dev *dev);
2488c2ecf20Sopenharmony_civoid mthca_cmd_event(struct mthca_dev *dev, u16 token,
2498c2ecf20Sopenharmony_ci		     u8  status, u64 out_param);
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_cistruct mthca_mailbox *mthca_alloc_mailbox(struct mthca_dev *dev,
2528c2ecf20Sopenharmony_ci					  gfp_t gfp_mask);
2538c2ecf20Sopenharmony_civoid mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox);
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ciint mthca_SYS_EN(struct mthca_dev *dev);
2568c2ecf20Sopenharmony_ciint mthca_SYS_DIS(struct mthca_dev *dev);
2578c2ecf20Sopenharmony_ciint mthca_MAP_FA(struct mthca_dev *dev, struct mthca_icm *icm);
2588c2ecf20Sopenharmony_ciint mthca_UNMAP_FA(struct mthca_dev *dev);
2598c2ecf20Sopenharmony_ciint mthca_RUN_FW(struct mthca_dev *dev);
2608c2ecf20Sopenharmony_ciint mthca_QUERY_FW(struct mthca_dev *dev);
2618c2ecf20Sopenharmony_ciint mthca_ENABLE_LAM(struct mthca_dev *dev);
2628c2ecf20Sopenharmony_ciint mthca_DISABLE_LAM(struct mthca_dev *dev);
2638c2ecf20Sopenharmony_ciint mthca_QUERY_DDR(struct mthca_dev *dev);
2648c2ecf20Sopenharmony_ciint mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
2658c2ecf20Sopenharmony_ci			struct mthca_dev_lim *dev_lim);
2668c2ecf20Sopenharmony_ciint mthca_QUERY_ADAPTER(struct mthca_dev *dev,
2678c2ecf20Sopenharmony_ci			struct mthca_adapter *adapter);
2688c2ecf20Sopenharmony_ciint mthca_INIT_HCA(struct mthca_dev *dev,
2698c2ecf20Sopenharmony_ci		   struct mthca_init_hca_param *param);
2708c2ecf20Sopenharmony_ciint mthca_INIT_IB(struct mthca_dev *dev,
2718c2ecf20Sopenharmony_ci		  struct mthca_init_ib_param *param,
2728c2ecf20Sopenharmony_ci		  int port);
2738c2ecf20Sopenharmony_ciint mthca_CLOSE_IB(struct mthca_dev *dev, int port);
2748c2ecf20Sopenharmony_ciint mthca_CLOSE_HCA(struct mthca_dev *dev, int panic);
2758c2ecf20Sopenharmony_ciint mthca_SET_IB(struct mthca_dev *dev, struct mthca_set_ib_param *param,
2768c2ecf20Sopenharmony_ci		 int port);
2778c2ecf20Sopenharmony_ciint mthca_MAP_ICM(struct mthca_dev *dev, struct mthca_icm *icm, u64 virt);
2788c2ecf20Sopenharmony_ciint mthca_MAP_ICM_page(struct mthca_dev *dev, u64 dma_addr, u64 virt);
2798c2ecf20Sopenharmony_ciint mthca_UNMAP_ICM(struct mthca_dev *dev, u64 virt, u32 page_count);
2808c2ecf20Sopenharmony_ciint mthca_MAP_ICM_AUX(struct mthca_dev *dev, struct mthca_icm *icm);
2818c2ecf20Sopenharmony_ciint mthca_UNMAP_ICM_AUX(struct mthca_dev *dev);
2828c2ecf20Sopenharmony_ciint mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages);
2838c2ecf20Sopenharmony_ciint mthca_SW2HW_MPT(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2848c2ecf20Sopenharmony_ci		    int mpt_index);
2858c2ecf20Sopenharmony_ciint mthca_HW2SW_MPT(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2868c2ecf20Sopenharmony_ci		    int mpt_index);
2878c2ecf20Sopenharmony_ciint mthca_WRITE_MTT(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2888c2ecf20Sopenharmony_ci		    int num_mtt);
2898c2ecf20Sopenharmony_ciint mthca_SYNC_TPT(struct mthca_dev *dev);
2908c2ecf20Sopenharmony_ciint mthca_MAP_EQ(struct mthca_dev *dev, u64 event_mask, int unmap,
2918c2ecf20Sopenharmony_ci		 int eq_num);
2928c2ecf20Sopenharmony_ciint mthca_SW2HW_EQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2938c2ecf20Sopenharmony_ci		   int eq_num);
2948c2ecf20Sopenharmony_ciint mthca_HW2SW_EQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2958c2ecf20Sopenharmony_ci		   int eq_num);
2968c2ecf20Sopenharmony_ciint mthca_SW2HW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2978c2ecf20Sopenharmony_ci		   int cq_num);
2988c2ecf20Sopenharmony_ciint mthca_HW2SW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
2998c2ecf20Sopenharmony_ci		   int cq_num);
3008c2ecf20Sopenharmony_ciint mthca_RESIZE_CQ(struct mthca_dev *dev, int cq_num, u32 lkey, u8 log_size);
3018c2ecf20Sopenharmony_ciint mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
3028c2ecf20Sopenharmony_ci		    int srq_num);
3038c2ecf20Sopenharmony_ciint mthca_HW2SW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
3048c2ecf20Sopenharmony_ci		    int srq_num);
3058c2ecf20Sopenharmony_ciint mthca_QUERY_SRQ(struct mthca_dev *dev, u32 num,
3068c2ecf20Sopenharmony_ci		    struct mthca_mailbox *mailbox);
3078c2ecf20Sopenharmony_ciint mthca_ARM_SRQ(struct mthca_dev *dev, int srq_num, int limit);
3088c2ecf20Sopenharmony_ciint mthca_MODIFY_QP(struct mthca_dev *dev, enum ib_qp_state cur,
3098c2ecf20Sopenharmony_ci		    enum ib_qp_state next, u32 num, int is_ee,
3108c2ecf20Sopenharmony_ci		    struct mthca_mailbox *mailbox, u32 optmask);
3118c2ecf20Sopenharmony_ciint mthca_QUERY_QP(struct mthca_dev *dev, u32 num, int is_ee,
3128c2ecf20Sopenharmony_ci		   struct mthca_mailbox *mailbox);
3138c2ecf20Sopenharmony_ciint mthca_CONF_SPECIAL_QP(struct mthca_dev *dev, int type, u32 qpn);
3148c2ecf20Sopenharmony_ciint mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey,
3158c2ecf20Sopenharmony_ci		  int port, const struct ib_wc *in_wc, const struct ib_grh *in_grh,
3168c2ecf20Sopenharmony_ci		  const void *in_mad, void *response_mad);
3178c2ecf20Sopenharmony_ciint mthca_READ_MGM(struct mthca_dev *dev, int index,
3188c2ecf20Sopenharmony_ci		   struct mthca_mailbox *mailbox);
3198c2ecf20Sopenharmony_ciint mthca_WRITE_MGM(struct mthca_dev *dev, int index,
3208c2ecf20Sopenharmony_ci		    struct mthca_mailbox *mailbox);
3218c2ecf20Sopenharmony_ciint mthca_MGID_HASH(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
3228c2ecf20Sopenharmony_ci		    u16 *hash);
3238c2ecf20Sopenharmony_ciint mthca_NOP(struct mthca_dev *dev);
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci#endif /* MTHCA_CMD_H */
326