162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright(c) 2013 - 2018 Intel Corporation. */ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef _IAVF_ALLOC_H_ 562306a36Sopenharmony_ci#define _IAVF_ALLOC_H_ 662306a36Sopenharmony_ci 762306a36Sopenharmony_cistruct iavf_hw; 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci/* Memory allocation types */ 1062306a36Sopenharmony_cienum iavf_memory_type { 1162306a36Sopenharmony_ci iavf_mem_arq_buf = 0, /* ARQ indirect command buffer */ 1262306a36Sopenharmony_ci iavf_mem_asq_buf = 1, 1362306a36Sopenharmony_ci iavf_mem_atq_buf = 2, /* ATQ indirect command buffer */ 1462306a36Sopenharmony_ci iavf_mem_arq_ring = 3, /* ARQ descriptor ring */ 1562306a36Sopenharmony_ci iavf_mem_atq_ring = 4, /* ATQ descriptor ring */ 1662306a36Sopenharmony_ci iavf_mem_pd = 5, /* Page Descriptor */ 1762306a36Sopenharmony_ci iavf_mem_bp = 6, /* Backing Page - 4KB */ 1862306a36Sopenharmony_ci iavf_mem_bp_jumbo = 7, /* Backing Page - > 4KB */ 1962306a36Sopenharmony_ci iavf_mem_reserved 2062306a36Sopenharmony_ci}; 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci/* prototype for functions used for dynamic memory allocation */ 2362306a36Sopenharmony_cienum iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw, 2462306a36Sopenharmony_ci struct iavf_dma_mem *mem, 2562306a36Sopenharmony_ci enum iavf_memory_type type, 2662306a36Sopenharmony_ci u64 size, u32 alignment); 2762306a36Sopenharmony_cienum iavf_status iavf_free_dma_mem(struct iavf_hw *hw, 2862306a36Sopenharmony_ci struct iavf_dma_mem *mem); 2962306a36Sopenharmony_cienum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw, 3062306a36Sopenharmony_ci struct iavf_virt_mem *mem, u32 size); 3162306a36Sopenharmony_civoid iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem); 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#endif /* _IAVF_ALLOC_H_ */ 34