clnhub / rtl8192eu-linux

Realtek rtl8192eu official Linux driver, versions: 5.2.19.1 (master), 5.6.3.1, 5.6.4 and 5.11.2.1 (default)
443 stars 90 forks source link

AArch64 support #15

Closed maxnatt closed 4 years ago

maxnatt commented 4 years ago

Greetings,

is there any way to compile this on AArch64 hardware? I have Raspberry Pi 4 with Fedora 32 (aarch64 build) and get following result when issuing make:

make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/5.6.2-301.fc32.aarch64/build M=/home/max/rtl8192eu-linux  modules
make[1]: Entering directory '/usr/src/kernels/5.6.2-301.fc32.aarch64'
Makefile:653: arch/aarch64/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/aarch64/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/kernels/5.6.2-301.fc32.aarch64'
make: *** [Makefile:1829: modules] Error 2

Is there any way to resolve the issue?

clnhub commented 4 years ago

You can try adding

CONFIG_PLATFORM_ARM_RPI = y

or

CONFIG_PLATFORM_ARM_AARCH64=y

to you Makefile and also set the default i386 platform to n.

You should probably also add the part below so the compiler can recognize your architecture.

 ifeq ($(CONFIG_PLATFORM_ARM_RPI), y)
 EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
 EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
 ARCH := arm
 CROSS_COMPILE :=
 KVER  := $(shell uname -r)
 KSRC ?= /lib/modules/$(KVER)/build
 MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
 endif

 ifeq ($(CONFIG_PLATFORM_ARM_AARCH64), y)
 EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
 ARCH := arm64
 CROSS_COMPILE :=
 KVER  := $(shell uname -r)
 KSRC ?= /lib/modules/$(KVER)/build
 MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
 endif

Btw, I can't test if this works, because my primary environment is Ubuntu x64.

maxnatt commented 4 years ago

Thanks for the suggestion, I'll try it in a few days and will write back.

maxnatt commented 4 years ago

Sorry for the delay. I can confirm that providing CONFIG_PLATFORM_ARM_AARCH64=y and the snippet above works like a charm on Fedora 32 (aarch64) and RPi 4, thanks!

I haven't tested this driver in the long run yet, but at least I am able to connect to Wi-Fi, as stock driver provided in Fedora just gives timeouts when connecting (kernel 5.6.2-5.6.7).