openwrt/package/kernel/mac80211/patches/build/130-iommu_backport.patch
Felix Fietkau e648e3ccf9 mac80211: fix build regressions on linux 6.1
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-11 18:54:13 +02:00

27 lines
636 B
Diff

--- /dev/null
+++ b/backport-include/linux/iommu.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT_LINUX_IOMMU_H
+#define __BACKPORT_LINUX_IOMMU_H
+
+#include_next <linux/iommu.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(6,3,0)
+
+static inline int LINUX_BACKPORT(iommu_map)(struct iommu_domain *domain,
+ unsigned long iova,
+ phys_addr_t paddr, size_t size,
+ int prot, gfp_t gfp)
+{
+ if (gfp == GFP_ATOMIC)
+ return iommu_map_atomic(domain, iova, paddr, size, prot);
+
+ return iommu_map(domain, iova, paddr, size, prot);
+}
+#define iommu_map LINUX_BACKPORT(iommu_map)
+
+#endif /* < 6.3 */
+
+#endif