Compare commits

...

3 Commits

Author SHA1 Message Date
Christian Bremvåg 4a983e47da
Merge pull request #1119 from sarrchri/fix-build-6x
Fixed build on 6.x kernels.
2023-11-03 18:02:21 +01:00
Christian Sarre 9d4d3f52a2 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.
2023-11-01 09:49:57 +02:00
Christian Sarre d8ad927155 Fix build on 6.x kernels.
It was broken due to kernel changes backported from 6.5 (torvalds/linux@e8c2af6).
Changes have been tested on the following configurations and observed to build:
 - Debian Bullseye, kernel 6.1.38-4 (bullseye-backports)
 - Debian Bookworm, kernel 6.1.52-1
 - Ubuntu 23.04 Lunar, kernel 6.2.0-36

There are also other kernel versions which are affected up to some point in their history,
but there were a few reasons I ended up not including them:
 - Kernel 6.2: Not in use on Debian, likely skipped in favor of 6.4+. Ubuntu though has backported the change to 6.2 on Lunar.
 - Kernel 6.3: Not in use on Debian/Ubuntu, seems to have been skipped in favor of 6.4/6.5+.
 - Kernel 6.4: Not in use on Ubuntu. Debian Bookworm has this available in backports, but they now also offer 6.5 which does not have the issue.

In case someone tries to build this module running kernel 6.2 on something other than Ubuntu, this fix is most likely necessary.
2023-10-31 21:04:54 +02:00
1 changed files with 9 additions and 1 deletions

View File

@ -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, 5, 0))
/*
* 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