1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved. */ 3 4 #ifndef _HINIC3_COMMON_H_ 5 #define _HINIC3_COMMON_H_ 6 7 #include <linux/device.h> 8 9 #define HINIC3_MIN_PAGE_SIZE 0x1000 10 11 struct hinic3_dma_addr_align { 12 u32 real_size; 13 14 void *ori_vaddr; 15 dma_addr_t ori_paddr; 16 17 void *align_vaddr; 18 dma_addr_t align_paddr; 19 }; 20 21 int hinic3_dma_zalloc_coherent_align(struct device *dev, u32 size, u32 align, 22 gfp_t flag, 23 struct hinic3_dma_addr_align *mem_align); 24 void hinic3_dma_free_coherent_align(struct device *dev, 25 struct hinic3_dma_addr_align *mem_align); 26 27 #endif 28