Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtl8852au does not build with kernel 6.13 #110

Open
t-puetz opened this issue Feb 2, 2025 · 10 comments
Open

rtl8852au does not build with kernel 6.13 #110

t-puetz opened this issue Feb 2, 2025 · 10 comments

Comments

@t-puetz
Copy link

t-puetz commented Feb 2, 2025

[myusername@myusername-main ~]$ sudo dkms --verbose build -m rtl8852au -v r100.865ab0f

Sign command: /usr/lib/modules/6.13.0-1-MANJARO/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

'make' clean
 done.
'make' -j32 KVER=6.13.0-1-MANJARO
(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.13.0-1-MANJARO (x86_64)
Consult /var/lib/dkms/rtl8852au/r100.865ab0f/build/make.log for more information.

[myusername@myusername-main ~]$ cat /var/lib/dkms/rtl8852au/r100.865ab0f/build/make.log for more information.

DKMS (dkms-3.1.5) make.log for rtl8852au/r100.865ab0f for kernel 6.13.0-1-MANJARO (x86_64)
So 2. Feb 09:07:07 CET 2025
Cleaning build area
# command: 'make' clean
#make -C /lib/modules/6.13.0-1-MANJARO/build M=/var/lib/dkms/rtl8852au/r100.865ab0f/build clean
cd phl ; rm -fr */*/*/*/*.mod.c */*/*/*/*.mod */*/*/*/*.o */*/*/*/.*.cmd */*/*/*/*.ko
cd phl ; rm -fr */*/*/*.mod.c */*/*/*.mod */*/*/*.o */*/*/.*.cmd */*/*/*.ko
cd phl ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/.*.cmd */*/*.ko
cd phl ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd phl ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd core ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd os_dep/linux/hwsim ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
/bin/sh: line 1: cd: os_dep/linux/hwsim: No such file or directory
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
rm -fr .tmp_versions

# exit code: 0
# elapsed time: 00:00:00
Building module(s)
# command: 'make' -j32 KVER=6.13.0-1-MANJARO
#rm -f .symvers.8852au
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.13.0-1-MANJARO/build M=/var/lib/dkms/rtl8852au/r100.865ab0f/build  modules
make[1]: Entering directory '/usr/lib/modules/6.13.0-1-MANJARO/build'
make[2]: Entering directory '/var/lib/dkms/rtl8852au/r100.865ab0f/build'
  CC [M]  os_dep/osdep_service.o
  CC [M]  os_dep/osdep_service_linux.o
  CC [M]  os_dep/linux/rtw_cfg.o
  CC [M]  os_dep/linux/os_intfs.o
  CC [M]  os_dep/linux/ioctl_linux.o
  CC [M]  os_dep/linux/xmit_linux.o
  CC [M]  os_dep/linux/mlme_linux.o
  CC [M]  os_dep/linux/recv_linux.o
  CC [M]  os_dep/linux/ioctl_cfg80211.o
  CC [M]  os_dep/linux/rtw_cfgvendor.o
  CC [M]  os_dep/linux/wifi_regd.o
  CC [M]  os_dep/linux/rtw_android.o
  CC [M]  os_dep/linux/rtw_proc.o
  CC [M]  os_dep/linux/nlrtw.o
  CC [M]  os_dep/linux/rtw_rhashtable.o
  CC [M]  os_dep/linux/usb_intf.o
  CC [M]  os_dep/linux/usb_ops_linux.o
  CC [M]  core/rtw_cmd.o
  CC [M]  core/rtw_security.o
  CC [M]  core/rtw_debug.o
  CC [M]  core/rtw_io.o
  CC [M]  core/rtw_ioctl_query.o
  CC [M]  core/rtw_ioctl_set.o
  CC [M]  core/rtw_ieee80211.o
  CC [M]  core/rtw_mlme.o
  CC [M]  core/rtw_mlme_ext.o
  CC [M]  core/rtw_sec_cam.o
  CC [M]  core/rtw_mi.o
  CC [M]  core/rtw_wlan_util.o
  CC [M]  core/rtw_vht.o
  CC [M]  core/rtw_he.o
  CC [M]  core/rtw_pwrctrl.o
os_dep/linux/recv_linux.c: In function ‘rtw_os_recv_indicate_pkt’:
os_dep/linux/recv_linux.c:487:68: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
  487 |                         DBG_COUNTER(padapter->rx_logs.os_netif_err);
      |                                                                    ^
core/rtw_mlme_ext.c: In function ‘OnAuth’:
core/rtw_mlme_ext.c:2510:41: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 2510 |                                         ;/* TODO: STA re_auth within expire_to */
      |                                         ^
core/rtw_mlme_ext.c:2515:33: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 2515 |                                 ; /* TODO: STA re_auth and auth timeout */
      |                                 ^
In file included from /usr/lib/modules/6.13.0-1-MANJARO/build/include/linux/module.h:22,
                 from ././include/basic_types.h:38,
                 from ././include/drv_types.h:24,
                 from os_dep/osdep_service_linux.c:16:
os_dep/osdep_service_linux.c: In function ‘openFile’:
os_dep/osdep_service_linux.c:393:26: error: expected ‘,’ or ‘;’ before ‘VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver’
  393 |         MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/modules/6.13.0-1-MANJARO/build/include/linux/moduleparam.h:26:61: note: in definition of macro ‘__MODULE_INFO’
   26 |                 = __MODULE_INFO_PREFIX __stringify(tag) "=" info
      |                                                             ^~~~
/usr/lib/modules/6.13.0-1-MANJARO/build/include/linux/module.h:299:33: note: in expansion of macro ‘MODULE_INFO’
  299 | #define MODULE_IMPORT_NS(ns)    MODULE_INFO(import_ns, ns)
      |                                 ^~~~~~~~~~~
os_dep/osdep_service_linux.c:393:9: note: in expansion of macro ‘MODULE_IMPORT_NS’
  393 |         MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
      |         ^~~~~~~~~~~~~~~~
os_dep/osdep_service_linux.c: In function ‘isFileReadable’:
os_dep/osdep_service_linux.c:511:26: error: expected ‘,’ or ‘;’ before ‘VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver’
  511 |         MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/modules/6.13.0-1-MANJARO/build/include/linux/moduleparam.h:26:61: note: in definition of macro ‘__MODULE_INFO’
   26 |                 = __MODULE_INFO_PREFIX __stringify(tag) "=" info
      |                                                             ^~~~
/usr/lib/modules/6.13.0-1-MANJARO/build/include/linux/module.h:299:33: note: in expansion of macro ‘MODULE_INFO’
  299 | #define MODULE_IMPORT_NS(ns)    MODULE_INFO(import_ns, ns)
      |                                 ^~~~~~~~~~~
os_dep/osdep_service_linux.c:511:9: note: in expansion of macro ‘MODULE_IMPORT_NS’
  511 |         MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
      |         ^~~~~~~~~~~~~~~~
make[4]: *** [/usr/lib/modules/6.13.0-1-MANJARO/build/scripts/Makefile.build:194: os_dep/osdep_service_linux.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  CC [M]  core/rtw_rf.o
os_dep/linux/ioctl_cfg80211.c:10327:32: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct cfg80211_chan_def *)’ [-Wincompatible-pointer-types]
10327 |         .set_monitor_channel = cfg80211_rtw_set_monitor_channel,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
os_dep/linux/ioctl_cfg80211.c:10327:32: note: (near initialization for ‘rtw_cfg80211_ops.set_monitor_channel’)
make[4]: *** [/usr/lib/modules/6.13.0-1-MANJARO/build/scripts/Makefile.build:194: os_dep/linux/ioctl_cfg80211.o] Error 1
make[3]: *** [/usr/lib/modules/6.13.0-1-MANJARO/build/Makefile:1989: .] Error 2
make[2]: *** [/usr/lib/modules/6.13.0-1-MANJARO/build/Makefile:251: __sub-make] Error 2
make[2]: Leaving directory '/var/lib/dkms/rtl8852au/r100.865ab0f/build'
make[1]: *** [Makefile:251: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.13.0-1-MANJARO/build'
make: *** [Makefile:639: modules] Error 2

# exit code: 2
# elapsed time: 00:00:03
cat: for: No such file or directory
cat: more: No such file or directory
cat: information.: No such file or directory

This is a patch for 8812au on nothing-but-slackware.blog.jp for the issue:

diff -Nru a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
--- a/os_dep/linux/ioctl_cfg80211.c    2025-01-21 18:06:21.269286898 +0900
+++ b/os_dep/linux/ioctl_cfg80211.c    2025-01-21 18:40:55.274464120 +0900
@@ -6306,7 +6306,10 @@
 }
 
 static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+    , struct net_device *dev
+    , struct cfg80211_chan_def *chandef
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
     , struct cfg80211_chan_def *chandef
 #else
     , struct ieee80211_channel *chan
diff -Nru a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c
--- a/os_dep/linux/usb_intf.c    2025-01-21 18:47:13.545496443 +0900
+++ b/os_dep/linux/usb_intf.c    2025-01-21 18:42:02.357469852 +0900
@@ -1640,7 +1640,7 @@
     rtw_mstat_dump(RTW_DBGDUMP);
 }
 
-#ifdef MODULE_IMPORT_NS
+#if (defined MODULE_IMPORT_NS && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
 MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
 #endif
 
diff -Nru a/os_dep/osdep_service.c b/os_dep/osdep_service.c
--- a/os_dep/osdep_service.c    2025-01-21 18:46:30.546492769 +0900
+++ b/os_dep/osdep_service.c    2025-01-21 18:42:51.308474035 +0900
@@ -26,7 +26,7 @@
 #endif
 #endif /* DBG_MEMORY_LEAK */
 
-#if defined(MODULE_IMPORT_NS)
+#if (defined(MODULE_IMPORT_NS) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
 MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
 #endif

I managed to then manually patch the MODULE_IMPORT_NS part, and all errors about that did indeed disappear. Unfortunately I am not skilled enough to fix the struct net_device *dev
and struct cfg80211_chan_def *chandef part.

A patch or commit to make rtl8852au compile under kernel 6.13 would be greatly appreciated. Thanks :)

@moontide
Copy link
Contributor

moontide commented Feb 3, 2025

This is a patch for 8812au on nothing-but-slackware.blog.jp for the issue

I came from that website too.

Based on that patch from RTL88x2bu_chipset-driver with kernel-6.13 support : Nothin' but Slackware, here's a patch for rtl8852au:

diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index 2b79c97..277dffb 100755
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -6350,6 +6350,9 @@ static void rtw_get_chbwoff_from_cfg80211_chan_def(
 
 static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
+	, struct net_device *dev
+#endif
 	, struct cfg80211_chan_def *chandef
 #else
 	, struct ieee80211_channel *chan
diff --git a/os_dep/osdep_service_linux.c b/os_dep/osdep_service_linux.c
index fe47c3b..8fdbcfc 100644
--- a/os_dep/osdep_service_linux.c
+++ b/os_dep/osdep_service_linux.c
@@ -390,7 +390,9 @@ static int openFile(struct file **fpp, const char *path, int flag, int mode)
 	struct file *fp;
 
 #if defined(MODULE_IMPORT_NS)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
 	MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
+#endif
 #endif
 
 	fp = filp_open(path, flag, mode);
@@ -508,7 +510,9 @@ static int isFileReadable(const char *path, u32 *sz)
 	char buf;
 
 #if defined(MODULE_IMPORT_NS)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
 	MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
+#endif
 #endif
 
 	fp = filp_open(path, O_RDONLY, 0);

modinfo

# modinfo 8852au                                                                                                                                                                                                                                              
filename:       /lib/modules/6.13.1-200.fc41.x86_64/kernel/drivers/net/wireless/realtek/rtw89/8852au.ko                                                                                                                                                       
version:        v1.15.0.1-0-g487ee886.20210714

@Luauc
Copy link

Luauc commented Feb 3, 2025

This is a patch for 8812au on nothing-but-slackware.blog.jp for the issue

I came from that website too.

Based on that patch from RTL88x2bu_chipset-driver with kernel-6.13 support : Nothin' but Slackware, here's a patch for rtl8852au:

diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index 2b79c97..277dffb 100755
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -6350,6 +6350,9 @@ static void rtw_get_chbwoff_from_cfg80211_chan_def(

static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))

  • , struct net_device *dev
    +#endif
    , struct cfg80211_chan_def *chandef
    #else
    , struct ieee80211_channel *chan
    diff --git a/os_dep/osdep_service_linux.c b/os_dep/osdep_service_linux.c
    index fe47c3b..8fdbcfc 100644
    --- a/os_dep/osdep_service_linux.c
    +++ b/os_dep/osdep_service_linux.c
    @@ -390,7 +390,9 @@ static int openFile(struct file **fpp, const char *path, int flag, int mode)
    struct file *fp;

#if defined(MODULE_IMPORT_NS)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
+#endif
#endif

fp = filp_open(path, flag, mode);
@@ -508,7 +510,9 @@ static int isFileReadable(const char *path, u32 *sz)
char buf;

#if defined(MODULE_IMPORT_NS)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0))
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
+#endif
#endif

fp = filp_open(path, O_RDONLY, 0);

modinfo

# modinfo 8852au                                                                                                                                                                                                                                              
filename:       /lib/modules/6.13.1-200.fc41.x86_64/kernel/drivers/net/wireless/realtek/rtw89/8852au.ko                                                                                                                                                       
version:        v1.15.0.1-0-g487ee886.20210714

this does make the driver work but when connecting to a wifi network (I have tried multiple) it just asks me for password even though it was the correct one.

@moontide
Copy link
Contributor

moontide commented Feb 4, 2025

this does make the driver work but when connecting to a wifi network (I have tried multiple) it just asks me for password even though it was the correct one.

I'm not sure why, it works for me.

# nmcli d show wlp0s20f0u3u2
GENERAL.DEVICE:                         wlp0s20f0u3u2
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         5A:0A:CD:**:**:**
GENERAL.MTU:                            1500
GENERAL.STATE:                          100(已连接)
GENERAL.CONNECTION:                     *****

# grep DRIVER /sys/class/net/wlp0s20f0u3u2/device/uevent 
DRIVER=rtl8852au

Did you try on another physical computer?

About one year ago, my USB WiFi adapter works in AP mode in both 2.4GHz and 5GHz band, but now, AP mode only works in 2.4GHz band. But if I plug this adapter on another computer, AP mode works fine in both 2.4GHz and 5GHz band. I don't know why, but maybe you can try on another computer to see if it works.

@gchait
Copy link

gchait commented Feb 4, 2025

this does make the driver work but when connecting to a wifi network (I have tried multiple) it just asks me for password even though it was the correct one.

Is the auth WPA2? I wasted a lot of time not knowing it doesn't work with WPA3, before 6.13 I mean.

@t-puetz
Copy link
Author

t-puetz commented Feb 4, 2025

I can also report that it works for me. Thanks so much!

@Luauc
Copy link

Luauc commented Feb 4, 2025

this does make the driver work but when connecting to a wifi network (I have tried multiple) it just asks me for password even though it was the correct one.

Is the auth WPA2? I wasted a lot of time not knowing it doesn't work with WPA3, before 6.13 I mean.

yep its WPA2 and I feel lost :(

@Luauc
Copy link

Luauc commented Feb 4, 2025

this does make the driver work but when connecting to a wifi network (I have tried multiple) it just asks me for password even though it was the correct one.

I'm not sure why, it works for me.

nmcli d show wlp0s20f0u3u2

GENERAL.DEVICE: wlp0s20f0u3u2
GENERAL.TYPE: wifi
GENERAL.HWADDR: 5A:0A:CD:::**
GENERAL.MTU: 1500
GENERAL.STATE: 100(已连接)
GENERAL.CONNECTION: *****

grep DRIVER /sys/class/net/wlp0s20f0u3u2/device/uevent

DRIVER=rtl8852au

Did you try on another physical computer?

About one year ago, my USB WiFi adapter works in AP mode in both 2.4GHz and 5GHz band, but now, AP mode only works in 2.4GHz band. But if I plug this adapter on another computer, AP mode works fine in both 2.4GHz and 5GHz band. I don't know why, but maybe you can try on another computer to see if it works.

Unfortunately I dont have another computer nearby

@Luauc
Copy link

Luauc commented Feb 4, 2025

Unfortunately I dont have another computer nearby

funny enough I cant find my 2.4Ghz network in the network manager. (Arch Linux)

@Luauc
Copy link

Luauc commented Feb 4, 2025

When I am home I am going to see if the problem might be that I have multiple network managers (the stock one from the install iso) and see if that is what clashes and doesn't let me connect

@Luauc
Copy link

Luauc commented Feb 4, 2025

I feel stupid, I just had to switch USB input on the computer... GG!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants