rtl8188eus icon indicating copy to clipboard operation
rtl8188eus copied to clipboard

Minor Makefile changes to build in RPi 3b + for WN722n V3

Open estcap2 opened this issue 6 years ago • 5 comments

I managed to build the driver inside the RPi itself with this minor changes:

Changed the line CONFIG_PLATFORM_I386_PC = y to CONFIG_PLATFORM_I386_PC = n Added the line CONFIG_PLATFORM_ARM_RPI = y

Added the following lines on the ifeq($(CONFIG_PLATFORM_* section

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

I hope this might be useful for someone

estcap2 avatar Nov 22 '18 20:11 estcap2

This should be a pull request.

Dragas avatar Mar 15 '19 17:03 Dragas

@Dragas I would suggest as such but this was not tested throughly since I got a WN722n V1 shortly after submitting this. I recall being able to build and install whith this modification, but afterwards having issues with injecting or some relevant features I wanted to use. I believe that capturing packets still worked well though.

estcap2 avatar Mar 15 '19 22:03 estcap2

Hmm, I agree. There are some issues with V3 as well. For example I can't switch channels and need to use legacy methods to setup monitor mode.

Dragas avatar Mar 16 '19 09:03 Dragas

ummm after making these changes I'm getting this output... any ideas?

make ARCH=arm CROSS_COMPILE= -C /lib/modules/6.1.21-v8+/build M=/home/pi/temp/rtl8188eus  modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21-v8+'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Debian 10.2.1-6) 10.2.1 20210110
  You are using:           gcc (Debian 12.2.0-14) 12.2.0
  CC [M]  /home/pi/temp/rtl8188eus/core/rtw_cmd.o
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
gcc: error: unrecognized command-line option ‘-mapcs’
gcc: error: unrecognized command-line option ‘-mno-sched-prolog’
gcc: error: unrecognized command-line option ‘-msoft-float’
make[2]: *** [scripts/Makefile.build:250: /home/pi/temp/rtl8188eus/core/rtw_cmd.o] Error 1
make[1]: *** [Makefile:2012: /home/pi/temp/rtl8188eus] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21-v8+'
make: *** [Makefile:1922: modules] Error 2

if I edit the platform to be arm64 instead of arm I get this

make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/6.1.21-v8+/build M=/home/pi/temp/rtl8188eus  modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.21-v8+'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Debian 10.2.1-6) 10.2.1 20210110
  You are using:           gcc (Debian 12.2.0-14) 12.2.0
  CC [M]  /home/pi/temp/rtl8188eus/core/rtw_cmd.o
In file included from /home/pi/temp/rtl8188eus/include/osdep_service.h:46,
                 from /home/pi/temp/rtl8188eus/include/drv_types.h:32,
                 from /home/pi/temp/rtl8188eus/core/rtw_cmd.c:22:
/home/pi/temp/rtl8188eus/core/rtw_cmd.c: In function ‘rtw_cmd_thread’:
/home/pi/temp/rtl8188eus/include/osdep_service_linux.h:185:23: error: implicit declaration of function ‘complete_and_exit’ [-Werror=implicit-function-declaration]
  185 | #define thread_exit() complete_and_exit(NULL, 0)
      |                       ^~~~~~~~~~~~~~~~~
/home/pi/temp/rtl8188eus/core/rtw_cmd.c:747:9: note: in expansion of macro ‘thread_exit’
  747 |         thread_exit();
      |         ^~~~~~~~~~~
/home/pi/temp/rtl8188eus/core/rtw_cmd.c:749:1: error: control reaches end of non-void function [-Werror=return-type]
  749 | }
      | ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:250: /home/pi/temp/rtl8188eus/core/rtw_cmd.o] Error 1
make[1]: *** [Makefile:2012: /home/pi/temp/rtl8188eus] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.21-v8+'
make: *** [Makefile:1947: modules] Error 2

filipopo avatar Dec 23 '23 01:12 filipopo

Well, this builds... https://github.com/ivanovborislav/rtl8188eu So I took code from that project and replaced rtl8188eus/core/rtw_cmd.c:747:16 with "return 0;" but it still doesn't compile...

filipopo avatar Dec 23 '23 02:12 filipopo