Page 1 of 1

RTL8812AU Driver source - custom kernel compile

Posted: Fri Apr 16, 2021 10:53 am
by DanR
Hi All and especially @MrEngMan!

I needed to make a change to the ADV7282A-M driver to change the gain settings amongst other things and it's working great apart from one problem! We use WiFi adapters that have the RTL8812AU chipset and now the drivers won't install as they're precompiled for each version of the kernel. I did see a post of yours with a link to a github page to the drivers but that no longer works. Do you happen to have the source code so I can recompile the driver myself please?

Thanks for all your hard work over the years Mr EngMan, I'm sure you're appreciated the world over.

Dan

Re: RTL8812AU Driver source - custom kernel compile

Posted: Fri Apr 16, 2021 12:45 pm
by MrEngman
Hi DanR,

I've just cloned the latest copy of the driver from

Code: Select all

https://github.com/aircrack-ng/rtl8812au
with the default branch, v5.6..2, and made a couple of minor changes to the Makefile for it to compile for the Raspberrypi

Code: Select all

diff -aur '--exclude=.git*' rtl8812au-new-orig/Makefile rtl8812au-new/Makefile
--- rtl8812au-new-orig/Makefile 2021-04-16 13:21:10.964044334 +0100
+++ rtl8812au-new/Makefile      2021-04-16 13:01:06.224213654 +0100
@@ -92,9 +92,9 @@
 ###################### MP HW TX MODE FOR VHT #######################
 CONFIG_MP_VHT_HW_TX_MODE = n
 ###################### Platform Related #######################
-CONFIG_PLATFORM_I386_PC = y
+CONFIG_PLATFORM_I386_PC = n
 CONFIG_PLATFORM_ANDROID_ARM64 = n
-CONFIG_PLATFORM_ARM_RPI = n
+CONFIG_PLATFORM_ARM_RPI = y
 CONFIG_PLATFORM_ARM64_RPI = n
 CONFIG_PLATFORM_ARM_NV_NANO = n
 CONFIG_PLATFORM_ANDROID_X86 = n
@@ -180,9 +180,11 @@

 ifeq ($(CONFIG_RTL8812A)_$(CONFIG_RTL8821A)_$(CONFIG_RTL8814A), y_y_n)

-EXTRA_CFLAGS += -DDRV_NAME=\"rtl88XXau\"
+#EXTRA_CFLAGS += -DDRV_NAME=\"rtl88XXau\"
+EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
 ifeq ($(CONFIG_USB_HCI), y)
-USER_MODULE_NAME = 88XXau
+#USER_MODULE_NAME = 88XXau
+USER_MODULE_NAME = 8812au
 endif
 else
 EXTRA_CFLAGS += -DDRV_NAME=\"rtl8812au\"
and then compiled the driver for kernel 5.10.27 and it compiles without any warnings or errors, which I was a little surprised about.

Comparing the source I am currently using with the latest version there are a very large number of changes which makes compiling the new version without errors really suprising.



MrEngman

Re: RTL8812AU Driver source - custom kernel compile

Posted: Fri Apr 16, 2021 2:03 pm
by DanR
Hiya MrEngMan,

Thank you ever so much for your reply. I'll give it a go on Monday as I'm about to finish for the day. Fingers crossed I get it compiled and running. I take it the change list in your reply is the complete set of changes you made so once I've done that it should compile?

Kind Regards,

Dan

Re: RTL8812AU Driver source - custom kernel compile

Posted: Fri Apr 16, 2021 2:58 pm
by MrEngman
Hopefully you will get it working.

Yes, those are the only changes I made.



MrEngman

Re: RTL8812AU Driver source - custom kernel compile

Posted: Mon Apr 19, 2021 2:35 pm
by DanR
Hiya MrEngman,

Thanks ever so much for your help with this, I had to change a CFLAGS directive on line 8

from: EXTRA_CFLAGS +=-Wimplicit-fallthrough
to: EXTRA_CFLAGS += -Wno-fallthrough

and it compiled first time! Next was a "sudo make install" and then "sudo modprobe 8812au rtw_switch_usb_mode=1" and it works.

Cheers!

Dan