Support for WAVE 300 Wi-Fi chip

Hey @pc2005 I am trying to compile with OpenWrt Linux v4.19.65 but it seems the repo tries to look for v4.14.105 specifically.

The log is:

Making install in mtlkroot
make[3]: Entering directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot'
make[4]: Entering directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot/linux'
make[4]: *** /home/ahmar/build-system/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/linux-4.14.105: No such file or directory.  Stop.
make[4]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot/linux'
make[3]: *** [Makefile:486: mtlkroot.ko] Error 11
make[3]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot'
make[2]: *** [Makefile:588: install-recursive] Error 1
make[2]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools'
make[1]: *** [Makefile:519: install-recursive] Error 1
make[1]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288'
make: *** [Makefile:21: all] Error 2

Is it supposed to be happening? Should it not just look for something around 4.* or something?

It looks for 4.* .. in the file support/ugw.env.common:

#Kernel directory location
DEFAULT_KERNEL_DIR=`echo $(get_toolchain_path)/build_dir/target-mips_*/linux-lantiq_xrx200/linux-4.*`

mayeb there is some leftover directory 4.14.* ... you can always set the variable directly.

Well the above worked but halfway through it showed errors and I think something has changed in v4.19.65 that needs to be corrected.

/home/ahmar/build-system/wave300-source/wave300/wireless/driver/linux/osal_defs.c: In function '_mtlk_osal_timer_init':
/home/ahmar/build-system/wave300-source/wave300/wireless/driver/linux/osal_defs.c:63:3: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration]
   init_timer(&timer->os_timer);
   ^~~~~~~~~~
   init_timers
/home/ahmar/build-system/wave300-source/wave300/wireless/driver/linux/osal_defs.c:67:18: error: 'struct timer_list' has no member named 'data'
   timer->os_timer.data     = (unsigned long)timer;
                  ^
/home/ahmar/build-system/wave300-source/wave300/wireless/driver/linux/osal_defs.c:68:28: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
   timer->os_timer.function = __mtlk_osal_timer_clb;
                            ^
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:304: /home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot/linux/wireless/driver/linux/osal_defs.o] Error 1
make[4]: *** [Makefile:1517: _module_/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot/linux] Error 2
make[4]: Leaving directory '/home/ahmar/build-system/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/linux-4.19.65'
make[3]: *** [Makefile:486: mtlkroot.ko] Error 11
make[3]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools/mtlkroot'
make[2]: *** [Makefile:588: install-recursive] Error 1
make[2]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288/tools'
make[1]: *** [Makefile:519: install-recursive] Error 1
make[1]: Leaving directory '/home/ahmar/build-system/wave300-source/wave300/builds/ugw5.4-vrx288'
make: *** [Makefile:21: all] Error 2

yeah it seems these members are now handed over in renamed call timer_setup(). Try to fix these structure members in this way.
There may be more obsoleted stuffs. I don't have the machine ready for now.

Guys, I'm planning to buy used TD-W8980 and also join you in attempt to make this to work. I have few question that can help me start.

  1. What is the best version of OpenWrt to start with?
  2. What is the current repo of an driver. I see at least three repos.

Hopefully we can finally make it work.
Thanks

Well I am using the same router for driver development. Before you start the development on this driver have a look at the other thread about developing it from scratch. It explains why there should be a new driver rather than using the old one.

In case you still want to develop the old driver, then repo provided by @pc2005 works well with 18.06.2 with some debugging options enabled in kernel config. Please look above in the posts and you may find those options. Using latest OpenWrt kernel has some issues because some timer functions have changed.

Edit: This post contains the debugging options needed to be setup with v18.06.2 and then this explains it.

1 Like

I finally managed to read whole thread. But have question regarding patched hostapd. Is it still needed? If so, where I can find source? There seems to be one in vittorio88 repo, but didn't find it in @pc2005 repos.

EDIT: Also another question. In old forum, there is link for lantiq kernel patches https://github.com/paldier/K3C/tree/master/ugw/target/linux/lantiq/patches-3.10. Any chance they're implemented in recent OpenWrt branches?

Yes AFAIK people have suggested that it's needed but only if we implement security with wifi. Tbe wifi comes up just fine withoit it as an open network. I think the hostapd is also included in the driver in the repo by @pc2005 but it's not build-able because of problems with build system. @pc2005 suggested that they can be fixed but he didn't have time to fix them.

I don't think these patches are implemented anymore even if they were in the past but I'm not sure. They relate to v3.10 so most of the stuff may have been obsolete by now.

I personally don't think we can fix this driver, I mean we shouldn't fix it. There are some variables outside of our reach even if we try to fix it. Examples include: based on old kernel, external driver files are required that aren't fixable because no source code is available etc. A rewrite is better than fixing this one and we can actually use some of the code snippets from this driver if required but it will be far better than fixing the old one.

1 Like

I was under impression that driver already supports security and only missing is patched hostapd.

Regarding open source driver, I full agree, but it's very long journey and I would like to have something working as baseline.

Yes I think hostapd here serves the purposes of wpad as it's happening in OpenWrt right now. If we dont include wpad in a build we only get open wifi and there is no security. But as soon as we add wpad we get the security options. So I think security is implemented in wifi driver but is just not available becasue of hostapd.

The current driver is based on old kernel so maybe we can extract some of the driver data that can be helpful in the new driver. For that to happen you need knowledge about how the driver works and I lack that kind of information. If you study the old driver then you can probably have some idea as what is going on there. But again you need compatible driver files to make it work.

1 Like

hostapd is the upstream project, which tends to get split (and only released as such) into two separate components, wpa_supplicant (most of the client/ STA related wireless handling) and hostapd itself (most of the AP side wireless handling). Both components share a considerable amount of code (and are developed as one in a single git repository) and are increasingly intertwined (wpa_supplicant has learned some basic AP operations, partially for WiFi-Direct® - hostapd needs wpa_supplicant assistance for WDS/ 4addr). In OpenWrt, both components are merged into a single package and (multi-call) binary, mostly for space reasons. This means the single wpad binary (or its various variants) does assume both roles as needed.

Technically speaking the kernel doesn't know anything[0, 1] about wireless encryption, that is done in userspace by hostapd (read, wpad). hostapd is the one in charge of the key exchange, of the rekeying, of all the security- and policy decisions. Traditionally hostapd provided multiple APIs to communicate with hardware drivers (hostap was the first one, to communicate with the very first wireless chipsets using the hostap_{cs,pci,…} suite of drivers, madwifi/ atheros and intel were others), before this converged first into the generic wext and nowadays the nl80211 API (this one is the only fully supported one, the only contemporary one with AP support). Kernel- and hostapd upstream have decided that they will not accept new driver specific APIs anymore, everything has to be nl80211 compatible (wext is provided for legacy/ compatibility reasons, hostapd, madwifi/ atheros and intel have been dropped; wired does exist for IEEE802.1x ethernet authentication).

But some vendors do insist on using a custom API between their (proprietary) kernel drivers and hostapd (e.g. RealTek for many of their chipsets, assuming your hunch is correct probably also lantiq). Given that hostapd doesn't accept these and considering that vendors usually don't bother about submitting them anyways, they usually ship an ancient (v0.4.7 in case of RealTek, while v2.9 would be the current version) and heavily patched fork of hostapd. That is not a workable situation for upstream or OpenWrt, as hostapd is a highly security sensitive component (e.g. it had 7 security bugs this year alone - guess how many of those were fixed in those ancient custom vendor forks[2]) and because those different APIs also require a completely different configuration syntax.

--
[0] at least for anything beyond WEP. WEP was historically implemented in the kernel via the wext API - and for compatibility reasons these features remain, but are rarely used directly these days. This procedures was considered as very inflexible and abandoned for anything newer than WEP.
[1] most WLAN cards to have some hardware accelerated cipher support (AES, etc.) in the wireless chipset, these days with 802.11ac and beyond functionality is increasingly offloaded into hardware (both for secrecy reasons (don't giving users or competitors too much insight in the chips inner workings/ abilities) and performance/ power envelope reasons (hardware accelerations and reducing power usage, especially while idle)
[2] if you guessed zero, you would be correct.

3 Likes

Finally managed to get hands on TP-W8980. But makefiles of module seems not to be compatible with Ubuntu 18.04. I'm using openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64 which should be exact version of sdk that official image was built against. The problem it that some directories are not expanded. So in builds dir I have dir with name:

"builds/ugw5.4-vrx288/tools/shared/linux/$(rtlogger_shared_srcdir)"
...

Any advice how to modify makefiles to properly expand dirs? Many thanks in advance.

AFAIK the driver was able to built on Ubuntu 18.04 because I compiled it myself. As far as the modules are concerned, according to @pc2005, they are not able to compile because of some errors (could be the same errors you are facing). Maybe for now just focus on the driver itself and once the driver is stable enough to use then focus on the modules if necessary.

I've selected to only build modules, but autoconf still selects tools, shared tools ... which cause build errors:

Output from make nconfig

make[1]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/kconfig'
Linking ./nconf
gcc ././zconf.tab.o  ./nconf.o  ./nconf.gui.o -lncursesw -ldl -ltinfo -lmenuw -lpanelw -o ./nconf 

make[1]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/kconfig'
./tools/kconfig/nconf ./MTLKConfig
test .config.h -nt .config || rm -f .config.h
autoreconf --install
configure.ac:222: installing './compile'
configure.ac:9: installing './config.guess'
configure.ac:9: installing './config.sub'
configure.ac:216: installing './install-sh'
configure.ac:216: installing './missing'
tools/BCLSockServer/Makefile.am: installing './depcomp'
./support/cfghlpr.sh .config
checking build system type... x86_64-pc-linux-gnu
checking host system type... mips-unknown-linux-gnu
checking for toolchain to use... default
checking for kernel to use... default
checking for kernel compiler prefix to use... default
checking for environment configuration file... ugw5.4-vrx288
checking for rflib... use runtime build
checking for toolchain strip... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-strip
checking for toolchain ranlib... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-ranlib
checking whether to build the wireless driver... yes
checking for supported hardware set... PCIG3 
checking whether to build the MTTools... no
checking whether to build remote logging tools... no
checking whether to build the DUT components... no
checking whether to build helper tools... no
checking for target kernel package... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/linux-4.9.184
checking for target kernel compiler... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mips-linux-strip... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for echo... /bin/echo
checking for mips-linux-gcc... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc accepts -g... yes
checking for /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc option to accept ISO C89... none needed
checking whether /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc... gcc3
checking whether we are using the GNU C++ compiler... yes
checking whether /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-g++ accepts -g... yes
checking dependency style of /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-g++... gcc3
checking for mips-linux-ranlib... /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-ranlib
checking for readlink... yes
checking whether compiler frontend works for C programs... yes
checking whether compiler frontend works for C++ programs... yes
checking whether platform supports built-in atomics... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tools/Makefile
config.status: creating tools/dutserver/Makefile
config.status: creating tools/dutserver/linux/Makefile
config.status: creating tools/shared/Makefile
config.status: creating tools/shared/3rd_party/Makefile
config.status: creating tools/shared/3rd_party/iniparser/Makefile
config.status: creating tools/shared/linux/Makefile
config.status: creating wireless/Makefile
config.status: creating wireless/shared/Makefile
config.status: creating wireless/driver/Makefile
config.status: creating wireless/driver/rflib/Makefile
config.status: creating tools/rtlogger/Makefile
config.status: creating tools/rtlogger/shared/Makefile
config.status: creating tools/rtlogger/logserver/Makefile
config.status: creating tools/rtlogger/logserver/linux/Makefile
config.status: creating tools/rtlogger/logcnv/Makefile
config.status: creating tools/rtlogger/prebuilt/Makefile
config.status: creating tools/mtlkroot/Makefile
config.status: creating tools/mttools/Makefile
config.status: creating tools/mttools/shared/Makefile
config.status: creating tools/mttools/drvhlpr/Makefile
config.status: creating tools/mttools/mtdump/Makefile
config.status: creating tools/mttools/mtlk_cli/Makefile
config.status: creating tools/mttools/mtlk_cli_dbg_srv/Makefile
config.status: creating tools/BCLSockServer/Makefile
config.status: creating config.h
config.status: executing depfiles commands
'builds/ugw5.4-vrx288/.config.h' -> './.config.h'

.config after make nconfig

#
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
# CONFIG_PLATFORM_UGW61_ARX388 is not set
# CONFIG_PLATFORM_UGW61_VRX388 is not set
# CONFIG_PLATFORM_UGW54_ARX388 is not set
# CONFIG_PLATFORM_UGW54_ARX382 is not set
# CONFIG_PLATFORM_UGW54_GRX388 is not set
CONFIG_PLATFORM_UGW54_VRX288=y
# CONFIG_PLATFORM_UGW54_VRX388 is not set
# CONFIG_PLATFORM_DONGLE is not set
# CONFIG_PLATFORM_UGW53_GRX288_NAND is not set
# CONFIG_PLATFORM_UGW53_ARX168 is not set
# CONFIG_PLATFORM_UGW53_ARX388 is not set
# CONFIG_PLATFORM_UGW53_VRX288 is not set
# CONFIG_PLATFORM_UGW52_GRX288_NAND is not set
# CONFIG_PLATFORM_UGW52_ARX300 is not set
# CONFIG_PLATFORM_UGW52_VRX288 is not set
# CONFIG_PLATFORM_UGW52_GW188 is not set
# CONFIG_PLATFORM_UGW52_ARX188 is not set
# CONFIG_PLATFORM_UGW52_GRX168 is not set
# CONFIG_PLATFORM_VB300 is not set
# CONFIG_PLATFORM_LQ_UGW_AR10_WAVE400 is not set
# CONFIG_PLATFORM_GEN35FPGA is not set
# CONFIG_PLATFORM_UGW51_VRX288_NAND is not set
# CONFIG_PLATFORM_UGW51_GRX288_NAND is not set
# CONFIG_PLATFORM_UGW51_VRX288 is not set
# CONFIG_PLATFORM_UGW51_GW188 is not set
# CONFIG_PLATFORM_UGW51_ARX188 is not set
# CONFIG_PLATFORM_UGW51_GRX168 is not set
# CONFIG_PLATFORM_STAR4MB is not set
# CONFIG_PLATFORM_PC_KERN26 is not set
# CONFIG_PLATFORM_AMCC405EX is not set
# CONFIG_PLATFORM_AMCC405_DECA is not set
CONFIG_COMPONENTS=y
CONFIG_LIN_DRV=y
# CONFIG_USE_PREBUILT_RFLIB is not set

#
# HW bus types
#
CONFIG_LINDRV_HW_PCIG3=y
# CONFIG_LINDRV_HW_PCIE is not set
CONFIG_BUS_PCI_PCIE=y
# CONFIG_LINDRV_HW_AHBG35 is not set
# CONFIG_BUS_AHB is not set
# CONFIG_LIN_MTTOOLS is not set
# CONFIG_LIN_RTLOG_COMPONENTS is not set
# CONFIG_LIN_DUT is not set
# CONFIG_LIN_HELPER_TOOLS is not set

#
# Features
#
CONFIG_RF_MANAGEMENT_MTLK=y
# CONFIG_HOSTAP_06 is not set
# CONFIG_FORCE_USE_GENL_DISABLE is not set
# CONFIG_USE_INTERRUPT_POLLING is not set

#
# Debug extentions
#
CONFIG_DEBUG=y
CONFIG_ENABLE_OBJPOOL=y
# CONFIG_ENABLE_NBUF_OBJPOOL is not set
CONFIG_TXMM_HISTORY_LENGTH=3
# CONFIG_IRB_DEBUG is not set
# CONFIG_CPU_STAT is not set
# CONFIG_BENCHMARK_TOOLS is not set
# CONFIG_IRB_BENCHMARKING is not set
# CONFIG_CCR_DEBUG is not set
# CONFIG_FW_WRITE_VALIDATION is not set
# CONFIG_TSF_TIMER_TIMESTAMPS_IN_DEBUG_PRINTOUTS is not set
# CONFIG_PER_PACKET_STATS is not set
CONFIG_STAT_CNTRS_DEBUG=y
CONFIG_NO_FW_RESET_ON_STOP=y
# CONFIG_PCIE_TUNING is not set
CONFIG_RT_LOGGER_FUNCTIONS=y
# CONFIG_RT_LOGGER_INLINES is not set

#
# Log level
#
CONFIG_MAX_DLEVEL=2
# CONFIG_SILENT is not set
CONFIG_USE_GENL_DEF=y
CONFIG_USE_GENL=y
# CONFIG_TSF_TIMER_ACCESS_ENABLED is not set
CONFIG_DEVELOPMENT_PLATFORM=y
CONFIG_ENVIRONMENT_NAME="ugw5.4-vrx288"
CONFIG_HOST_TYPE="mips-linux"

Build error after make:

make[1]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288'
Making install in tools/shared
make[2]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared'
Making install in 3rd_party
make[3]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
Making install in iniparser
make[4]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party/iniparser'
depbase=`echo dictionary.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/support/mtlkfront.sh /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc -DHAVE_CONFIG_H -I. -I../../../../../../tools/shared/3rd_party/iniparser -I../../../..  -DMTLK_SOURCE_VERSION="\"3.4.99.0.0.exported.pre_git_version.REL_3.4.99\"" -DLOG_LOCAL_OID=MTLKFRONT_WILL_FILL_IT -include /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/config.h -include /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/.config.h -I../../../../../../tools/rtlogger/shared -I../../../../../../tools/shared -I../../../../../../tools/shared/linux -I../../../../../../wireless/shared -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include  -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/ -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/netlink/genl/ -Wall -Wno-multichar -fno-strict-aliasing -O2 -fno-common -fno-builtin  -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/ -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/netlink/genl/ -MT dictionary.o -MD -MP -MF $depbase.Tpo -c -o dictionary.o ../../../../../../tools/shared/3rd_party/iniparser/dictionary.c &&\
mv -f $depbase.Tpo $depbase.Po
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/3rd_party/iniparser/dictionary.c
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/config.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/.config.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/mtlkinc.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlk_slid.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party/iniparser/loggroups.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlkbfield.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlk_assert.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/mtlk_osal.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlkerr.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/memtags.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlk_objpool.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/memdefs.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mem_leak.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/osal_osdep_decls.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/mtlkidefs.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/osal_osdep_defs.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/mtlk_osal_dbg.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/utils.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/log_osdep.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/rtlogger/shared/log.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/rtlogger/shared/logdefs.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/linux/mtlkpack.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/rtlogger/shared/formats.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/rtlogger/shared/logmacro_mixins.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/wireless/shared/mtlkstartup.h
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/3rd_party/iniparser/dictionary.h
depbase=`echo iniparser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/support/mtlkfront.sh /media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-*linux-gcc -DHAVE_CONFIG_H -I. -I../../../../../../tools/shared/3rd_party/iniparser -I../../../..  -DMTLK_SOURCE_VERSION="\"3.4.99.0.0.exported.pre_git_version.REL_3.4.99\"" -DLOG_LOCAL_OID=MTLKFRONT_WILL_FILL_IT -include /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/config.h -include /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/.config.h -I../../../../../../tools/rtlogger/shared -I../../../../../../tools/shared -I../../../../../../tools/shared/linux -I../../../../../../wireless/shared -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include  -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/ -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/netlink/genl/ -Wall -Wno-multichar -fno-strict-aliasing -O2 -fno-common -fno-builtin  -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/ -I/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/libnl3/netlink/genl/ -MT iniparser.o -MD -MP -MF $depbase.Tpo -c -o iniparser.o ../../../../../../tools/shared/3rd_party/iniparser/iniparser.c &&\
mv -f $depbase.Tpo $depbase.Po
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/3rd_party/iniparser/iniparser.c
  LP      /media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/tools/shared/3rd_party/iniparser/iniparser.h
rm -f libiniparser.a
ar cru libiniparser.a dictionary.o iniparser.o 
ar: `u' modifier ignored since `D' is the default (see `U')
/media/finch/xenial/home/finch/dev/openwrt/td-w8980/openwrt-sdk-18.06.4-lantiq-xrx200_gcc-7.3.0_musl.Linux-x86_64/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-ranlib libiniparser.a
make[5]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party/iniparser'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Nothing to be done for 'install-data-am'.
make[5]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party/iniparser'
make[4]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party/iniparser'
make[4]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
make[5]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Nothing to be done for 'install-data-am'.
make[5]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
make[4]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
make[3]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/3rd_party'
Making install in linux
make[3]: Entering directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/linux'
Makefile:566: ../../../../../tools/rtlogger/shared/.deps/logmacro_database.Po: No such file or directory
Makefile:567: ../../../../../tools/shared/linux/../.deps/CmdLine.Po: No such file or directory
Makefile:568: ../../../../../tools/shared/linux/../.deps/Debug.Po: No such file or directory
Makefile:569: ../../../../../tools/shared/linux/../.deps/ParamInfo.Po: No such file or directory
Makefile:570: ../../../../../tools/shared/linux/../.deps/argv_parser.Po: No such file or directory
Makefile:571: ../../../../../tools/shared/linux/../.deps/aux_utils.Po: No such file or directory
Makefile:572: ../../../../../tools/shared/linux/../.deps/mtlk_pathutils.Po: No such file or directory
Makefile:573: ../../../../../tools/shared/linux/../.deps/mtlk_socket.Po: No such file or directory
Makefile:574: ../../../../../tools/shared/linux/../.deps/mtlkcontainer.Po: No such file or directory
Makefile:575: ../../../../../tools/shared/.deps/mtlkirbhash.Po: No such file or directory
Makefile:576: ../../../../../tools/mtidl/.deps/mtidl_ini_parser.Po: No such file or directory
make[3]: *** No rule to make target '../../../../../tools/mtidl/.deps/mtidl_ini_parser.Po'.  Stop.
make[3]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared/linux'
Makefile:454: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288/tools/shared'
Makefile:518: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/media/finch/5d966898-c0c1-4483-816f-0ec02c3a2608/backup/finch/dev/wave300/builds/ugw5.4-vrx288'
Makefile:21: recipe for target 'all' failed
make: *** [all] Error 2

EDIT: I've managed to compile module, by editing generated Makefile(s) and removing all refences to shared dirs from SUBDIRS variables.

Sorry for being tiresome, but where did you guys get firmware files? I see discussion in this thread and I tried two different sources. One was from TD-W8980_V1_150514.zip and second one for Archer_VR200_v1_150906.zip, but when I try to insmod I get error about missing cal_wlan1.bin. There is mention of cal_wlan0.bin in @pc2005 README, but file is not present of any of those firmwares.

Fri Nov  1 11:24:56 2019 kern.warn kernel: [173879.127245] [0173586172] mtlk0(mtlk_cdev_init:355): Max nodes set to 1048575
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.363967] [0173597408] mtlk0(__mtlk_print_endianess:4926): The system is Big endian (0xbeadfeed, 0xedfeadbe)
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.373081] [0173597416] mtlk0(mtlk_fast_mem_print_info:114): Using normal memory for hot context
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.381734] PCI: Enabling device 0000:00:0e.0 (0000 -> 0002)
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.388138] [0173597432] mtlk0(_mtlk_df_user_alloc_devname:8350): NDEV Name pattern: wlan%d
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.396452] [0173597440] mtlk0(mtlk_core_pdb_fast_handles_open:42): Open Hot-path parameters
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.405203] [0173597448] mtlk4(_mtlk_mmb_cleanup_reset_mac:3256): FW CPU reset is done
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.466847] mtlk 0000:00:0e.0: Direct firmware load for cal_wlan1.bin failed with error -2
Fri Nov  1 11:25:07 2019 kern.warn kernel: [173890.473871] mtlk 0000:00:0e.0: Falling back to user helper
Fri Nov  1 11:25:08 2019 daemon.err procd: Could not find firmware /lib/firmware/cal_wlan1.bin: No such file or directory
Fri Nov  1 11:25:08 2019 kern.err kernel: [173890.771463] firmware cal_wlan1.bin: firmware_loading_store: map pages failed
Fri Nov  1 11:25:08 2019 kern.warn kernel: [173890.777591] [0173597820] mtlk3(_mtlk_df_fw_request_firmware:63): Firmware (cal_wlan1.bin) is missing
Fri Nov  1 11:25:08 2019 daemon.err procd: failed to write to /sys//devices/pci0000:00/0000:00:0e.0/firmware/cal_wlan1.bin/loading: Out of memory
``

At least I can answer this one. The problem is that host make nconfig is compiled with mix libncurses5-dev and libncurses5w-dev (wide char support). I've managed to change config to use libncurses5w-dev solely and make nconfig is not garbled anymore. But IMO there is no real differrence to menuconfig, so if make menuconfig works for you, use that instead.

Here you can find the files that I used for the firmware. Somewhere above I have indicated how but anyway here it is: https://drive.google.com/open?id=1mBy3LWKBKhuOEdz3FLi_9_owlvXowdVk

1 Like

Thank you. Regarding missing cal_wlan1.bin. I've missed your comment regarding this. But you had exactly same problem and @pc2005 response was it's fine. So I don't worry about it for now.

AFAIK the OpenWrt SDK won't let make any changes to kernel but I think you may get to the point where loading the driver in the router always resulted in a crash (at least for me). The only way to make it work was to enable the Debugging symbols as explained above and for that you'll need to configure the source and checkout the v18.06.4 and flash a firmware built from the custom compiled kernel.

1 Like

Yeah, it just crashed :slight_smile: or rather :(. Going to compile kernel now.