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@xxxxxxxxxx> --- 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 diff --git a/backport/backport-include/linux/rfkill.h b/backport/backport-include/linux/rfkill.h new file mode 100644 index 00000000..c0b99d58 --- /dev/null +++ b/backport/backport-include/linux/rfkill.h @@ -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 */ diff --git a/patches/0013-fix-makefile-includes/cfg80211.patch b/patches/0013-fix-makefile-includes/cfg80211.patch index 0e079911..c44e3f58 100644 --- a/patches/0013-fix-makefile-includes/cfg80211.patch +++ b/patches/0013-fix-makefile-includes/cfg80211.patch @@ -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> -- 2.30.2 -- To unsubscribe from this list: send the line "unsubscribe backports" in