new file mode 100644
@@ -0,0 +1,24 @@
+#ifndef __BACKPORT_UAPI__RFKILL_H
+#define __BACKPORT_UAPI__RFKILL_H
+#include_next <linux/rfkill.h>
+
+
+#if LINUX_VERSION_IS_LESS(5,11,0)
+
+/* This should come from uapi/linux/rfkill.h, but it was much easier
+ * to do it this way.
+ */
+enum rfkill_hard_block_reasons {
+ RFKILL_HARD_BLOCK_SIGNAL = 1 << 0,
+ RFKILL_HARD_BLOCK_NOT_OWNER = 1 << 1,
+};
+
+static inline bool rfkill_set_hw_state_reason(struct rfkill *rfkill,
+ bool blocked, unsigned long reason)
+{
+ return rfkill_set_hw_state(rfkill, blocked);
+}
+
+#endif /* 5.11 */
+
+#endif /* __BACKPORT_UAPI__RFKILL_H */
@@ -6,7 +6,19 @@ the type is renamed.
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -22,6 +22,7 @@
+@@ -11,7 +11,11 @@
+ */
+
+ #include <linux/ethtool.h>
++#if LINUX_VERSION_IS_LESS(5,11,0)
++#include <linux/rfkill.h>
++#else
+ #include <uapi/linux/rfkill.h>
++#endif
+ #include <linux/netdevice.h>
+ #include <linux/debugfs.h>
+ #include <linux/list.h>
+@@ -23,6 +27,7 @@
#include <linux/ieee80211.h>
#include <linux/net.h>
#include <net/regulatory.h>
This adds the new function rfkill_set_hw_state_reason() from kernel 5.11 and maps it to the old rfkill_set_hw_state() by dropping the reason. kernel 5.11 also moved some definitions to the uapi/linux/rfkill.h, but on kernel versions < 5.11 it is not sufficient to only include the uapi version. This is used by the core wireless system. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- backport/backport-include/linux/rfkill.h | 24 +++++++++++++++++++ .../0013-fix-makefile-includes/cfg80211.patch | 14 ++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport/backport-include/linux/rfkill.h