Make error: 'struct net_device’ has no member named ‘last_rx’

Hey guys,
The guy form my ISP finally came and fixed my shiny new router, and I am getting amazing 940Mbit up and down. Apparently I can go faster though, so I picked up an lr-link 10G NIC. When trying to install the drivers that come with it, it says to first run make clean, in the extracted directory, which seems to work fine, then just make, and then make install. When I run make, it gives me the error in the title, among other output:

david@wsUbuntu18:~/Downloads/tn40xx-0.3.6.14$ sudo make
make -C /lib/modules/4.15.0-29-generic/build M=/home/david/Downloads/tn40xx-0.3.6.14 clean
make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-29-generic’
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-29-generic’
Building kernel 4.15.0-29-generic resume supported
make -C /lib/modules/4.15.0-29-generic/build M=/home/david/Downloads/tn40xx-0.3.6.14 modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-29-generic’
Makefile:976: “Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel”
CC [M] /home/david/Downloads/tn40xx-0.3.6.14/tn40.o
/home/david/Downloads/tn40xx-0.3.6.14/tn40.c: In function ‘bdx_rx_receive’:
/home/david/Downloads/tn40xx-0.3.6.14/tn40.c:2709:15: error: ‘struct net_device’ has no member named ‘last_rx’
priv->ndev->last_rx = jiffies;
^~
scripts/Makefile.build:332: recipe for target ‘/home/david/Downloads/tn40xx-0.3.6.14/tn40.o’ failed
make[2]: *** [/home/david/Downloads/tn40xx-0.3.6.14/tn40.o] Error 1
Makefile:1552: recipe for target ‘module/home/david/Downloads/tn40xx-0.3.6.14’ failed
make[1]: *** [module/home/david/Downloads/tn40xx-0.3.6.14] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-29-generic’
Makefile:105: recipe for target ‘all’ failed
make: *** [all] Error 2

Running make install then simply gives

david@wsUbuntu18:~/Downloads/tn40xx-0.3.6.14$ sudo make install
make: *** No rule to make target ‘tn40xx.ko’, needed by ‘install’. Stop.

I am running Ubuntu 18.04, on kernel 4.15.

Any ideas what I am doing wrong/am missing?

I think that’s your issue.

show off.

Added the helpdesk tag so people know you need help.

I installed libelf-dev, and it can’t find the other two when I try to do apt-get install.
Even after a reboot, it gives the same error, only the line you quoted disappeared.

I am still stuck on this, does anyone have an idea on how to proceed, here is the output from “make” again:

david@wsUbuntu18:~/Downloads/tn40xx-0.3.6.14$ sudo make
make -C /lib/modules/4.15.0-30-generic/build M=/home/david/Downloads/tn40xx-0.3.6.14 clean
make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-30-generic’
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-30-generic’
Building kernel 4.15.0-30-generic resume supported
make -C /lib/modules/4.15.0-30-generic/build M=/home/david/Downloads/tn40xx-0.3.6.14 modules
make[1]: Entering directory ‘/usr/src/linux-headers-4.15.0-30-generic’
CC [M] /home/david/Downloads/tn40xx-0.3.6.14/tn40.o
/home/david/Downloads/tn40xx-0.3.6.14/tn40.c: In function ‘bdx_rx_receive’:
/home/david/Downloads/tn40xx-0.3.6.14/tn40.c:2709:15: error: ‘struct net_device’ has no member named ‘last_rx’
priv->ndev->last_rx = jiffies;
^~
scripts/Makefile.build:332: recipe for target ‘/home/david/Downloads/tn40xx-0.3.6.14/tn40.o’ failed
make[2]: *** [/home/david/Downloads/tn40xx-0.3.6.14/tn40.o] Error 1
Makefile:1552: recipe for target ‘module/home/david/Downloads/tn40xx-0.3.6.14’ failed
make[1]: *** [module/home/david/Downloads/tn40xx-0.3.6.14] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.15.0-30-generic’
Makefile:105: recipe for target ‘all’ failed
make: *** [all] Error 2

Post a link to the source.

I don’t have a link to the driver, as it came on a CD. I didn’t find it online on their website, only drivers for SFP+ models, but mine is RJ45.
I uploaded it to Dropbox, here is a link: https://www.dropbox.com/s/rfbx0cducwtfu26/tn40xx-0.3.6.14.tgz?dl=0

Not sure what’s wrong with your driver, but building random things as yourself is dangerous enough, and you’re even doing it as root… stop running with sudo.

Now, my guess is your drivers off of a CD are ancient, and my guess is they’re meant to be built with kernel 3.6.14 just from looking at the name, but I’m not sure.

Your best bet is probably to run lspci and with that information try to find a different driver for your card, or at least post some more information about the card here and someone might help you look for drivers.

Fixing/updating the driver yourself is also an option, it’s probably safe to assume the driver worked at some point with some version of Linux. You could bisect to try and find what version builds and take it from there and fix the driver.

Also, I’m guessing SFP+ drivers are probably one and the same as RJ45, you could try building those and maybe you get lucky

2 Likes

I had to go back to CentOS 6 to get it to compile.

The one on github compiles on recent kernels: tn40xx-driver

$ git clone https://github.com/acooks/tn40xx-driver
Cloning into 'tn40xx-driver'...
remote: Counting objects: 463, done.
remote: Total 463 (delta 0), reused 0 (delta 0), pack-reused 463
Receiving objects: 100% (463/463), 2.30 MiB | 1.73 MiB/s, done.
Resolving deltas: 100% (294/294), done.
$ cd tn40xx-driver/
$ make
make -C /lib/modules/4.17.5-100.fc27.x86_64/build M=/home/chris/tn40xx-driver clean
make[1]: Entering directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
make[1]: Leaving directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
Building kernel 4.17.5-100.fc27.x86_64 resume supported
make -C /lib/modules/4.17.5-100.fc27.x86_64/build M=/home/chris/tn40xx-driver modules 
make[1]: Entering directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
  CC [M]  /home/chris/tn40xx-driver/tn40.o
  CC [M]  /home/chris/tn40xx-driver/CX4.o
  CC [M]  /home/chris/tn40xx-driver/CX4_Linux.o
  CC [M]  /home/chris/tn40xx-driver/QT2025_phy.o
  CC [M]  /home/chris/tn40xx-driver/QT2025_phy_Linux.o
  CC [M]  /home/chris/tn40xx-driver/TLK10232_phy.o
  CC [M]  /home/chris/tn40xx-driver/TLK10232_phy_Linux.o
  CC [M]  /home/chris/tn40xx-driver/AQR105_phy.o
  CC [M]  /home/chris/tn40xx-driver/AQR105_phy_Linux.o
  CC [M]  /home/chris/tn40xx-driver/MV88X3120_phy.o
  CC [M]  /home/chris/tn40xx-driver/MV88X3120_phy_Linux.o
  LD [M]  /home/chris/tn40xx-driver/tn40xx.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/chris/tn40xx-driver/tn40xx.mod.o
  LD [M]  /home/chris/tn40xx-driver/tn40xx.ko
make[1]: Leaving directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'

Sorry for the delayed response, I had to put this project on the back burner due to some other things. Now I’m back on it though.

Thank you for that, this one installed with no errors. However the network adapter still shows as “UNCLAIMED” when I do “lshw -class network” and doesn’t exactly work. Is there anything else I need to do, after running make and make install, or is the driver just not working?

I also did finally find the other one online, and it seems to be a recent version (but the same as on the CD), here is the link to it in case anyone is curious: http://www.lr-link.com/products/LREC6860BT.html
I also contacted lr-link directly about this, but my hopes of a good answer are low, as I only found a sales email.

Looking at the device ids for 10GBase-T, it looks like they are all there, none were removed. Try “lshw -class network -numeric” and look for the device number (ex: product: I211 Gigabit Network Connection [8086:1539]). I believe these are used match the driver and they are declared at the top of tn.c.

This is what it shows for this adapter, this is also where I got the “unclaimed” from

*-network UNCLAIMED
description: Ethernet controller
product: TN9710P 10GBase-T/NBASE-T Ethernet Adapter
vendor: Tehuti Networks Ltd.
physical id: 0
bus info: pci@0000:03:00.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: msi pm pciexpress bus_master cap_list
configuration: latency=0
resources: memory:f2100000-f210ffff

I also did get an answer back from tr-link directly, so I will see where that leads and update you guys if they come up with a solution.

If you run

$ lshw -class network -numeric

The device id should match this, from tn40.c:51

        LDEV(TEHUTI_VID, 0x4027, 0x3015, 1, 1, MV88X3310, NA,
             "TN9710P 10GBase-T/NBASE-T Ethernet Adapter"),

Running modprobe tn40xx, then look at dmesg:

$ sudo modprobe tn40xx
$ dmesg | tail
[2973113.366740] tn40xx: loading out-of-tree module taints kernel.
[2973113.367178] tn40xx: module verification failed: signature and/or required key missing - tainting kernel
[2973113.368840] Tehuti Network Driver, 0.3.6.16.1
[2973113.368842] Supported phys : MV88X3120   QT2025 TLK10232 AQR105 MUSTANG 

It looks like it does not compile support for the MV88X3310 by default.

Hmm, looks like a header is missing… Sorry, it doesn’t look good for support of that adapter. It is probably Marvell who is to blame, they will make a reference design and not support it after the release.

$ make MV88X3310=YES
make -C /lib/modules/4.17.5-100.fc27.x86_64/build M=/home/chris/tn40xx-driver clean
make[1]: Entering directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
make[1]: Leaving directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
Building kernel 4.17.5-100.fc27.x86_64 resume supported
make -C /lib/modules/4.17.5-100.fc27.x86_64/build M=/home/chris/tn40xx-driver modules 
make[1]: Entering directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
  CC [M]  /home/chris/tn40xx-driver/tn40.o
  CC [M]  /home/chris/tn40xx-driver/CX4.o
  CC [M]  /home/chris/tn40xx-driver/CX4_Linux.o
  CC [M]  /home/chris/tn40xx-driver/MV88X3310_phy.o
/home/chris/tn40xx-driver/MV88X3310_phy.c:3:10: fatal error: MV88X3310_phy.h: No such file or directory
 #include "MV88X3310_phy.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:313: /home/chris/tn40xx-driver/MV88X3310_phy.o] Error 1
make[1]: *** [Makefile:1575: _module_/home/chris/tn40xx-driver] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.17.5-100.fc27.x86_64'
make: *** [Makefile:146: all] Error 2