From 9d4d3f52a297adcd87d83366a8182876475a1b7c Mon Sep 17 00:00:00 2001 From: Christian Sarre Date: Wed, 1 Nov 2023 09:49:57 +0200 Subject: [PATCH] Fix build on Ubuntu 23.04 (kernel 6.2). This is done by specifying the ranges for 6.3 and 6.4 versions which need the fix. Kernel 6.2, to my knowledge, is not used in other popular distros than Ubuntu. Ubuntu had backported the change from kernel 6.5 to 6.2, which is why this is needed. Added a comment instructing what to do if one wants to build the module running kernel 6.2 on something else than Ubuntu. --- os_dep/linux/wifi_regd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 2f642f4..45c5bd1 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -396,7 +396,15 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg, struct wiphy *wiphy wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 39)) +/* + * Ubuntu backported a specific upstream change to kernel 6.2 while others skipped 6.2 altogether. + * If build fails on kernel 6.2.x and you're not using Ubuntu, + * try changing the version "(6, 3, 0)" below to "(6, 2, 0)". + */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 39)) \ + || (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 13)) \ + || (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 4)) wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF; #endif