From 99ca2142a6a053900b0e133efbbceac344e4eeeb Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Mon, 17 Jul 2023 21:24:51 +0200 Subject: [PATCH] Fixup for stale kickoff removal in wireless regulator API Cope with the fix in stable 6.3.13 bf353116d1bf and 6.5-rc1 e8c2af660ba0 "wifi: cfg80211: fix regulatory disconnect with OCB/NAN". That is the removal of REGULATORY_IGNORE_STALE_KICKOFF from the wireless regulator internal API to fix any driver that allowed OCB/NAN. Note this code will need to be expanded once and if 6.4 include the above fixup. Signed-off-by: Alban Browaeys --- .../compilation/patch/drivers_network.sh | 3 ++ ...ireless-ignore-stale-kickoff-removal.patch | 41 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 patch/misc/wireless-rtl88x2bu-wireless-ignore-stale-kickoff-removal.patch diff --git a/lib/functions/compilation/patch/drivers_network.sh b/lib/functions/compilation/patch/drivers_network.sh index 1c0ef8b27..53adb9132 100644 --- a/lib/functions/compilation/patch/drivers_network.sh +++ b/lib/functions/compilation/patch/drivers_network.sh @@ -395,6 +395,9 @@ driver_rtl88x2bu() { # fix compilation for kernels >= 6.3 process_patch_file "${SRC}/patch/misc/wireless-rtl88x2bu-6.3.0.patch" "applying" + # fix compilation for kernels >= 6.3.13 < 6.4 and >= 6.5 + process_patch_file "${SRC}/patch/misc/wireless-rtl88x2bu-wireless-ignore-stale-kickoff-removal.patch" "applying" + fi } diff --git a/patch/misc/wireless-rtl88x2bu-wireless-ignore-stale-kickoff-removal.patch b/patch/misc/wireless-rtl88x2bu-wireless-ignore-stale-kickoff-removal.patch new file mode 100644 index 000000000..aa4173ef4 --- /dev/null +++ b/patch/misc/wireless-rtl88x2bu-wireless-ignore-stale-kickoff-removal.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alban Browaeys +Date: Sun, 16 Jul 2023 21:21:12 +0000 +Subject: Fixup for stale kickoff removal in wireless regulator API + +Cope with the fix in stable 6.3.13 bf353116d1bf and 6.5-rc1 e8c2af660ba0 +"wifi: cfg80211: fix regulatory disconnect with OCB/NAN". +That is the removal of REGULATORY_IGNORE_STALE_KICKOFF +from the wireless regulator internal API to fix any driver +that allowed OCB/NAN. + +Note this code will need to be expanded once and if 6.4 include the +above fixup. + +--- + drivers/net/wireless/rtl88x2bu/os_dep/linux/wifi_regd.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/rtl88x2bu/os_dep/linux/wifi_regd.c b/drivers/net/wireless/rtl88x2bu/os_dep/linux/wifi_regd.c +index 81e1dc75e5fb..04dc056f8d69 100644 +--- a/drivers/net/wireless/rtl88x2bu/os_dep/linux/wifi_regd.c ++++ b/drivers/net/wireless/rtl88x2bu/os_dep/linux/wifi_regd.c +@@ -403,11 +403,14 @@ int rtw_regd_init(struct wiphy *wiphy) + #else + wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; + wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; + #endif + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) \ ++ && ((LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 13)) \ ++ || (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))) \ ++ && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) + wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; + #endif + + return 0; + } +-- +Created with Armbian build tools https://github.com/armbian/build +