Sources for Lantiq WAVE300 wi-fi driver used in many embedded devices.
In this document are instructions in order to setup and run the Lantiq Wave 300 development kit that includes drivers and misc tools.
The aim of this project is to upbring the sources to newer Linux kernels
as original sources available seem to be compatible only with older kernels.
The original sources for this git (wave300-3.2.1.1.48.tar.gz), upon which
all changes are made, came with no license file. In the code, however
the MODULE_LICENSE is clearly defined as "proprietary".
In previous releases of the drivers like 3.01.0, there's a GPL
LICENSE (txt) file where dual BSD/GPL is granted.
Being the sources of this git an evolution of the old ones,
the GPL LICENSE (txt) file and its content must be kept.
Nonetheless, being myself an absolute newcomer into the world of
open-source and licensing, I beg the original authors & owners of this
code Infineon/Lantiq/Intel to correct me if I'm wrong and I will
immediatly turn down this git.
- The code has been up-ported up to OpenWRT 18.06.5 using kernel 4.9 or later
- Compilation failed for me on OpenWRT 19.07.0.
- The code has been successfully compiled using Ubuntu 16.04 and Ubuntu 18.04.03.
- The compiled kernel module is successfully loaded, and network device initiated.
- The driver communicates with a custom hostapd that contains mtlk primitives.
- There is no IP communication, this is likely related to "SOURCE of RX packet not found!" issue.
- Diagnose "SOURCE of RX packet not found!" issue which is likely why there is no IP connectivity.
- Build using OpenWRT 18.06.5 Ubuntu 18.04.
- I strongly recommend completely deleting any old OpenWRT or WAVE300 sources you may, have and start fresh.
The following is necessary to build driver and OpenWRT.
sudo apt install git build-essential libncurses5-dev gawk vim python2.7
mkdir ~/src
cd ~/src
git clone https://github.com/openwrt/openwrt.git
It is better to switch to current stable release.
cd openwrt
git checkout -f v18.06.5
make menuconfig
For Target System chose: Lantiq For Subtarget chose: XRX200 For Target Profile chose: TP-Link Archer VR200 v1 ( or your own model )
You may add them using make menuconfig or by manually editing .config
I added the following options to my .config.
For lspci:
echo "CONFIG_PACKAGE_pciutils=y" >> .config
I like vim:
echo "CONFIG_PACKAGE_vim-full=y" >> .config
For iwconfig:
echo "CONFIG_PACKAGE_wireless-tools=y" >> .config
For hostapd:
echo "CONFIG_PACKAGE_libopenssl=y" >> .config
make oldconfig
Press enter alot to accept default options
This step is necessary to populate toolchain and kernel directories
make
./scripts/feeds update -a
./scripts/feeds install libnl
make package/libnl/{clean,compile} V=99
Note: libnl-tiny does not work by default
We are now ready to build the driver.
cd ~/src
git clone https://github.com/vittorio88/WAVE300.git
cd WAVE300/driver
export BSP_BUILD_ROOT=~/src/openwrt
make menuconfig
You should see the classical blue screen menu.
Choose your target platform
ugw5.1-vrx288 has been more thoroughly tested and will be used as example for the rest of the document.
Upon exiting make menuconfig, ./configure will be run automatically. Do not run it on your own.
Note: If this step fails, then maybe you have multiple toolchains in openwrt/staging_dir. Remove all but the latest.
make
Drivers will be available at:
./builds/ugw5.1-vrx288/binaries/wls/driver/mtlk.ko
./builds/ugw5.1-vrx288/binaries/wls/driver/mtlkroot.ko
In order to run the wifi driver in your target machine
you need to have the following firmware files:
/lib/firmware/sta_upper.bin
/lib/firmware/ap_upper.bin
/lib/firmware/contr_lm.bin
/lib/firmware/Progmodel_*.bin
You can retrieve these from:
- your running stock firmare
- using fmk (firmware-mod-kit) to extract them from a stock firmware image
- Retrieving them from a GPL dump of your image
Check README_FW in /lantiq_fw for help. They may need to be renamed, you will see in kernel log if it doesn't find an adequate firmware image.
Bring those files to your platform (router, embedded system, etc) and
insert the modules (insmod) in the following order:
insmod mtlkroot.ko
insmod mtlk.ko ap=1
A new wifi interface should be visible with iwconfig, usually named wlan0.
iwconfig
Below lines are an example if your radio is 2.4GHz:
iwpriv wlan0 sCountry IT
iwconfig wlan0 essid test-24ghz
iwconfig wlan0 channel 1
Below lines are an example if your radio is 5GHz:
iwpriv wlan0 sCountry GB
iwconfig wlan0 essid test-5ghz
iwconfig wlan0 channel 52
Finally bring up the interface:
ifconfig wlan0 up
Here is it possible to see the wireless network and connect, yet
there is no IP connectivity.
It is also possible to use hostapd if patched with mtlk primitives.
The generated modules accept some parameters, most of them are unexplored.
At menuconfig level, set debug level, 9 being the highest.
Beware, because the size of the drivers will grow.
insmod mtlkroot.ko cdebug=3