osdep.h (2970B)
1/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */ 2/* Copyright (c) 2015 - 2021 Intel Corporation */ 3#ifndef IRDMA_OSDEP_H 4#define IRDMA_OSDEP_H 5 6#include <linux/pci.h> 7#include <linux/bitfield.h> 8#include <linux/net/intel/iidc.h> 9#include <crypto/hash.h> 10#include <rdma/ib_verbs.h> 11 12#define STATS_TIMER_DELAY 60000 13 14struct irdma_dma_info { 15 dma_addr_t *dmaaddrs; 16}; 17 18struct irdma_dma_mem { 19 void *va; 20 dma_addr_t pa; 21 u32 size; 22} __packed; 23 24struct irdma_virt_mem { 25 void *va; 26 u32 size; 27} __packed; 28 29struct irdma_sc_vsi; 30struct irdma_sc_dev; 31struct irdma_sc_qp; 32struct irdma_puda_buf; 33struct irdma_puda_cmpl_info; 34struct irdma_update_sds_info; 35struct irdma_hmc_fcn_info; 36struct irdma_manage_vf_pble_info; 37struct irdma_hw; 38struct irdma_pci_f; 39 40struct ib_device *to_ibdev(struct irdma_sc_dev *dev); 41void irdma_ieq_mpa_crc_ae(struct irdma_sc_dev *dev, struct irdma_sc_qp *qp); 42enum irdma_status_code irdma_vf_wait_vchnl_resp(struct irdma_sc_dev *dev); 43bool irdma_vf_clear_to_send(struct irdma_sc_dev *dev); 44void irdma_add_dev_ref(struct irdma_sc_dev *dev); 45void irdma_put_dev_ref(struct irdma_sc_dev *dev); 46int irdma_ieq_check_mpacrc(struct shash_desc *desc, void *addr, u32 len, 47 u32 val); 48struct irdma_sc_qp *irdma_ieq_get_qp(struct irdma_sc_dev *dev, 49 struct irdma_puda_buf *buf); 50void irdma_send_ieq_ack(struct irdma_sc_qp *qp); 51void irdma_ieq_update_tcpip_info(struct irdma_puda_buf *buf, u16 len, 52 u32 seqnum); 53void irdma_free_hash_desc(struct shash_desc *hash_desc); 54int irdma_init_hash_desc(struct shash_desc **hash_desc); 55int irdma_puda_get_tcpip_info(struct irdma_puda_cmpl_info *info, 56 struct irdma_puda_buf *buf); 57int irdma_cqp_sds_cmd(struct irdma_sc_dev *dev, 58 struct irdma_update_sds_info *info); 59int irdma_cqp_manage_hmc_fcn_cmd(struct irdma_sc_dev *dev, 60 struct irdma_hmc_fcn_info *hmcfcninfo, 61 u16 *pmf_idx); 62int irdma_cqp_query_fpm_val_cmd(struct irdma_sc_dev *dev, 63 struct irdma_dma_mem *val_mem, u8 hmc_fn_id); 64int irdma_cqp_commit_fpm_val_cmd(struct irdma_sc_dev *dev, 65 struct irdma_dma_mem *val_mem, u8 hmc_fn_id); 66int irdma_alloc_query_fpm_buf(struct irdma_sc_dev *dev, 67 struct irdma_dma_mem *mem); 68void *irdma_remove_cqp_head(struct irdma_sc_dev *dev); 69void irdma_term_modify_qp(struct irdma_sc_qp *qp, u8 next_state, u8 term, 70 u8 term_len); 71void irdma_terminate_done(struct irdma_sc_qp *qp, int timeout_occurred); 72void irdma_terminate_start_timer(struct irdma_sc_qp *qp); 73void irdma_terminate_del_timer(struct irdma_sc_qp *qp); 74void irdma_hw_stats_start_timer(struct irdma_sc_vsi *vsi); 75void irdma_hw_stats_stop_timer(struct irdma_sc_vsi *vsi); 76void wr32(struct irdma_hw *hw, u32 reg, u32 val); 77u32 rd32(struct irdma_hw *hw, u32 reg); 78u64 rd64(struct irdma_hw *hw, u32 reg); 79int irdma_map_vm_page_list(struct irdma_hw *hw, void *va, dma_addr_t *pg_dma, 80 u32 pg_cnt); 81void irdma_unmap_vm_page_list(struct irdma_hw *hw, dma_addr_t *pg_dma, u32 pg_cnt); 82#endif /* IRDMA_OSDEP_H */