OpenWrt Forum Archive

Topic: TP-LINK Archer T4U RTL8812AU USB Wireless Adapter

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

my aim is to get the TP-LINK Archer T4U working in OpenWrt (TP-LINK 1043ND V2).
The adapter is connected to the USB port of the router.
While compiling the Kernel Module with SDK in Ubuntu 15.10 64bit, I always get the following error:

http://fs5.directupload.net/images/160310/j7o6wgbo.png

(The "Verbose" mode doesn't show more information)

I used this Makefile and the Open Source driver from Github.

#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=RTL8812AU
PKG_VERSION:=1.0
PKG_RELEASE:=1



PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtl8812au
  SUBMENU:=Wireless Drivers
  TITLE:=Driver for RTL8812AU wireless chipsets
  VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)
  FILES:= $(PKG_BUILD_DIR)/8812au.ko
  AUTOLOAD:=$(call AutoLoad,rtl8812au)
endef



EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1


#EXTRA_CFLAGS += -I$(src)/include

CONFIG_RTL8812A = y
CONFIG_RTL8821A = y
CONFIG_USB_HCI = y
CONFIG_MP_INCLUDED = y
CONFIG_POWER_SAVING = y
CONFIG_PLATFORM_ARM_RPI = y


export TopDIR ?= $(shell pwd)

ifeq ($(CONFIG_USB_HCI), y)
HCI_NAME = usb
endif


_OS_INTFS_FILES :=    os_dep/osdep_service.o \
            os_dep/linux/os_intfs.o \
            os_dep/linux/$(HCI_NAME)_intf.o \
            os_dep/linux/$(HCI_NAME)_ops_linux.o \
            os_dep/linux/ioctl_linux.o \
            os_dep/linux/xmit_linux.o \
            os_dep/linux/mlme_linux.o \
            os_dep/linux/recv_linux.o \
            os_dep/linux/ioctl_cfg80211.o \
            os_dep/linux/rtw_android.o


_HAL_INTFS_FILES :=    hal/hal_intf.o \
            hal/hal_com.o \
            hal/hal_com_phycfg.o \
            hal/hal_phy.o \
            hal/led/hal_$(HCI_NAME)_led.o

_OUTSRC_FILES := hal/OUTSRC/odm_debug.o    \
        hal/OUTSRC/odm_interface.o\
        hal/OUTSRC/odm_HWConfig.o\
        hal/OUTSRC/odm.o\
        hal/OUTSRC/HalPhyRf.o


########### HAL_RTL8812A_RTL8821A #################################

ifneq ($(CONFIG_RTL8812A)_$(CONFIG_RTL8821A), n_n)

RTL871X = rtl8812a
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8812au
endif

_HAL_INTFS_FILES +=  hal/HalPwrSeqCmd.o \
                    hal/$(RTL871X)/Hal8812PwrSeq.o \
                    hal/$(RTL871X)/Hal8821APwrSeq.o\
                    hal/$(RTL871X)/$(RTL871X)_xmit.o\
                    hal/$(RTL871X)/$(RTL871X)_sreset.o

_HAL_INTFS_FILES +=    hal/$(RTL871X)/$(RTL871X)_hal_init.o \
            hal/$(RTL871X)/$(RTL871X)_phycfg.o \
            hal/$(RTL871X)/$(RTL871X)_rf6052.o \
            hal/$(RTL871X)/$(RTL871X)_dm.o \
            hal/$(RTL871X)/$(RTL871X)_rxdesc.o \
            hal/$(RTL871X)/$(RTL871X)_cmd.o \
            hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \
            hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \
            hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \
            hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o

ifeq ($(CONFIG_SDIO_HCI), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
else
ifeq ($(CONFIG_GSPI_HCI), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
else
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
endif
endif

ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif

ifeq ($(CONFIG_RTL8812A), y)
EXTRA_CFLAGS += -DCONFIG_RTL8812A
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8812A_FW.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_MAC.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_BB.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_RF.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_FW.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_MAC.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_BB.o\
        hal/OUTSRC/$(RTL871X)/HalHWImg8812A_TestChip_RF.o\
        hal/OUTSRC/$(RTL871X)/HalPhyRf_8812A.o\
        hal/OUTSRC/$(RTL871X)/odm_RegConfig8812A.o
endif

ifeq ($(CONFIG_RTL8821A), y)

ifeq ($(CONFIG_RTL8812A), n)
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME := 8821au
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME := 8821ae
endif
endif

ifeq ($(CONFIG_SDIO_HCI), y)
MODULE_NAME := 8821as
endif

EXTRA_CFLAGS += -DCONFIG_RTL8821A
_OUTSRC_FILES += hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_MAC.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_BB.o\
        hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_RF.o\
        hal/OUTSRC/rtl8812a/HalPhyRf_8812A.o\
        hal/OUTSRC/rtl8821a/HalPhyRf_8821A.o\
        hal/OUTSRC/rtl8821a/odm_RegConfig8821A.o        
endif    


endif


########### AUTO_CFG  #################################    
        
ifeq ($(CONFIG_AUTOCFG_CP), y)

ifeq ($(CONFIG_MULTIDRV), y)    
$(shell cp $(TopDIR)/autoconf_multidrv_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
else
ifeq ($(CONFIG_RTL8188E)$(CONFIG_SDIO_HCI),yy) 
$(shell cp $(TopDIR)/autoconf_rtl8189e_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
else
$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
endif
endif

endif

########### END OF PATH  #################################



ifneq ($(USER_MODULE_NAME),)
MODULE_NAME := $(USER_MODULE_NAME)
endif

ifneq ($(KERNELRELEASE),)

rtk_core :=    core/rtw_cmd.o \
        core/rtw_security.o \
        core/rtw_debug.o \
        core/rtw_io.o \
        core/rtw_ioctl_query.o \
        core/rtw_ioctl_set.o \
        core/rtw_ieee80211.o \
        core/rtw_mlme.o \
        core/rtw_mlme_ext.o \
        core/rtw_wlan_util.o \
        core/rtw_vht.o \
        core/rtw_pwrctrl.o \
        core/rtw_rf.o \
        core/rtw_recv.o \
        core/rtw_sta_mgt.o \
        core/rtw_ap.o \
        core/rtw_xmit.o    \
        core/rtw_p2p.o \
        core/rtw_tdls.o \
        core/rtw_br_ext.o \
        core/rtw_iol.o \
        core/rtw_sreset.o\
        core/efuse/rtw_efuse.o

$(MODULE_NAME)-y += $(rtk_core)

$(MODULE_NAME)-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o

$(MODULE_NAME)-$(CONFIG_WAPI_SUPPORT) += core/rtw_wapi.o    \
                    core/rtw_wapi_sms4.o
                    
$(MODULE_NAME)-y += $(_OS_INTFS_FILES)
$(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
$(MODULE_NAME)-y += $(_OUTSRC_FILES)

$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
                    core/rtw_mp_ioctl.o

ifeq ($(CONFIG_RTL8723A), y)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
endif
ifeq ($(CONFIG_RTL8723B), y)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
endif

obj-$(CONFIG_RTL8812AU_8821AU) := $(MODULE_NAME).o

else

export CONFIG_RTL8812AU_8821AU = m

endif


MAKE_OPTS:= ARCH=$(LINUX_KARCH) CROSS_COMPILE=$(TARGET_CROSS) SUBDIRS="$(PKG_BUILD_DIR)" EXTRA_CFLAGS="$(EXTRA_CFLAGS)"

define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    echo $(PKG_BUILD_DIR)
    $(CP) -r /home/felix/rtl8812au/* $(PKG_BUILD_DIR)/
endef

define Build/Compile
    echo $(CONFIG_RTL8812AU_8821AU)
    $(MAKE) -C "$(LINUX_DIR)" \
        $(MAKE_OPTS) \
        modules
endef



$(eval $(call KernelPackage,rtl8812au))

What I'm doing wrong?
How can I get this USB Adapter working in OpenWrt?

Best Regards,
Apple2403

Make with

V=s

should give you much, much more information. Don't look at the last couple of lines but scroll up through the entire verbose output for the compile sequence for this package and look for any possible cause.

Thank you for fast response!

Here is the log with V=s:

make[2]: Entering directory '/media/felix/Data/openwrt/package/rtl8812au'
echo m
m
make -C "/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23" ARCH=mips CROSS_COMPILE=mips-openwrt-linux-uclibc- SUBDIRS="/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU" EXTRA_CFLAGS=" -O1 -DCONFIG_RTL8812A -DCONFIG_RTL8821A" modules
make[3]: Entering directory '/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23'
  CC [M]  /media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/core/rtw_cmd.o
/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/core/rtw_cmd.c:22:23: fatal error: drv_types.h: No such file or directory
 #include <drv_types.h>
                       ^
compilation terminated.
scripts/Makefile.build:257: recipe for target '/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/core/rtw_cmd.o' failed
make[4]: *** [/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/core/rtw_cmd.o] Error 1
Makefile:1381: recipe for target '_module_/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU' failed
make[3]: *** [_module_/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU] Error 2
make[3]: Leaving directory '/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23'
Makefile:261: recipe for target '/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/.built' failed
make[2]: *** [/media/felix/Data/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/RTL8812AU/.built] Error 2
make[2]: Leaving directory '/media/felix/Data/openwrt/package/rtl8812au'
package/Makefile:191: recipe for target 'package/rtl8812au/compile' failed
make[1]: *** [package/rtl8812au/compile] Error 2
make[1]: Leaving directory '/media/felix/Data/openwrt'
/media/felix/Data/openwrt/include/toplevel.mk:181: recipe for target 'package/compile' failed
make: *** [package/compile] Error 2

(Last edited by Apple2403 on 18 Mar 2016, 21:56)

Any ideas?

How much do you understand about the C programming language and how to compile C programs, libraries, projects, etc?

Clemmitt

I would say not much wink
Why is it so diffucult to compile the driver?

Maybe someone has already built this.

This error is very simple:  The header file named "drv_types.h" is missing.  I think this means your build tree and environment are incomplete but I don't know why.

It may not be possible to get this working because you have no experience compiling programs.  Maybe you can start a new thread and ask an experienced user to build what you need for you.  Please ask politely smile and explain what you think you need, for which hardware, and why.  HTH.

Clemmitt

"No such file or directory" is clear.
But the file is located in the Include folder. That's why I'm confused.
http://fs5.directupload.net/images/160319/djbuje53.png

Here is the same problem.

https://forum.openwrt.org/viewtopic.php?id=62247

Well it seems like i have to do some more work. I tried to compile it with the SDK even at start i get the first error.
There is a file called <drv_types.h> requiered to include but i donĀ“t get it why it Shows an error. I checked the package/include dir and this file is available there so why it says no such file or directory.

Hi,

Glad the problem is clear smile  I was afraid you didn't understand that much yikes

I don't know about the SDK or buildroot, sorry, no experience.  But I've built bunches of projects from source.

Missing header files which must be copied to other directories to be found usually means that the configuration/Makefile is missing "-I ../../some_build_dir/" options in the Makefile (usually a bunch of them), which are supposed to search other directories for header files.

I wouldn't expect you'd need to edit any Makefiles to get the compilation to work out-of-the-box, so something is weird.  Sorry, maybe someone else who's solved this problem can help you.

Clemmitt

No ideas?
Are there any experts that can build this driver for me please sad

Apple2403

My only thought -- which may not be of value sad -- is to start from scratch.  Make a new subdir and download everything from the beginning.  Then go through the setup, config and build process from the very first step.

Since you have "unfound" header files that do exist in the source tree, this makes me think that somehow something went wrong with preparing the source tree and Makefiles before building.  I'd recommend going through this exercise to prove to yourself there's an error in the build tree/process before reporting a bug.  I would think lots of SDK users would be screaming and filing tickets left and right if there were a major problem with the downloaded SDK.

Clemmitt

The discussion might have continued from here.