1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2015 - 2021 Intel Corporation */
7 #include <linux/bitfield.h>
8 #include <linux/net/intel/iidc.h>
9 #include <crypto/hash.h>
10 #include <rdma/ib_verbs.h>
12 #define STATS_TIMER_DELAY 60000
14 struct irdma_dma_info
{
18 struct irdma_dma_mem
{
24 struct irdma_virt_mem
{
32 struct irdma_puda_buf
;
33 struct irdma_puda_cmpl_info
;
34 struct irdma_update_sds_info
;
35 struct irdma_hmc_fcn_info
;
36 struct irdma_manage_vf_pble_info
;
40 struct ib_device
*to_ibdev(struct irdma_sc_dev
*dev
);
41 void irdma_ieq_mpa_crc_ae(struct irdma_sc_dev
*dev
, struct irdma_sc_qp
*qp
);
42 enum irdma_status_code
irdma_vf_wait_vchnl_resp(struct irdma_sc_dev
*dev
);
43 bool irdma_vf_clear_to_send(struct irdma_sc_dev
*dev
);
44 void irdma_add_dev_ref(struct irdma_sc_dev
*dev
);
45 void irdma_put_dev_ref(struct irdma_sc_dev
*dev
);
46 int irdma_ieq_check_mpacrc(struct shash_desc
*desc
, void *addr
, u32 len
,
48 struct irdma_sc_qp
*irdma_ieq_get_qp(struct irdma_sc_dev
*dev
,
49 struct irdma_puda_buf
*buf
);
50 void irdma_send_ieq_ack(struct irdma_sc_qp
*qp
);
51 void irdma_ieq_update_tcpip_info(struct irdma_puda_buf
*buf
, u16 len
,
53 void irdma_free_hash_desc(struct shash_desc
*hash_desc
);
54 int irdma_init_hash_desc(struct shash_desc
**hash_desc
);
55 int irdma_puda_get_tcpip_info(struct irdma_puda_cmpl_info
*info
,
56 struct irdma_puda_buf
*buf
);
57 int irdma_cqp_sds_cmd(struct irdma_sc_dev
*dev
,
58 struct irdma_update_sds_info
*info
);
59 int irdma_cqp_manage_hmc_fcn_cmd(struct irdma_sc_dev
*dev
,
60 struct irdma_hmc_fcn_info
*hmcfcninfo
,
62 int irdma_cqp_query_fpm_val_cmd(struct irdma_sc_dev
*dev
,
63 struct irdma_dma_mem
*val_mem
, u8 hmc_fn_id
);
64 int irdma_cqp_commit_fpm_val_cmd(struct irdma_sc_dev
*dev
,
65 struct irdma_dma_mem
*val_mem
, u8 hmc_fn_id
);
66 int irdma_alloc_query_fpm_buf(struct irdma_sc_dev
*dev
,
67 struct irdma_dma_mem
*mem
);
68 void *irdma_remove_cqp_head(struct irdma_sc_dev
*dev
);
69 void irdma_term_modify_qp(struct irdma_sc_qp
*qp
, u8 next_state
, u8 term
,
71 void irdma_terminate_done(struct irdma_sc_qp
*qp
, int timeout_occurred
);
72 void irdma_terminate_start_timer(struct irdma_sc_qp
*qp
);
73 void irdma_terminate_del_timer(struct irdma_sc_qp
*qp
);
74 void irdma_hw_stats_start_timer(struct irdma_sc_vsi
*vsi
);
75 void irdma_hw_stats_stop_timer(struct irdma_sc_vsi
*vsi
);
76 void wr32(struct irdma_hw
*hw
, u32 reg
, u32 val
);
77 u32
rd32(struct irdma_hw
*hw
, u32 reg
);
78 u64
rd64(struct irdma_hw
*hw
, u32 reg
);
79 int irdma_map_vm_page_list(struct irdma_hw
*hw
, void *va
, dma_addr_t
*pg_dma
,
81 void irdma_unmap_vm_page_list(struct irdma_hw
*hw
, dma_addr_t
*pg_dma
, u32 pg_cnt
);
82 #endif /* IRDMA_OSDEP_H */