Support for WAVE 300 Wi-Fi chip

Hello everybody,

Some of you may know me from the previous OpenWRT forum before it was frozen in carbonite. I was trying to get the WAVE 300 Wi-Fi chip working.

With the old forum going down, it seems development froze on this issue. I also took a break, because working on this chip has been WAAAYYYYY too time consuming. Recently I have gotten to working on it again.

This practice in self-castigation was documented in this old forum thread. Please read it if you are interested in helping to support the WAVE300 chip, preferably before posting here, so as to avoid adding noise to the discussion.

To those who are unfamiliar with what I am talking and or do not want to read 5 years of posts here is a TL;DR:

  1. WAVE 300 is a wifi chip made by Lantiq which has been purchased by Intel
  2. The source code for v3.2 of the driver was found in a GPL dump, however it was labeled as proprietary.
  3. The name of the driver is mtlk.
  4. The 3.1 driver was licensed as GPL, and many files are the same in 3.2, so it seems to me that the 3.2 version should also be subject to GPL. Do not quote me on this, I am not a lawyer, this is not legal advice, I know nothing!
  5. This driver is ancient. Trying to get this driver working has ruined :unamused: the lives of several OpenWRT developers while up-porting netlink, generic netlink, procfs, compiler errors, and many other countless issues.
  6. So far the driver works, and many parts of it work, yet there is no IP connectivity once connected.
  7. I have placed the code, instructions, all my modifications, and all known issues in this Github repository.
  8. Using the driver needs a custom version of hostapd, available here with instructions here.

Where to now?

  1. Find the cause of the printed message, "SOURCE of RX packet not found!" which is likely why there is no IP connectivity." Check out this issue.
  2. Check out the Github issues as fixing them may help with driver development and may get it working. Even repro testing is helpful, so as to verify the issues existing.
  3. Once the driver is working (possibly even before if someone is good at it and willing), it would be very nice to package it as a feed, so as to make it easy for others to install and test.

Thanks to all the people in the old OpenWRT forum upon which this was all built! :beers:

Please let me know if you need help with any part of the development process.

5 Likes

I am getting this when I execute make command in openwrt repository. Do I need additional packages?

ahmar@ubuntu:~/src/openwrt$ make
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/network/utils/nftables/Makefile' has a dependency on 'jansson', which does not exist

But the command is running anyway.

Those can be safely ignored because they are warnings, and those packages will build anyway without those dependencies.

Hello @ahmar16,

It seems you are having trouble compiling OpenWRT itself. This is unrelated to the WAVE 300 driver, so I ask you to ask for help elsewhere because it adds noise to this discussion. Feel free to mention me using @vittorio88 to "call me" to that thread.

That said, here are some generic tips that may help you.

  1. Make sure you have sufficient disk space and memory ( use df -h and free -h to check before and during build)
  2. Checkout a stable tag, do not work off of trunk
    git checkout -f v18.06.1
  3. Wipe all files that aren't part of the original repository BE CAREFUL with this command!
    git clean -dfx

If you still get the same error, search the forum for someone with a similar error and ask there, or start a new thread.

Good luck,
Vittorio

1 Like

I loaded the firmware using README file on git. Well I could not find the file named sta_upper.bin in the stock firmware although I did find ap_upper_wave300.bin(renamed this one), ProgModel_*.bin (5 files to be exact) and contr_lm.bin. After putting all the above files in /lib/firmware I could not initiate the device. The log shows the following:

Sat Nov 10 22:27:37 2018 kern.warn kernel: [  476.272432] mtlkroot: module license 'Proprietary' taints kernel.
Sat Nov 10 22:27:37 2018 kern.warn kernel: [  476.277150] Disabling lock debugging due to kernel taint
Sat Nov 10 22:27:37 2018 kern.warn kernel: [  476.286813] [0000176176] mtlk0(mtlk_cdev_init:316): Max nodex set to 1048575
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.876084] [0000187768] mtlk0(__mtlk_print_endianess:3867): The system is Big endian (0xbeadfeed, 0xedfeadbe)
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.884773] [0000187776] mtlk1(mtlk_df_proc_node_create:125): Proc node root/ created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.892598] [0000187784] mtlk1(mtlk_df_proc_node_create:127): Proc node root/mtlk created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.900729] [0000187792] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry mtlk/version created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.909861] [0000187800] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry mtlk/topology created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.919182] [0000187808] mtlk0(mtlk_fast_mem_print_info:105): Using normal memory for hot context
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.927982] PCI: Enabling device 0000:00:0e.0 (0000 -> 0002)
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.933725] [0000187824] mtlk0(_mtlk_df_user_alloc_devname:6511): NDEV Name pattern: wlan%d
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.942052] [0000187832] mtlk1(mtlk_df_proc_node_create:127): Proc node mtlk/wlan1 created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.950257] [0000187840] mtlk1(mtlk_df_proc_node_create:127): Proc node wlan1/Debug created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.958613] [0000187848] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/hw_limits created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.968010] [0000187860] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/reg_limits created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.977497] [0000187868] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/antenna_gain created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.987156] [0000187876] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/do_debug_assert created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  487.996814] [0000187888] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/lm created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.005350] [0000187896] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/um created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.013876] [0000187904] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/shram created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.022670] [0000187912] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/General created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.031896] [0000187924] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/MACStats created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.041205] [0000187932] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/igmp created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.050174] [0000187940] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry Debug/ResetStats created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.059403] [0000187948] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_history created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.069060] [0000187960] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_table created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.078546] [0000187968] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_channels created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.088300] [0000187980] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_penalties created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.098130] [0000187988] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/L2NAT created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.107193] [0000187996] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry Debug/L2NAT_ClearTable created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.116937] [0000188008] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/ReorderingStats created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.126854] [0000188016] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/EECaps created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.135991] [0000188028] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/SendQueue created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.145393] [0000188036] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/serializer_dump created
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.155314] [0000188044] mtlk1(mtlk_print_drv_info:8042): *********************************************************
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.165746] [0000188056] mtlk1(mtlk_print_drv_info:8043): * Driver Compilation Details:
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.173747] [0000188064] mtlk1(mtlk_print_drv_info:8044): *********************************************************
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.184210] [0000188076] mtlk1(mtlk_print_drv_info:8046): * CONFIG=PLATFORM_UGW51_VRX288 COMPONENTS     LIN_DRV LIN_RTLOG_COMPONENTS BUS_PCI_PCIE LINDRV_HW LINDRV_HW_PCIE LINDRV_HW_PCIG3 RF_MANAGEMENT_MTLK TXMM_HISTORY_LENGTH=0 RT_LOGGER_FUNCTIONS MAX_DLEVEL=1 USE_GENL_DEF USE_GENL ENVIRONMENT_NAME="ugw5.1-vrx288" HOST_TYPE="mips-linux" 
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.213783] [0000188104] mtlk1(mtlk_print_drv_info:8046): * CFLAGS=
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.220051] [0000188112] mtlk1(mtlk_print_drv_info:8046): * MTLK_KERNEL_CFLAGS=-mlong-calls
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.228413] [0000188120] mtlk1(mtlk_print_drv_info:8046): * KERNELDIR=/home/ahmar/src/openwrt/build_dir/target-mips_24kc_musl-1.1.16/linux-lantiq_xrx200/linux-4.4.153
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.243303] [0000188132] mtlk1(mtlk_print_drv_info:8046): * CROSS_COMPILE=/home/ahmar/src/WAVE300/driver/builds/ugw5.1-vrx288/../../support/mtlkfront.sh /home/ahmar/src/openwrt/staging_dir/toolchain-mips_24kc_gcc-5.4.0_musl-1.1.16/bin/mips-openwrt-linux-
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.265834] [0000188156] mtlk1(mtlk_print_drv_info:8046): * HOSTNAME=
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.272276] [0000188164] mtlk1(mtlk_print_drv_info:8049): *********************************************************
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.282734] [0000188172] mtlk0(mtlk_core_pdb_fast_handles_open:33): Open Hot-path parameters
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.291230] [0000188180] mtlk1(mtlk_qos_set_map:152): Set 802.11 TID-to-AC mapping
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.298774] [0000188188] mtlk4(_mtlk_core_get_max_stas_supported_by_fw:3227): Cannot get MAX STAs supported by FW. Forcing default
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.310582] [0000188200] mtlk1(_mtlk_core_get_max_stas_supported_by_fw:3231): MAX STAs supported by FW: 32
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.451612] [0000188344] mtlk3(_mtlk_mmb_wait_chi_magic:2099): Wait for CHI Magic failed (wait_res=0 value=0x23502350)
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.461059] [0000188352] mtlk3(MTLK_STEPS_ERROR_SD:54): STARTCTRL: hw_mmb_card:HW_WAIT_CHI_MAGIC_START FAILED! step (151)
Sat Nov 10 22:27:49 2018 kern.warn kernel: [  488.472109] [0000188364] mtlk3(MTLK_STEPS_ERROR_S:48): STARTCTRL: hw_mmb_card START FAILED! Initiating rollback...
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.503601] [0000188396] mtlk3(MTLK_STEPS_ERROR_SD:54): STARTCTRL: bus_drv:BUS_MMB_START_CARD_INIT FAILED! step (151)
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.513006] [0000188404] mtlk3(MTLK_STEPS_ERROR_S:48): STARTCTRL: bus_drv INIT FAILED! Initiating rollback...
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.522993] [0000188412] mtlk0(mtlk_txmm_cleanup:917): Usage Peak=0 (Total=2)
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.530093] [0000188420] mtlk0(mtlk_txmm_cleanup:917): Usage Peak=0 (Total=32)
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.537436] [0000188428] mtlk0(mtlk_core_pdb_fast_handles_close:49): Close Hot-path parameters
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.545976] [0000188436] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/hw_limits deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.555227] [0000188444] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/reg_limits deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.564645] [0000188456] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/antenna_gain deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.574222] [0000188464] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/do_debug_assert deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.584066] [0000188476] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/lm deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.592744] [0000188484] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/um deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.601464] [0000188492] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/shram deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.610430] [0000188500] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/General deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.619590] [0000188512] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/MACStats deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.628770] [0000188520] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/igmp deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.637678] [0000188528] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/ResetStats deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.647076] [0000188536] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/aocs_history deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.656625] [0000188548] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/aocs_table deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.666052] [0000188556] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/aocs_channels deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.675687] [0000188568] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/aocs_penalties deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.685431] [0000188576] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/L2NAT deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.694396] [0000188584] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/L2NAT_ClearTable deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.704317] [0000188596] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/ReorderingStats deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.714154] [0000188604] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry wlan1/EECaps deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.723205] [0000188612] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/SendQueue deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.732523] [0000188624] mtlk1(mtlk_df_proc_node_remove_entry:462): Proc entry Debug/serializer_dump deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.742358] [0000188632] mtlk1(mtlk_df_proc_node_delete:161): Proc node wlan1/Debug deleted
Sat Nov 10 22:27:50 2018 kern.warn kernel: [  488.750713] [0000188640] mtlk1(mtlk_df_proc_node_delete:161): Proc node mtlk/wlan1 deleted

I am running LEDE 17.01.6 on my Tp-Link TD-W8980 V1. Now what else do I need?

Hey, good job! You made some great progress!

This is your problem now, I believe the driver is looking for a different firmware version rather than what you have given it.

mtlk3(_mtlk_mmb_wait_chi_magic:2099): Wait for CHI Magic failed (wait_res=0 value=0x23502350)
mtlk3(MTLK_STEPS_ERROR_SD:54): STARTCTRL: hw_mmb_card:HW_WAIT_CHI_MAGIC_START FAILED! step (151)
mtlk3(MTLK_STEPS_ERROR_S:48): STARTCTRL: hw_mmb_card START FAILED! Initiating rollback...
mtlk3(MTLK_STEPS_ERROR_SD:54): STARTCTRL: bus_drv:BUS_MMB_START_CARD_INIT FAILED! step (151)
mtlk3(MTLK_STEPS_ERROR_S:48): STARTCTRL: bus_drv INIT FAILED! Initiating rollback...

If it may help, I have added the following files in my /lib/firmware directory ( notice the version 38, you may need this specific version.

ProgModel_BG_CB.bin
ProgModel_BG_CB_38_RevB.bin
ProgModel_BG_nCB.bin
ProgModel_BG_nCB_38_RevB.bin
ap_upper.bin
contr_lm.bin
sta_upper.bin

Note that ProgModel_BG* is 2.4Ghz specific, so they may be different if you have a WAVE 300 on 5GHz.

Where did you get those files? I got them from stock TpLink firmware for my router. But I still cant find the sta_upper.bin in there. I also tried the GPL code but it needs to be built before I can get files from it which I tried but it fails every time because of some errors.

Update: I have stumbled upon GPL code from Netgear and it is being distributed under GPU license as far as I know. But other than that Netgear D6100 has WAVE300 wifi chipset used as 5GHz wifi and the GPL code v1.0.0.46 incudes driver with version 3.4 and I think we have been using the driver with v3.2. But again this version is being worked with Kernel v2.6 so maybe we still need to figure out how to up-port it. Also there is a GPL archive for the same router with v1.0.0.50 which I haven't explored yet. Here: Netgear GPL Downloads.
Also I have included the correct files as you said above, they include 38 in them. But still I am not able to make it work. Still getting the same error.

Update 2: I also tried to use files from Netgear's GPL code but it seems that mtlk and mtlkroot cant be inserted directly. They probably need some patching but using the /lib/firmware files from Netgear produces a little different output (maybe because it is not being considered as proprietary) but it still doesnt make wifi work. Same error appears. Also Netgear has the files for both 2.4 and 5 GHz wifi.

A little update on this matter:

I think I have gotten the correct firmware files from an old firmware for my device. I found it from the readme file in the repo. Well now the log says there is a bug and my device restarts every time I insert the module with insmod mtlk.ko ap=1.

The log that I captured is:

Tue Nov 13 21:48:20 2018 kern.warn kernel: [  405.927642] mtlkroot: module license 'Proprietary' taints kernel.
Tue Nov 13 21:48:20 2018 kern.warn kernel: [  405.932405] Disabling lock debugging due to kernel taint
Tue Nov 13 21:48:20 2018 kern.warn kernel: [  405.943322] [0000105800] mtlk0(mtlk_cdev_init:316): Max nodex set to 1048575
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.408486] [0000297272] mtlk0(__mtlk_print_endianess:3867): The system is Big endian (0xbeadfeed, 0xedfeadbe)
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.417176] [0000297280] mtlk1(mtlk_df_proc_node_create:125): Proc node root/ created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.425144] [0000297288] mtlk1(mtlk_df_proc_node_create:127): Proc node root/mtlk created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.433268] [0000297296] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry mtlk/version created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.442356] [0000297304] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry mtlk/topology created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.451689] [0000297312] mtlk0(mtlk_fast_mem_print_info:105): Using normal memory for hot context
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.460454] PCI: Enabling device 0000:00:0e.0 (0000 -> 0002)
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.466222] [0000297328] mtlk0(_mtlk_df_user_alloc_devname:6511): NDEV Name pattern: wlan%d
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.474553] [0000297336] mtlk1(mtlk_df_proc_node_create:127): Proc node mtlk/wlan1 created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.482773] [0000297344] mtlk1(mtlk_df_proc_node_create:127): Proc node wlan1/Debug created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.491141] [0000297352] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/hw_limits created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.500519] [0000297364] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/reg_limits created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.510089] [0000297372] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/antenna_gain created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.519670] [0000297380] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/do_debug_assert created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.529320] [0000297392] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/lm created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.537869] [0000297400] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/um created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.546383] [0000297408] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry wlan1/shram created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.555158] [0000297416] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/General created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.564427] [0000297428] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/MACStats created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.573739] [0000297436] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/igmp created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.582685] [0000297444] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry Debug/ResetStats created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.591888] [0000297452] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_history created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.601571] [0000297464] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_table created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.611044] [0000297472] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_channels created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.620831] [0000297484] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/aocs_penalties created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.630644] [0000297492] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/L2NAT created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.639685] [0000297500] mtlk1(_mtlk_df_proc_node_add_entry:229): Proc entry Debug/L2NAT_ClearTable created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.649446] [0000297512] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/ReorderingStats created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.659346] [0000297520] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry wlan1/EECaps created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.668482] [0000297532] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/SendQueue created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.677911] [0000297540] mtlk1(mtlk_df_proc_node_add_seq_entry:438): Proc entry Debug/serializer_dump created
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.687826] [0000297548] mtlk1(mtlk_print_drv_info:8042): *********************************************************
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.698246] [0000297560] mtlk1(mtlk_print_drv_info:8043): * Driver Compilation Details:
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.706245] [0000297568] mtlk1(mtlk_print_drv_info:8044): *********************************************************
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.716699] [0000297580] mtlk1(mtlk_print_drv_info:8046): * CONFIG=PLATFORM_UGW51_VRX288 COMPONENTS LIN_DRV LIN_RTLOG_COMPONENTS BUS_PCI_PCIE LINDRV_HW LINDRV_HW_PCIE LINDRV_HW_PCIG3 RF_MANAGEMENT_MTLK TXMM_HISTORY_LENGTH=0 RT_LOGGER_FUNCTIONS MAX_DLEVEL=1 USE_GENL_DEF USE_GENL ENVIRONMENT_NAME="ugw5.1-vrx288" HOST_TYPE="mips-linux"
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.746282] [0000297608] mtlk1(mtlk_print_drv_info:8046): * CFLAGS=
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.752537] [0000297616] mtlk1(mtlk_print_drv_info:8046): * MTLK_KERNEL_CFLAGS=-mlong-calls
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.760928] [0000297624] mtlk1(mtlk_print_drv_info:8046): * KERNELDIR=/home/ahmar/src/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/linux-4.9.120
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.775194] [0000297636] mtlk1(mtlk_print_drv_info:8046): * CROSS_COMPILE=/home/ahmar/src/WAVE300/driver/builds/ugw5.1-vrx288/../../support/mtlkfront.sh /home/ahmar/src/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.797105] [0000297660] mtlk1(mtlk_print_drv_info:8046): * HOSTNAME=
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.803516] [0000297664] mtlk1(mtlk_print_drv_info:8049): *********************************************************
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.814002] [0000297676] mtlk0(mtlk_core_pdb_fast_handles_open:33): Open Hot-path parameters
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.822509] [0000297684] mtlk1(mtlk_qos_set_map:152): Set 802.11 TID-to-AC mapping
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.830027] [0000297692] mtlk4(_mtlk_core_get_max_stas_supported_by_fw:3227): Cannot get MAX STAs supported by FW. Forcing default
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  597.841841] [0000297704] mtlk1(_mtlk_core_get_max_stas_supported_by_fw:3231): MAX STAs supported by FW: 32
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.129048] [0000297992] mtlk1(_mtlk_mmb_init_fw_capabilities:2735): FW supports 32 STAs 5 VAPs
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.161053] [0000298024] mtlk0(_mtlk_core_start:9001): CID-0000: Driver version: 3.2.1.1.48..PciG3.PcieG3.Release
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.161053] MAC/PHY versions:
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.161053] ap_upper.bin: @@@ VERSION INFO @@@ version number: FW_3.2.1_r5437 MIPS:  Upper CPU(TMC AGG AP) interface: PCI  phy type: real phy on Mar 28 2012 at 11:00:01@@@ END @@@
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.161053] contr_lm.bin: @@@ VERSION INFO @@@ version number: FW_3.2.1_r5437 MIPS:  Lower MAC  interface: --  phy type: real phy on Mar 28 2012 at 10:59:46@@@ END @@@
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.161053]
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.205826] [0000298068] mtlk1(mtlk_core_set_net_state:681): Going from NET_STATE_HALTED to NET_STATE_IDLE
Tue Nov 13 21:51:32 2018 kern.warn kernel: [  598.215485] [0000298076] mtlk1(mtlk_flctrl_register:67): mtlk_flctrl_register id = 0x1
Tue Nov 13 21:51:33 2018 kern.warn kernel: [  599.319489] [0000299180] mtlk1(mtlk_pdb_set_mac:401): << set MAC param: id(2) MAC(00:09:86:00:00:00)
Tue Nov 13 21:51:33 2018 kern.warn kernel: [  599.327387] [0000299188] mtlk1(_mtlk_core_set_mac_addr:3557): CID-0000: New MAC: 00:09:86:00:00:00
Tue Nov 13 21:51:33 2018 kern.warn kernel: [  599.336383] [0000299200] mtlk0(mtlk_eeprom_check_ee_data:2094): Options mask is 0x00
Tue Nov 13 21:51:33 2018 kern.warn kernel: [  599.344476] [0000299208] mtlk1(mtlk_pdb_set_int:353): << set param: id(13) value(0)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.351777] [0000299212] mtlk1(_mtlk_core_country_code_set_default:11828): CID-0000: Country is set to (on init): ??(0x00)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.363118] [0000299224] mtlk4(load_default_hw_table:1768): No HW limits is available for this platform (0x1a30:0x0700, type 0x38 rev 0x41)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.375482] [0000299236] mtlk1(mtlk_pdb_set_binary:385): << set binary param: res(0) id(36)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.383900] [0000299244] mtlk1(mtlk_pdb_set_binary:385): << set binary param: res(0) id(37)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.392794] [0000299256] mtlk1(mtlk_flctrl_register:67): mtlk_flctrl_register id = 0x2
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.400261] [0000299260] mtlk1(mtlk_flctrl_register:67): mtlk_flctrl_register id = 0x4
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.408205] [0000299268] mtlk1(mtlk_pdb_set_int:353): << set param: id(24) value(0)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.415881] [0000299276] mtlk1(mtlk_pdb_set_int:353): << set param: id(25) value(0)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.423522] [0000299284] mtlk1(mtlk_pdb_set_int:353): << set param: id(23) value(8)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.431170] [0000299292] mtlk1(mtlk_pdb_set_int:353): << set param: id(22) value(8)
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.439806] [0000299300] mtlk1(mtlk_core_set_net_state:681): Going from NET_STATE_IDLE to NET_STATE_READY
Tue Nov 13 21:51:34 2018 kern.warn kernel: [  599.448447] Kernel bug detected[#1]:

So what is wrong now?

Hello,

Sorry for the delay in answering. You caught me off-guard, and I had to do some code archaeology to understand which firmware I was using.

I am going to answer your questions one-by-one.

Where did you get those files? I got them from stock TpLink firmware for my router. But I still cant find the sta_upper.bin in there. I also tried the GPL code but it needs to be built before I can get files from it which I tried but it fails every time because of some errors.

I don't use the firmware files from one place, I had to combine them from multiple places. Below is a list showing relevant hashes for the files, which ones I used, and what files they came from:

What I am using:
d3c7be48e665ca48c266a66beaa94f39  ProgModel_BG_CB.bin
52482693b1d90efc05e82b8052724554  ProgModel_BG_CB_38_RevB.bin
60ef7ca6fada04ff191e5173593274da  ProgModel_BG_nCB.bin
42a2b1161bade7f3092b7df3ec45093e  ProgModel_BG_nCB_38_RevB.bin
d07938f4134632856e78ed08e10f51e7  ap_upper.bin
bcafcee4a0f84531993fe1228bee7cda  contr_lm.bin
adcde3fadfd0c81b561e37348a4b57f2  sta_upper.bin

From D6100-V1.0.0.46_0.0.46_src.zip (using ProgModel* from here):
d3c7be48e665ca48c266a66beaa94f39  ProgModel_BG_CB.bin
52482693b1d90efc05e82b8052724554  ProgModel_BG_CB_38_RevB.bin
60ef7ca6fada04ff191e5173593274da  ProgModel_BG_nCB.bin
42a2b1161bade7f3092b7df3ec45093e  ProgModel_BG_nCB_38_RevB.bin
b9ab48b0f3e7481435287276d663ddae  ap_upper.bin
ddc401a580ccbf1eb45f27d78d94696c  contr_lm.bin
fb5c64978700a4bc1bab6cff8ac56d0c  sta_upper.bin

From TD-W8980_V1_131012.zip extracted with fmk (using ap_upper.bin, contr_lm.bin, sta_upper.bin from here):
490f977c00b0b78b679b5f84d5dc82b7  ProgModel_A_CB.bin
7f2c44140b293da18a14fdcb1fd2686f  ProgModel_A_CB_38_RevA.bin
e7da53ca52779151c1b6a07b2fab4f38  ProgModel_A_nCB.bin
1da10523ee37d84647b1d4cdf6bfeb7c  ProgModel_A_nCB_38_RevA.bin
d07938f4134632856e78ed08e10f51e7  ap_upper.bin
bcafcee4a0f84531993fe1228bee7cda  contr_lm.bin
adcde3fadfd0c81b561e37348a4b57f2  sta_upper.bin

From Archer_VR200(EU)_V1_160122.zip extracted with fmk (not used):
35659ec3c05d6b8a7983d232af18814d  ProgModel_BG_CB_38_RevB_wave300.bin
6ce558aede3acc6af708cb43937c20e5  ProgModel_BG_CB_wave300.bin
3740534e472a1f678c70b5f4fa031b27  ProgModel_BG_nCB_38_RevB_wave300.bin
13b8aef051263d783bbfd75269e6701e  ProgModel_BG_nCB_wave300.bin
ce0e6a2e14a93893934f3c73daa8b0d6  ap_upper_wave300.bin
3f652810b45261e06f95d75c64bf24c6  contr_lm.bin

Please let me know if you find a better combination, or possible even a single-source, so that mixing and matching can be avoided.

But other than that Netgear D6100 has WAVE300 wifi chipset used as 5GHz wifi and the GPL code v1.0.0.46 incudes driver with version 3.4 and I think we have been using the driver with v3.2. But again this version is being worked with Kernel v2.6 so maybe we still need to figure out how to up-port it. Also there is a GPL archive for the same router with v1.0.0.50 which I haven't explored yet. Here: Netgear GPL Downloads .

I have not seen an mtlk 3.4 driver. Please link it or send it in PM, so that I may see it!
I have also not seen the GPL dump for v1.0.0.50. It was briefly available, but was pulled from the Netgear website, possibly because it included the mtlk driver.

So what is wrong now?

Please try using the exact combination of firmware I use for the VR200/VR200v.
Possibly, details of your error: Kernel bug detected[#1]: are available in dmesg.

After this log" Going from NET_STATE_IDLE to NET_STATE_READY, is when I startup hostapd. I use the custom version previously indicated renamed to mtlk-ap.

I noticed you forked and updated the documentation. Please feel free to submit pull requests, so that I may include your modifications upstream!

Thanks for your hard-work,
Vittorio

I was able to save the system log to my USB stick and that is why I have the log error with me. But I can't seem to get any information about dmesg and saving its logs to a file. I need to save the log file as the error happens because my router reboots as soon as the driver loads up, possibly a kernel panic.

On the other hand, I've seen it in the official Tp-Link firmware, the latest one, for my router that it uses a bigger file for mtlk, possibly more than 1 mb. It also doesnt use the sta_upper.bin but I wasn't able to insert it during the runtime because of some functions being unknown as it appeared in the log.

At this point, I think driver needs to be configured for 5 GHz still, because you already use it for 2.4 GHz and it's still quite buggy anyway. But I will try to find a suitable combination for it in the morning.

Thanks for providing a basis for the firmware files. I was kinda stuck at it until I read the readme file in lantiq_fw folder and searched for that exact firmware that Mandrake used in there. The link was broken so I uploaded the files to OneDrive and updated the link. But anyway, I will send a pull request once I get my basics set up and can get my feet wet.

Thanks for your help.
Ahmar

I was able to save the system log to my USB stick and that is why I have the log error with me. But I can't seem to get any information about dmesg and saving its logs to a file. I need to save the log file as the error happens because my router reboots as soon as the driver loads up, possibly a kernel panic.

Yeah, it looks like a panic. I don't think you can view them without a a USB to TTL UART converter soldered to the motherboard. All messages are printed through serial, so you can get the backtrace as well for the Kernel bug detected[#1] issue.

On the other hand, I've seen it in the official Tp-Link firmware, the latest one, for my router that it uses a bigger file for mtlk, possibly more than 1 mb. It also doesnt use the sta_upper.bin but I wasn't able to insert it during the runtime because of some functions being unknown as it appeared in the log.

STA stands for STAtion, which means anything other than an AP. I don't think you need it in AP mode, and notice how most OEM firmware images don't include it.

At this point, I think driver needs to be configured for 5 GHz still, because you already use it for 2.4 GHz and it's still quite buggy anyway. But I will try to find a suitable combination for it in the morning.

I don't think you can use 5GHz, because the WAVE 300 is connected to a 2.4GHz RADIO IC and antenna. I don't know if the firmware will load successfully or not, but I'm pretty sure it won't work.
If you want 5GHz you have to use the mt7610EN chip which uses the mt76 driver that has nothing to do with the mtlk driver. Development is ongoing for the mt7610E in the official OpenWRT/mt76 Git repository.

Thanks for providing a basis for the firmware files. I was kinda stuck at it until I read the readme file in lantiq_fw folder and searched for that exact firmware that Mandrake used in there. The link was broken so I uploaded the files to OneDrive and updated the link. But anyway, I will send a pull request once I get my basics set up and can get my feet wet.

I had personally used some firmware files I downloaded from some unknown forum, but they worked and I never asked where they came from. Once you asked me, I did some research, and was able to find the source thanks to Mandrake's post. He was instrumental in helping kickstart the development of this driver!

Keep up the good work,
Vittorio

I tried to put together some combinations of the above firmware files but none of them worked. The only that worked halfway were from TpLink firmware V1 131012. It doesn't matter what ProgModel* files I used it crashed the system if I used the files sta_uper, contr_lm, ap_upper from TpLink firmware. I was also able to capture the log but I am not sure where would I look for the problem in the driver.

I have not seen an mtlk 3.4 driver. Please link it or send it in PM, so that I may see it!

I dont think if it was the driver version, may be it was the Linux Kernel.

If you look into the firmware for Tp-Link W8980 V1 here you may see that they are not using libnl.so anymore in their /lib/ directory. I am not sure when they dropped it, maybe earlier than this update. Also the size of mtlk.ko is much bigger here in /lib/modules/ considering it's a release version. So I think they must have upgraded their versions of mtlk.ko and possibly mtlkroot.ko.

The kernel panic and associated log:

…the log before it is already posted above…
[ 5299.764498] [0004999636] mtlk1(mtlk_core_set_net_state:681): Going from NET_STATE_IDLE to NET_STATE_READY
[ 5299.773557] Kernel bug detected[#1]:
[ 5299.776865] CPU: 0 PID: 9650 Comm: insmod Tainted: P                4.9.120 #0
[ 5299.784084] task: 83983f40 task.stack: 826c4000
[ 5299.788588] $ 0   : 00000000 10800100 00000001 00000001
[ 5299.793808] $ 4   : 82b5c000 804f0000 00000000 ffffff00
[ 5299.799029] $ 8   : 805270a0 00010000 000004d4 f31d8fd8
[ 5299.804251] $12   : bd46e351 25695280 00000000 6e672066
[ 5299.809474] $16   : 82b5c000 81b80000 00000000 00000000
[ 5299.814696] $20   : 82615a00 0000abce 82a95710 8043b740
[ 5299.819919] $24   : 00000000 831e3088
[ 5299.825141] $28   : 826c4000 826c5ab0 00000000 80325694
[ 5299.830366] Hi    : 003d7429
[ 5299.833235] Lo    : b8000000
[ 5299.836118] epc   : 803256c0 0x803256c0
[ 5299.839947] ra    : 80325694 0x80325694
[ 5299.843772] Status: 1100ff03 KERNEL EXL IE
[ 5299.847949] Cause : 10800034 (ExcCode 0d)
[ 5299.851955] PrId  : 00019556 (MIPS 34Kc)
[ 5299.855868] Modules linked in: mtlk(P+) mtlkroot(P) ath9k ath9k_common ath9k_hw ath pppoe nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY pppox ppp_async owl_loader 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_netlink ltq_deu_vr9 iptable_mangle iptable_filter ipt_ECN ip_tables crc_ccitt compat act_connmark nf_conntrack act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow cls_route cls_fw sch_tbf sch_htb sch_hfsc sch_ingress drv_dsl_cpe_api ledtrig_usbport drv_mei_cpe xt_set ip_set_list_set ip_set_hash_netiface ip_set_hash_netport ip_set_hash_netnet ip_set_hash_net ip_set_hash_netportnet ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables pppoatm ppp_generic slhc ifb tun br2684 atm drv_ifxos usb_storage dwc2 uhci_hcd ohci_platform ohci_hcd ehci_platform sd_mod scsi_mod ehci_hcd gpio_button_hotplug ext4 jbd2 mbcache crc32c_generic
Process insmod (pid: 9650, threadinfo=826c4000, task=83983f40, tls=77657dc0)
[ 5299.993652] Stack : 82b5c804 00000004 000001ff 80032d30 81b7455c 0000abce 82b5c000 81b80000
[ 5300.002005]         00000000 00000000 82615a00 80325c48 829ae200 81b193d0 81b74ed4 81b7455c
[ 5300.010360]         82b5c4a0 81b2fde4 82b5c804 00000000 81b80000 829ae200 81b80000 81b16f6c
[ 5300.018716]         82615780 82615a00 819b0000 824ad604 00000000 00000000 81b80000 81b1f7e4
[ 5300.027072]         8043b740 00098600 00001950 8248d004 829ae234 82615780 82b5c804 81b0d0b0
[ 5300.035428]         ...
[ 5300.037866] Call Trace:[ 5300.040235] [<80032d30>] 0x80032d30
[ 5300.043732] [<80325c48>] 0x80325c48
[ 5300.047149] [<81b193d0>] 0x81b193d0 [mtlk@81b00000+0x82330]
[ 5300.052721] [<81b2fde4>] 0x81b2fde4 [mtlk@81b00000+0x82330]
[ 5300.058315] [<81b16f6c>] 0x81b16f6c [mtlk@81b00000+0x82330]
[ 5300.063921] [<81b1f7e4>] 0x81b1f7e4 [mtlk@81b00000+0x82330]
[ 5300.069496] [<81b0d0b0>] 0x81b0d0b0 [mtlk@81b00000+0x82330]
[ 5300.075025] [<81b35368>] 0x81b35368 [mtlk@81b00000+0x82330]
[ 5300.080638] [<81b34db4>] 0x81b34db4 [mtlk@81b00000+0x82330]
[ 5300.086193] [<81bff7d0>] 0x81bff7d0 [mtlk@81b00000+0x82330]
[ 5300.091841] [<80244f84>] 0x80244f84
[ 5300.095156] [<8026e928>] 0x8026e928
[ 5300.098691] [<8026f10c>] 0x8026f10c
[ 5300.102119] [<800cb128>] 0x800cb128
[ 5300.105652] [<8026f29c>] 0x8026f29c
[ 5300.109076] [<8026d328>] 0x8026d328
[ 5300.112594] [<8026f218>] 0x8026f218
[ 5300.116044] [<8026d3e0>] 0x8026d3e0
[ 5300.119555] [<8042d33c>] 0x8042d33c
[ 5300.123008] [<8026d22c>] 0x8026d22c
[ 5300.126521] [<8026e714>] 0x8026e714
[ 5300.130010] [<81b20720>] 0x81b20720 [mtlk@81b00000+0x82330]
[ 5300.135545] [<8026f874>] 0x8026f874
[ 5300.139027] [<8026fa38>] 0x8026fa38
[ 5300.142518] [<81bff84c>] 0x81bff84c [mtlk@81b00000+0x82330]
[ 5300.148088] [<81bff938>] 0x81bff938 [mtlk@81b00000+0x82330]
[ 5300.153690] [<81bff84c>] 0x81bff84c [mtlk@81b00000+0x82330]
[ 5300.159218] [<800025f4>] 0x800025f4
[ 5300.162729] [<80041690>] 0x80041690
[ 5300.166347] [<800ab0a8>] 0x800ab0a8
[ 5300.169691] [<800e5804>] 0x800e5804
[ 5300.173162] [<8009b9f8>] 0x8009b9f8
[ 5300.176657] [<80099900>] 0x80099900
[ 5300.180120] [<800241dc>] 0x800241dc
[ 5300.183587] [<8009bbe0>] 0x8009bbe0
[ 5300.187073] [<8009bc68>] 0x8009bc68
[ 5300.190562] [<800195f8>] 0x800195f8
[ 5300.194038] [<802054f8>] 0x802054f8
[ 5300.197510]
[ 5300.198980] Code: 00000000  92020310  0002102b <00020336> 3c138054  2672c560  2e420001  00020336  ae000198
[ 5300.208726]
[ 5300.210756] ---[ end trace 95c287bfaad2dc51 ]---
[ 5300.223048] Kernel panic - not syncing: Fatal exception
[ 5300.231893] Rebooting in 3 seconds..

Update: I forgot to mention that when I do insmod mtlk.ko ap=1 the WiFi LED for 5 GHz turns on meaning that the wifi device has been initiated but then the Kernel panic occurs and the router reboots. So maybe the problem lies somewhere in the end of initialization sequence.

If you look into the firmware for Tp-Link W8980 V1 here you may see that they are not using libnl.so anymore in their /lib/ directory. I am not sure when they dropped it, maybe earlier than this update. Also the size of mtlk.ko is much bigger here in /lib/modules/ considering it's a release version. So I think they must have upgraded their versions of mtlk.ko and possibly mtlkroot.ko .

Indeed. strange... I wouldn't look at this firmware too much since we don't have the sources for it, and netlink support is a good thing if this driver is to ever be ported to nl80211.

The kernel panic and associated log:

You probably have to go out at it with a debugger from here.
I tried to debug your panic addresses on my build. It didn't seem to be in a critical area of code, so you probably need to run it on your binary because the addresses probably do not coincide in our object code.

I am including my debug output, so you can see if it coincides for you, or so it helps you reproduce the steps to debug yourself in case you are not familiar with gdb.

# gdb
(gdb) file builds/ugw5.1-vrx288/wireless/driver/linux/mtlk.o
Reading symbols from builds/ugw5.1-vrx288/wireless/driver/linux/mtlk.o...done.
(gdb) list *(0x82330)
0x82330 is in __ELOG_DD_0 (/root/src/WAVE300/driver/builds/ugw5.1-vrx288/wireless/driver/linux/logmacros.c:233).
228	    mtlk_log_event_t log_event__;
229	    mtlk_log_buf_entry_t *pbuf__ = mtlk_log_new_pkt_reserve(LOGPKT_EVENT_HDR_SIZE + datalen__, &pdata__);
230	    if (pbuf__ != NULL) {
231	      uint8 *p__ = pdata__;
232	
233	      MTLK_ASSERT(pdata__ != NULL);
234	      MTLK_ASSERT(datalen__ <= 2047);
235	
236	      log_event__.timestamp = mtlk_log_get_timestamp();
237	      log_event__.info = LOG_MAKE_INFO(0, 0, gid);

Good luck,
Vittorio

The code snippet you provided says list *(0x82330) , now I understand it's an exception code maybe but I dont really see it in my kernel panic which I submitted above. Am I missing something here or do I need to derive this value from the panic log somehow?

From your panic:

[ 5300.037866] Call Trace:
[ 5300.040235] [<80032d30>] 0x80032d30
[ 5300.043732] [<80325c48>] 0x80325c48

[ 5300.047149] [<81b193d0>] 0x81b193d0 [mtlk@81b00000+0x82330]

Please note that it is very likely this address will change every time you build the driver.

Yes I saw that just now so I removed the post. Alright I'll dig deeper and then share my results whatever I find.

Update: I built the driver and increased the log level in make menuconfig to 9. Then I used different log levels for insmod. So kernel panic that I got this time is here.

Well in both issues I get identical errors, but I was only able to trace one of those using your method above. The output for gdb goes like this:

(gdb) file builds/ugw5.1-vrx288/wireless/driver/linux/mtlk.o
Reading symbols from builds/ugw5.1-vrx288/wireless/driver/linux/mtlk.o...done.
(gdb) list *0xd790
0xd790 is in _mtlk_slow_ctx_stop (/home/ahmar/src/WAVE300/driver/builds/ugw5.1-vrx288/../..//wireless/shared/mtlkstartup.h:30).
25      }
26
27      static __INLINE
28      void MTLK_STEPS_INFO_SD(const char *str, int var_01)
29      {
30        ILOG4_SD("%s (%d)", str, var_01);
31      }
32
33      static __INLINE
34      void MTLK_STEPS_INFO_SDD(const char *str, int var_01, int var_02)

But I wasn't able to find the other one.

(gdb) list *0xb7ad0
returns nothing

Maybe we need to check somewhere else? Let me know if this is helpful.

1 Like

Hi, to clarify things:

If you can not bring up interface with timeout and message

Wait for CHI Magic failed 

this probably means that you have driver 3.1/3.2 and firmwares (contr_lm.bin and ap_upper.bin) from 3.4 version.

Panic just after bringing device up is probably because of something incompatible in newer kernels. You can workaround it by switching the option "Use generic netlink(...)" in kernel compiling options, but anyway driver is unable to receive IP traffic. AFAIK no solution at this moment.

I was able to run and use driver 3.1 on OpenWRT AA, but this version is really unstable (does not work more than 1 day). Probably 3.2 fixes that issue.

Some binaries differ in size - main reason is enabling or disabling debug.

3.4 version found in a Netgear D6100 does not contain source code :frowning: Did I missed something?

3.4 version found in a Netgear D6100 does not contain source code :frowning: Did I missed something?

I was looking into D6100-V1.0.0.60_0.0.60_src_GPL zip and the kernel modules mtlk.ko and mtlkroot.ko (version 3.4.1.0.22) announce themselves as GPL. More specifically, mtlk.ko, offset 0x000cfccc: "license=GPL".

IANAL, but it should be enough for a formal request (from Netgear) for the original source code, which can be compiled into this specific module.

BTW Which github branch is the most up to date (or more likely the most working one)? The master of https://github.com/vittorio88/WAVE300/branches ?

I tried to compile it for the current openwrt snapshot, there was some compilation problems:

The struct net_device item .destructor wad changed to .priv_destructor and item .last_rx was removed. Also a definition GENL_ID_GENERATE was removed altogether with .id member of genl_family structure.

Also striping the object files inside multiple Makefile.in and Makefile.am.module_build scripts fail around the command:
cat .built_binary_name
I've "fixed" it by appending a "true" call, so the test on strip return value never fails.

Source codes patch:

diff --git a/driver/wireless/driver/linux/mtlk_df_user.c b/driver/wireless/driver/linux/mtlk_df_user.c
index 671c033..cf62ad8 100644
--- a/driver/wireless/driver/linux/mtlk_df_user.c
+++ b/driver/wireless/driver/linux/mtlk_df_user.c
@@ -3132,7 +3132,7 @@ static void _mtlk_df_user_fill_callbacks(mtlk_df_user_t *df_user)
   df_user->dev->netdev_ops             = &df_user->dev_ops;
 #endif

-  df_user->dev->destructor             = free_netdev;
+  df_user->dev->priv_destructor             = free_netdev;
 }

 static int _mtlk_df_ui_create_card_dir(mtlk_df_user_t* df_user)
@@ -3324,7 +3324,7 @@ mtlk_df_ui_indicate_rx_data(mtlk_df_t *df, mtlk_nbuf_t *nbuf)

   nbuf->protocol        = eth_type_trans(nbuf, nbuf->dev);
   res                   = netif_rx(nbuf);
-  df_user->dev->last_rx = jiffies;
+//  df_user->dev->last_rx = jiffies;

   if(NET_RX_SUCCESS != res)
   {
diff --git a/driver/tools/mtlkroot/linux/nlmsgs.c b/driver/tools/mtlkroot/linux/nlmsgs.c
index b6921ca..22bd4e0 100644
--- a/driver/tools/mtlkroot/linux/nlmsgs.c
+++ b/driver/tools/mtlkroot/linux/nlmsgs.c
@@ -33,7 +33,7 @@ static const struct genl_multicast_group config_multicast_group[] = {

 /* family structure */
 static struct genl_family mtlk_genl_family = {
-        .id = GENL_ID_GENERATE,
+//        .id = GENL_ID_GENERATE,
         .name = MTLK_GENL_FAMILY_NAME,
         .version = MTLK_GENL_FAMILY_VERSION,
         .maxattr = MTLK_GENL_ATTR_MAX,

I am sure master branch is the most up-to-date and working with v18.06.1 but I think there may be errors with different options selected in menuconfig.

I cant seem to bring up the Wifi interface in my W8980. I tried it with different options as mentioned above but it fails when I insert the modules. I am not sure if the code itself has a problem somewhere. I dont have much experience with C language so I cant really help.

I've used ugw5.1-vrx288 (without nand) configuration, rest options are default and firmware from TD-W8980_V1_131012.bin works on TD-W9980B too (works = scaning network).

What errors does your system log?

Documentation and drivers found on WAVE300

Humax T9 (It contains information that I do not know very well what is)

NetiaSpotWRT (lq-wave-300-03.01.00.12.31.09.58ada131737d.src.tar.gz)
https://sourceforge.net/projects/netiaspotwrt/files/

Linksys WAP610N (it seems version 03.01.00.53.42 contains firmware)
https://wikidevi.com/wiki/Linksys_WAP610N
https://www.linksys.com/us/support-article/?articleNum=114663
http://downloads.linksys.com/downloads/gpl/WAP610N_v1.0.05_build_2.tar.gz

Actiontec PK5001A (it seems that they are not...)
https://wikidevi.com/wiki/Actiontec_PK5001A
http://opensource.actiontec.com/pk5001a.html

Pace A5520N
https://forums.hardwarezone.com.sg/opensource-community-6/anyone-have-link-singtel-pace-a5520ns-source-code-4489569.html

list of patch files.
https://drive.google.com/file/d/0Bwo5VaAgs4EPTk5vWnpXWmNULThVcU9NcU41R1FJYndZd2NZ/edit?usp=sharing

TP-LINK TD-W8980 v1
https://www.tp-link.com/es/download/TD-W8980.html

TP-LINK TD-W9980 v1.x
https://www.tp-link.com/uk/download/TD-W9980.html

TP-LINK Archer VR200v
https://static.tp-link.com/resources/gpl/ArcherVR200v_GPL.tar.bz2

Some do not have the driver. Those who have it is version 3.1 for kernel 2.6