rtl8812au-ct: fix compilation error with kernel 6.1
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 23 Jul 2023 12:41:35 +0000 (14:41 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 23 Jul 2023 12:45:18 +0000 (14:45 +0200)
Kernel 6.1 have renamed complete_and_exit to kthread_complete_and_exit.
This was just a rename and nothing is changed implementation wise.

Fix compilation error by using the new symbol name.

Fix compilation error:
In file included from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/osdep_service.h:41,
                 from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/drv_types.h:32,
                 from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:22:
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c: In function 'rtw_cmd_thread':
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/osdep_service_linux.h:166:23: error: implicit declaration of function 'complete_and_exit' [-Werror=implicit-function-declaration]
  166 | #define thread_exit() complete_and_exit(NULL, 0)
      |                       ^~~~~~~~~~~~~~~~~
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:706:9: note: in expansion of macro 'thread_exit'
  706 |         thread_exit();
      |         ^~~~~~~~~~~
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:708:1: error: control reaches end of non-void function [-Werror=return-type]
  708 | }
      | ^
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/kernel/rtl8812au-ct/patches/005-kernel-6.1.patch [new file with mode: 0644]

diff --git a/package/kernel/rtl8812au-ct/patches/005-kernel-6.1.patch b/package/kernel/rtl8812au-ct/patches/005-kernel-6.1.patch
new file mode 100644 (file)
index 0000000..98aa678
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/include/osdep_service_linux.h
++++ b/include/osdep_service_linux.h
+@@ -163,7 +163,11 @@ typedef void*             _thread_hdl_;
+ typedef int           thread_return;
+ typedef void* thread_context;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0))
++#define thread_exit() kthread_complete_and_exit(NULL, 0)
++#else
+ #define thread_exit() complete_and_exit(NULL, 0)
++#endif
+ typedef void timer_hdl_return;
+ typedef void* timer_hdl_context;