OpenWrt Forum Archive

Topic: Lantiq XWAY WAVE300

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

I don't understand. Is WAVE300 supported on LEDE or OpenWRT meanwhile? I have a TP W8980 router.

DocMAX wrote:

I don't understand. Is WAVE300 supported on LEDE or OpenWRT meanwhile? I have a TP W8980 router.

Currently no. The good news is that this "no" may be a "not yet" - Seems that there is enough knowledge and/or source code to eventually support it, however it is still very far away from actually being mainline. Devs are close to a PoC (i.e. working with a really old OpenWRT release and with a custom-patched hostapd) but even when they get there there's a long way from PoC to production.
Do remember that these are just volunteers. Working in RnD myself, I can tell you that after 5 days of this I usually can't bring myself to looking at source code on weekends as well, no matter how interesting it is. If you were to pay them their monthly salaries and have them do nothing but this for a while it could probably be done within a few weeks or so but I doubt that you're willing to pay thousands of $$$$ just to have 5GHz on your LEDE router. Just let them take their time and see how this unrolls.

With that being said - Mandrake, lpm11, blackladder1000 - I can't seem to understand which kernel version you're currently working on. Could you please summarize so I can also take a look?

Hello NiQ,

You have perfectly summarized my feelings with this porting.

My LEDE is 4.4.38 (info that is in my signature).

In my platform, the chipset is using PCIe and the IRQ's in the form of MSI are not properly assigned.

Nothing to do with the WAVE300 driver itself but a truly roadblock.

I believe the info from the rest of the team will be more useful.

Regards

I can add that this driver will never be integrated into official LEDE/OpenWRT - because source license does not allow to do it. I doubt if anyone agrees to port such old driver for these small numbers of devices.

@NiQ
I'm running OpenWRT with kernel version 4.4.14.
It's Designated Driver 50108 which relates to git-17.227.62661-3d338ee
When I built my build environment I pulled the latest git for OpenWRT

As detailed throughout this thread, I can get WAVE300 sources to compile and instatiate successfully.
lpm11 helpfully provided a script to port /etc/config/wireless settings to the WAVE300 hardware.
As a result, I can successfully bring an access point up and can connect to it from another device (my phone - with a static IP).

However, the final part that I haven't solved is passing traffic through the interface.

lmp11's script calls mtlk-ap, which is a modified version of hostapd. In a previous post I modified a current version of hostapd to support mtlk hardware. Alternatively, the WAVE300 sources include hostapd 0.8 with the neccessary modifications. Unfortunately, at present, neither my version nor the driver version allow me to pass traffic.

Most recently, lpm11 and Mandrake helpfully suggested hostapd/mtlk-ap settings. Unfortunately I still haven't managed to get traffic to pass - even with their recommendations. I've also recently started a new job so have had little time to continue debugging. I will return to it.

Hello you guys,

I think you are doing a great job and it is very much appreciated.
@Ipm11
Au contraire
There are literally bootloads of these devices out there, because they are cheap and perform well.
There are hundreds on ebay of the TP-Link 8980 alone and there are 3 other variations of this model all with the wave300 chipset.
These things work so well even without the additional 5GHz band that I got another 2 of them for about 20€ each to expand my wifi coverage on my property.
I mean it is just Wi-Fi N, but 300Mbps on a mobile device?
Certainly can't complain about that for 20/30 bucks.
Also these devices are only sold with aDSL vDSL modems @50Mbps max, but with another vDSL firmware I got mine to support vectoring  at 150Mbps.
These are such a great deal.

Hello all,

I have been unable to follow up with this issue too much, but I have been reflecting on it.
I found 2 bugs within the up-porting of nlmsgs.c which led to certain cases of the netlink layer not being properly initialized, hence the panic I've been getting on mtlk_nl_send_brd_msg() possibly because nl_sock was undefined.

This also explains why it worked for blackadder1000 on kernel 4.4 ( the ifdef passed for kernel under 4.5). I switched it for greater than kernel 3.2, so I believe it should work for kernels greater than 4.5 as well now. I am using the latest lede-trunk.

I have pushed this modification to my repo https://github.com/vittorio88/WAVE300/t … e-BSD_GPL. I am now up to the point where blackadder1000 was a while back where the wifi will connect, but there is no IP connectivity. Above all, the router doesn't crash!

I hope this can help bring us all to the same page.

These are the commands I am using to set up the connection:

insmod mtlkroot.ko cdebug=2
insmod mtlk.ko ap=1 debug=2

iwpriv wlan0 sCountry IT
iwconfig wlan0 essid test-vitto
iwconfig wlan0 channel 1
ifconfig wlan0 up

I am now getting this log periodically while connected:

mtlk2(handle_rx_ind:7214): SOURCE of RX packet not found!

I guess it's time to for me to checkout the progress on hostapd.

Hello again,

I compiled hostapd as per lpm11's instruction, however upon running it with mtlk.ko and mtlkroot.ko inserted, I got the following kernel panic.

[ 9147.107675] [0008847016] mtlk1(mtlk_core_set_net_state:681): Going from NET_STATE_IDLE to NET_STATE_READY

root@vitto-rtr1:~/benjamin# ls
hostapd      hostapd_cli
root@vitto-rtr1:~/benjamin# ./hostapd /etc/hostapd/hostapd.conf
Configuration fil[ 9161.264082] [0008861172] mtlk2(_mtlk_df_ui_execute_cfg_handler:6301): IWPRIV #0x0022 being processed
[ 9161.272837] Assertion failed [SLID:0:34:1:2196]
[ 9161.277364] Kernel bug detected[#1]:
[ 9161.280846] CPU: 0 PID: 3176 Comm: hostapd Tainted: P                4.9.51 #0
[ 9161.288060] task: 8723e1c0 task.stack: 864c8000
[ 9161.292577] $ 0   : 00000000 00000001 00000023 00000000
[ 9161.297796] $ 4   : 8110c2dc 8110c2dc 8110ef00 80550000
[ 9161.303021] $ 8   : 80550000 00010000 33343a31 3a323139
[ 9161.308241] $12   : 205b534c 0000002b 00000000 49443a30
[ 9161.313464] $16   : 86ed7ca0 864c9e30 00000000 00000022
[ 9161.318688] $20   : 80550000 864c9e30 ffffffe7 864c9ddc
[ 9161.323908] $24   : 00000002 7779e4f8
[ 9161.329131] $28   : 864c8000 864c9c98 86547c84 86ee7854
[ 9161.334359] Hi    : 00000000
[ 9161.337224] Lo    : 00000000
[ 9161.340141] epc   : 86ee7854 __mtlk_assert+0x34/0x14c [mtlkroot]
[ 9161.346131] ra    : 86ee7854 __mtlk_assert+0x34/0x14c [mtlkroot]
[ 9161.352113] Status: 1100ff03 KERNEL EXL IE
[ 9161.356292] Cause : 10800024 (ExcCode 09)
[ 9161.360298] PrId  : 00019556 (MIPS 34Kc)
[ 9161.364208] Modules linked in: mtlk(P) mtlkroot(P) pppoe nf_conntrack_ipv6 iptable_nat ipt_REJECT ipt_MASQUERADE xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG pppox ppp_async nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack ltq_deu_vr9 lib80211_crypt_wep lib80211_crypt_tkip lib80211_crypt_ccmp lib80211 iptable_mangle iptable_filter ip_tables crc_ccitt compat drv_dsl_cpe_api ledtrig_usbport drv_mei_cpe ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables pppoatm ppp_generic slhc br2684 atm drv_ifxos dwc2 gpio_button_hotplug
[ 9161.432199] Process hostapd (pid: 3176, threadinfo=864c8000, task=8723e1c0, tls=777ffd48)
[ 9161.440369] Stack : 00000000 00000000 00000022 00000001 00000894 865a9218 0000189d 8653839c
[ 9161.448722]         00000002 864c9cf8 ffffffe7 00000022 00000001 0000189d 86ed7ca0 865a9218
[ 9161.457078]         00000001 864c9ddc 86547c84 86582844 81082560 00000000 8054d0a0 00010000
[ 9161.465434]         00000022 00040933 00000001 ffffffe7 865c0a60 865b0000 00000022 86ed7ca0
[ 9161.473790]         864c9e30 ffffffe7 864c9ddc 86533a98 874625f0 800ae458 864ce480 801b1ae0
[ 9161.482145]         ...
[ 9161.484586] Call Trace:
[ 9161.487050] [<86ee7854>] __mtlk_assert+0x34/0x14c [mtlkroot]
[ 9161.492933] [<8653839c>] _mtlk_df_ui_reset_stats_proc+0x4194/0xea60 [mtlk]
[ 9161.499760] Code: afbf001c  0c02b48f  2484deb8 <000c000d> 00000000  00000000  27bdffe8  afb00010  afbf0014
[ 9161.509303]
[ 9161.510934] ---[ end trace 36ecc0b034118365 ]---
e: /etc/hostapd/h[ 9161.522125] Kernel panic - not syncing: Fatal exception
[ 9161.532238] Rebooting in 3 seconds..

Any ideas on what to try next?

@vittorio88 Congratulations on your progress! Some serious debugging work you put in there.

I was looking at your error "IWPRIV #0x0022 being processed". Are you using lpm11's script for patching between /etc/config/wireless and the driver? I wonder if there are some commands in that script which need running before hostapd will work correctly.
e.g. are you running "iwpriv wlan0 sCountry IT" before you run hosapd? It sounds like you are but thought it was worth checking.

lpm11's script also runs "iwpriv wlan0 sMAC $macaddr" - are you running something like this?

Also, what does your hostapd.conf look like?

blackadder1000 wrote:

@vittorio88 Congratulations on your progress! Some serious debugging work you put in there.

Thanks!



blackadder1000 wrote:

I was looking at your error "IWPRIV #0x0022 being processed".

I got past this error somehow...



blackadder1000 wrote:

Are you using lpm11's script for patching between /etc/config/wireless and the driver? I wonder if there are some commands in that script which need running before hostapd will work correctly.

I downloaded mtlk.sh, however it hangs on the first step.

root@vitto-rtr2:/# /lib/wifi/mtlk.sh
/lib/wifi/mtlk.sh: line 1: append: not found

Who is supposed to call /lib/wifi/mtlk.sh???



blackadder1000 wrote:

e.g. are you running "iwpriv wlan0 sCountry IT" before you run hosapd? It sounds like you are but thought it was worth checking.

Yes. I was setting the country, if I don't hostapd refuses to go forward.



blackadder1000 wrote:

lpm11's script also runs "iwpriv wlan0 sMAC $macaddr" - are you running something like this?

I tried, no difference. It seems to set a MAC automatically upon insmod mtlk ap=1.

mtlk1(mtlk_pdb_set_mac:401): << set MAC param: id(2) MAC(00:09:86:00:00:00)
mtlk1(_mtlk_core_set_mac_addr:3557): CID-0000: New MAC: 00:09:86:00:00:00



blackadder1000 wrote:

Also, what does your hostapd.conf look like?


root@vitto-rtr2:~# cat /etc/hostapd/hostapd.conf
driver=mtlk
interface=wlan0
channel=11
bridge=br-lan
ssid=testing2g
hw_mode=g

I am now able to run hostapd without crashing. It creates an SSID according to the settings in hostapd.conf. I can connect, and I still get the "SOURCE of RX packet not found!" error. Network traffic doesn't pass through to bridge. rmmod mtlk causes kernel panic.


Also getting following failures:

mtlk2(access_mib_value:192): UM_MAN_SET_MIB_REQ failed, u16ObjectID = 0x0081, status = 0x0010

and

mtlk2(complete_or_continue:451): Scan completed
mtlk2(aocs_select_sm_randomly:1877): Cannot select randomly SM channel
mtlk2(aocs_select_non_sm_best:1905): Selected best non-SM channel 5


Thanks for the help, and Happy New Years to everybody reading!

Hello,

I have an VR200v with USBTTY attached and would like to get the WIFI working...
lspci -vv here

If you have something to test, I will do it...

Aeronaut84 wrote:

Hello,

I have an VR200v with USBTTY attached and would like to get the WIFI working...
lspci -vv here

If you have something to test, I will do it...

1st step is compiling the kernel module. I recommend you work of my Git repo, because Mandrake's does not yet include the fix for kernels greater than 4.5, such as that present in LEDE trunk.

2nd step is compiling hostapd from blackadder1000's git.

3rd step is using the mtlk.sh script provided by lpm11 for initializing hostapd and creating the network bridge using OpenWRT config files. -> I am blocked here.

Amongst the first commands in mtlk.sh is append(). I do not know where I am supposed to get the append command, or with what command interpreter I am supposed to call /lib/wifi/mtlk.sh, so that the append command is understood. I simply get append: command not found, upon executing this script.

I believe we are very close to getting working wifi...

P.S. Since you have a VR200/VR200v, you need to manually compile lede trunk in order to see the WAVE300 chip with lspci because the latest official release 17.01.4 does not yet include the patch I submitted to enable the WAVE300 chip.

@vittorio88

The settings in /etc/config/wireless are applied to the WAVE300 hardware through the mtlk.sh script. I just have to define the driver in /etc/config/wireless as "mtlk" and OpenWRT magically takes care of the rest. I don't know enough about OpenWRT to work out what actually does that. (see below)

Sounds like you're up to a similar point to myself. You can connect to the SSID but with no traffic. I'm guessing even DHCP doesn't work for you.

As well as hostapd have you set up an ethernet bridge?
e.g. brctl addif br-lan wlan0
I'm not sure if the line "bridge=br-lan" in hostapd does this for you.

(here)
There should be /lib/functions.sh which reads the /etc/network config files and includes the definition of append:

https://dev.openwrt.org/browser/trunk/p … nctions.sh
https://github.com/lede-project/source/ … nctions.sh

This old documentation helped:
http://archive.openwrt.org/kamikaze/8.0 … enwrt.html

But what calls function.sh ...

(Last edited by blackadder1000 on 9 Jan 2018, 18:42)

Hello,

Sorry blackadder1000, but I have been busy, and had a few gaps in my knowledge with regards on how to proceed.
Your information was very helpful.

I am not too sure, but I believe that using hostapd, wpa_supplicant, /lib/functions.sh, /etc/network/config may be jumping the gun a little bit. I think that until we can ping through wireless connection without those utilities, we should focus on possible driver issues.

I would be grateful if anybody could correct me, but I believe that the minimum required to ping through a wireless link on linux are:

iwpriv wlan0 sCountry IT
iwconfig wlan0 essid test-24ghz
iwconfig wlan0 channel 1
ifconfig wlan0 up
ifconfig wlan0 192.168.80.1

# connect from remote computer
# set static ip 192.168.80.2 on remote computer
ping 192.168.80.1

With this configuration, ping should be possible without hostapd on an open network to the best of my knowledge.

This brings me back to the driver. I have worked on it to render it more easy to build. The latest version is available at:
https://github.com/vittorio88/WAVE300 with step-by-step build instructions starting from scratch.

From the output of ifconfig, it seems no packets are getting to the linux IP stack, they get dropped on TX and nothing comes on RX:

root@OpenWrt:~# ifconfig
wlan0     Link encap:Ethernet  HWaddr 00:09:86:00:00:00
          inet addr:192.168.80.1  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::209:86ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:965 overruns:0 carrier:0
          collisions:172 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:~# iwconfig
wlan0     802.11bgn  ESSID:"test-24ghz"
          Mode:Master  Frequency=2.412 GHz  Access Point: 00:09:86:00:00:00
          Tx-Power=20 dBm
          RTS thr=1600 B
          Encryption key:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:9452  Invalid misc:4366   Missed beacon:0

To me this means that something between the driver and the IP packet stack of linux is broken. The channel for configuration, however does work adequately, as iwconfig works perfectly. To communicate between iwconfig and the MTLK driver, it seems that IOCTLs are used for pretty much everything for configuration of the HW.

A lot of the work in making the driver run on newer kernels had to do with up-porting netlink and procfs, so I wouldn't be surprised if the problem was there.

It is probably not a procfs issue because the procfs files /proc/net/wireless and /proc/net/dev seem to be fine.
(There are issues deinitializing the procfs which lead to backtrace upon on rmmod of mtlk.ko), but it seems to cause no harm.

This leads me to think the netlink porting is the culprit of the non-functioning driver.
Reading the code, I find the following snippet:

int mtlk_nl_init(void)
{
  /* netlink groups that are expected:
   * 1 - is joined by hostapd, wpa_supplicant and drvhlpr
   * 2 - is joined by wsccmd (Simple Config)
   * 3 - is joined by IRB media
   * so, total number of 3 groups must be told to kernel
   * when creating socket
   */

So from what I understand, in addition to using iwconfig and IOCTLs;  hostapd, wpa_supplicant and drvhlpr also can configure the MTLK driver through netlink groups.
Unfortunately I do not know what groups 2 and 3 are (wsccmd and IRB media). If anybody knows the answer there I would be very grateful!
If those netlink groups (2 and 3) could be the ones used to send packets through the kernel from driver to IP stack, then it is very likely that this is where the driver is broken.

Netlink being broken would also explain hostapd not working.

Anyway, I hope someone here knows the answer, because I would very much like to get this WiFi working before the whole router is completely obsolete big_smile

- Vittorio

The discussion might have continued from here.