--- zzzz-none-000/linux-4.4.271/include/linux/dma-iommu.h 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/include/linux/dma-iommu.h 2023-04-19 10:22:30.000000000 +0000 @@ -21,8 +21,26 @@ #include #ifdef CONFIG_IOMMU_DMA +#include #include +struct dma_iommu_mapping { + /* iommu specific data */ + struct iommu_domain *domain; + + unsigned long **bitmaps; /* array of bitmaps */ + unsigned int nr_bitmaps; /* nr of elements in array */ + unsigned int extensions; + size_t bitmap_size; /* size of a single bitmap */ + size_t bits; /* per bitmap */ + dma_addr_t base; + u64 size; + struct dma_fast_smmu_mapping *fast; + + spinlock_t lock; + struct kref kref; +}; + int iommu_dma_init(void); /* Domain management interface for IOMMU drivers */ @@ -39,8 +57,8 @@ * These implement the bulk of the relevant DMA mapping callbacks, but require * the arch code to take care of attributes and cache maintenance */ -struct page **iommu_dma_alloc(struct device *dev, size_t size, - gfp_t gfp, int prot, dma_addr_t *handle, +struct page **iommu_dma_alloc(struct device *dev, size_t size, gfp_t gfp, + struct dma_attrs *attrs, int prot, dma_addr_t *handle, void (*flush_page)(struct device *, const void *, phys_addr_t)); void iommu_dma_free(struct device *dev, struct page **pages, size_t size, dma_addr_t *handle);