#include <linux/align.h>
#include <linux/dma-mapping.h>
#include <linux/hisi_acc_qm.h>
#include <linux/module.h>
#include <linux/slab.h>
#define HISI_ACC_SGL_SGE_NR_MIN …
#define HISI_ACC_SGL_NR_MAX …
#define HISI_ACC_SGL_ALIGN_SIZE …
#define HISI_ACC_MEM_BLOCK_NR …
struct acc_hw_sge { … };
struct hisi_acc_hw_sgl { … } __aligned(…);
struct hisi_acc_sgl_pool { … };
struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev,
u32 count, u32 sge_nr)
{ … }
EXPORT_SYMBOL_GPL(…);
void hisi_acc_free_sgl_pool(struct device *dev, struct hisi_acc_sgl_pool *pool)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct hisi_acc_hw_sgl *acc_get_sgl(struct hisi_acc_sgl_pool *pool,
u32 index, dma_addr_t *hw_sgl_dma)
{ … }
static void sg_map_to_hw_sg(struct scatterlist *sgl,
struct acc_hw_sge *hw_sge)
{ … }
static void inc_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl)
{ … }
static void update_hw_sgl_sum_sge(struct hisi_acc_hw_sgl *hw_sgl, u16 sum)
{ … }
static void clear_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl)
{ … }
struct hisi_acc_hw_sgl *
hisi_acc_sg_buf_map_to_hw_sgl(struct device *dev,
struct scatterlist *sgl,
struct hisi_acc_sgl_pool *pool,
u32 index, dma_addr_t *hw_sgl_dma)
{ … }
EXPORT_SYMBOL_GPL(…);
void hisi_acc_sg_buf_unmap(struct device *dev, struct scatterlist *sgl,
struct hisi_acc_hw_sgl *hw_sgl)
{ … }
EXPORT_SYMBOL_GPL(…);