ivanovborislav / rtl8188eu

Realtek RTL8188EU v5.13.3 (2021-06-15) Wireless Lan Driver for Linux
GNU General Public License v2.0
123 stars 31 forks source link

Build fails on Ubuntu 23.04 #17

Closed tristantarrant closed 1 year ago

tristantarrant commented 1 year ago

Using DKMS with Ubuntu 23.04, Kernel 6.2.0-1003-lowlatency

DKMS make.log for 8188eu-git for kernel 6.2.0-1003-lowlatency (x86_64)
ven 12 mag 2023, 12:13:51, CEST
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.19.0-1023-lowlatency/build M=/var/lib/dkms/8188eu/git/build  modules
make[1]: Entering directory '/usr/src/linux-headers-5.19.0-1023-lowlatency'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
  You are using:           gcc-12 (Ubuntu 12.2.0-17ubuntu1) 12.2.0
  CC [M]  /var/lib/dkms/8188eu/git/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/8188eu/git/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/8188eu/git/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/8188eu/git/build/core/rtw_debug.o
In file included from /var/lib/dkms/8188eu/git/build/core/rtw_cmd.c:22:
/var/lib/dkms/8188eu/git/build/core/rtw_cmd.c: In function ‘rtw_cmd_thread’:
/var/lib/dkms/8188eu/git/build/include/osdep_service.h:70:23: error: implicit declaration of function ‘complete_and_exit’ [-Werror=implicit-function-declaration]
   70 | #define thread_exit() complete_and_exit(NULL, 0)
      |                       ^~~~~~~~~~~~~~~~~
/var/lib/dkms/8188eu/git/build/core/rtw_cmd.c:387:9: note: in expansion of macro ‘thread_exit’
  387 |         thread_exit();
      |         ^~~~~~~~~~~
/var/lib/dkms/8188eu/git/build/core/rtw_br_ext.c:24:10: fatal error: net/ipx.h: No such file or directory
   24 | #include <net/ipx.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:257: /var/lib/dkms/8188eu/git/build/core/rtw_br_ext.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/lib/dkms/8188eu/git/build/core/rtw_cmd.c:388:1: error: control reaches end of non-void function [-Werror=return-type]
  388 | }
      | ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:258: /var/lib/dkms/8188eu/git/build/core/rtw_cmd.o] Error 1
make[1]: *** [Makefile:1850: /var/lib/dkms/8188eu/git/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.19.0-1023-lowlatency'
make: *** [Makefile:155: modules] Error 2
tristantarrant commented 1 year ago
diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c
index 1236f50..bfe5f43 100644
--- a/core/rtw_br_ext.c
+++ b/core/rtw_br_ext.c
@@ -19,9 +19,11 @@
  ******************************************************************************/
 #define _RTW_BR_EXT_C_

+#include <linux/version.h>
 #include <linux/if_arp.h>
-#include <net/ip.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
 #include <net/ipx.h>
+#endif
 #include <linux/atalk.h>
 #include <linux/udp.h>
 #include <linux/if_pppox.h>
@@ -664,6 +666,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
                        return -1;
                }

+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
                /*   IPX   */
                if (ipx != NULL) {
                        switch (method) {
@@ -723,6 +726,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
                                return -1;
                        }
                } else if (ea != NULL) {
+#else
+                if (ea != NULL) {
+#endif
                        /* Sanity check fields. */
                        if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
                                DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
diff --git a/include/osdep_service.h b/include/osdep_service.h
index ce76a2c..df5777f 100644
--- a/include/osdep_service.h
+++ b/include/osdep_service.h
@@ -67,7 +67,11 @@ struct       __queue {
        spinlock_t lock;
 };

-#define thread_exit() complete_and_exit(NULL, 0)
+#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

 static inline struct list_head *get_list_head(struct __queue *queue)
 {
ivanovborislav commented 1 year ago

Hi! Are you sure about this? Can you try to compile this driver.

tristantarrant commented 1 year ago

Forgive me: I had an old dkms module that was lurking there :(