From d976954cf09e10ea8adfc322c45eee29e1a70151 Mon Sep 17 00:00:00 2001 From: bings Date: Thu, 25 Jul 2019 13:44:57 +0800 Subject: [PATCH] qcacmn: Use dma_iommu_mapping only if ENABLE_SMMU_S1_TRANSLATION defined In standard linux kernel, dma_iommu_mapping is not defined for arm64, while in qualcomm linux kernel, dma_iommu_mapping is defined for arm and arm64. To fix build error in standard linux kernel, use struct dma_iommu_mapping only when ENABLE_SMMU_S1_TRANSLATION is defined. Change-Id: Ib02073163f2a38c47f864c6592fe2470046868ce CRs-Fixed: 2496729 --- qdf/linux/src/i_qdf_mem.h | 4 +++- qdf/linux/src/i_qdf_types.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qdf/linux/src/i_qdf_mem.h b/qdf/linux/src/i_qdf_mem.h index 5262aa85a4..be09510551 100644 --- a/qdf/linux/src/i_qdf_mem.h +++ b/qdf/linux/src/i_qdf_mem.h @@ -63,7 +63,9 @@ #ifdef CONFIG_ARM_SMMU #include +#ifdef ENABLE_SMMU_S1_TRANSLATION #include +#endif #include #endif @@ -210,7 +212,7 @@ static inline bool __qdf_mem_smmu_s1_enabled(qdf_device_t osdev) return osdev->smmu_s1_enabled; } -#ifdef CONFIG_ARM_SMMU +#if defined(CONFIG_ARM_SMMU) && defined(ENABLE_SMMU_S1_TRANSLATION) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) /** * __qdf_dev_get_domain() - get iommu domain from osdev diff --git a/qdf/linux/src/i_qdf_types.h b/qdf/linux/src/i_qdf_types.h index 60d21b2994..e3f1aa42f0 100644 --- a/qdf/linux/src/i_qdf_types.h +++ b/qdf/linux/src/i_qdf_types.h @@ -265,8 +265,10 @@ struct __qdf_device { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) struct iommu_domain *domain; #else +#ifdef ENABLE_SMMU_S1_TRANSLATION struct dma_iommu_mapping *iommu_mapping; #endif +#endif }; typedef struct __qdf_device *__qdf_device_t;