linux/drivers/infiniband/hw/irdma/hmc.h

/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2015 - 2020 Intel Corporation */
#ifndef IRDMA_HMC_H
#define IRDMA_HMC_H

#include "defs.h"

#define IRDMA_HMC_MAX_BP_COUNT
#define IRDMA_MAX_SD_ENTRIES
#define IRDMA_HW_DBG_HMC_INVALID_BP_MARK
#define IRDMA_HMC_INFO_SIGNATURE
#define IRDMA_HMC_PD_CNT_IN_SD
#define IRDMA_HMC_DIRECT_BP_SIZE
#define IRDMA_HMC_MAX_SD_COUNT
#define IRDMA_HMC_PAGED_BP_SIZE
#define IRDMA_HMC_PD_BP_BUF_ALIGNMENT
#define IRDMA_FIRST_VF_FPM_ID
#define FPM_MULTIPLIER

enum irdma_hmc_rsrc_type {};

enum irdma_sd_entry_type {};

struct irdma_hmc_obj_info {};

struct irdma_hmc_bp {};

struct irdma_hmc_pd_entry {};

struct irdma_hmc_pd_table {};

struct irdma_hmc_sd_entry {};

struct irdma_hmc_sd_table {};

struct irdma_hmc_info {};

struct irdma_update_sd_entry {};

struct irdma_update_sds_info {};

struct irdma_ccq_cqe_info;
struct irdma_hmc_fcn_info {};

struct irdma_hmc_create_obj_info {};

struct irdma_hmc_del_obj_info {};

int irdma_copy_dma_mem(struct irdma_hw *hw, void *dest_buf,
		       struct irdma_dma_mem *src_mem, u64 src_offset, u64 size);
int irdma_sc_create_hmc_obj(struct irdma_sc_dev *dev,
			    struct irdma_hmc_create_obj_info *info);
int irdma_sc_del_hmc_obj(struct irdma_sc_dev *dev,
			 struct irdma_hmc_del_obj_info *info, bool reset);
int irdma_hmc_sd_one(struct irdma_sc_dev *dev, u8 hmc_fn_id, u64 pa, u32 sd_idx,
		     enum irdma_sd_entry_type type,
		     bool setsd);
int irdma_update_sds_noccq(struct irdma_sc_dev *dev,
			   struct irdma_update_sds_info *info);
struct irdma_vfdev *irdma_vfdev_from_fpm(struct irdma_sc_dev *dev,
					 u8 hmc_fn_id);
struct irdma_hmc_info *irdma_vf_hmcinfo_from_fpm(struct irdma_sc_dev *dev,
						 u8 hmc_fn_id);
int irdma_add_sd_table_entry(struct irdma_hw *hw,
			     struct irdma_hmc_info *hmc_info, u32 sd_index,
			     enum irdma_sd_entry_type type, u64 direct_mode_sz);
int irdma_add_pd_table_entry(struct irdma_sc_dev *dev,
			     struct irdma_hmc_info *hmc_info, u32 pd_index,
			     struct irdma_dma_mem *rsrc_pg);
int irdma_remove_pd_bp(struct irdma_sc_dev *dev,
		       struct irdma_hmc_info *hmc_info, u32 idx);
int irdma_prep_remove_sd_bp(struct irdma_hmc_info *hmc_info, u32 idx);
int irdma_prep_remove_pd_page(struct irdma_hmc_info *hmc_info, u32 idx);
#endif /* IRDMA_HMC_H */