mac80211: fix build regressions on linux 6.1
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / build / 130-iommu_backport.patch
diff --git a/package/kernel/mac80211/patches/build/130-iommu_backport.patch b/package/kernel/mac80211/patches/build/130-iommu_backport.patch
new file mode 100644 (file)
index 0000000..2d3ef88
--- /dev/null
@@ -0,0 +1,26 @@
+--- /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