acooks / tn40xx-driver

Linux driver for tn40xx from Tehuti Networks
71 stars 50 forks source link

error: unknown field ‘ndo_change_mtu’ specified in initializer (Install fails on CentOS7 - kernel 3.10.0-1160.80.1.el7.x86_64) #55

Closed alexlimbeck closed 8 months ago

alexlimbeck commented 1 year ago

I am trying to install the driver on a CentOS7 server, but the installer exit with this error in log: /var/lib/dkms/tn40xx/004/build/tn40.c:3387:2: error: unknown field ‘ndo_change_mtu’ specified in initializer

I found a workaround inserting this line in /usr/src/tn40xx-004/tn40.h

define ndo_change_mtu ndo_change_mtu_rh74

But then I have other errors to solve: /var/lib/dkms/tn40xx/004/build/tn40.c:3556:6: error: ‘struct net_device’ has no member named ‘min_mtu’ /var/lib/dkms/tn40xx/004/build/tn40.c:3557:6: error: ‘struct net_device’ has no member named ‘max_mtu’

cahz commented 1 year ago

The current version does not support older older linux kernels. Maybe you can try your luck with commit 8809878d9f1b7f5bbca45adc62c18f8f27d98558 (which is the last one before support for kernels older than 3.16 was removed).

alexlimbeck commented 1 year ago

I tryed also with CentOS8 - kernel 4.18-something... The installer fails with: Deprecated feature: REMAKE_INITRD

alexlimbeck commented 1 year ago

Now I am trying with CentOS8 Stream - kernel 4.18.0-408.el8.x86_64

The installer fails with a lot of errors: ` DKMS make.log for tn40xx-004 for kernel 4.18.0-408.el8.x86_64 (x86_64)

Tue Dec 13 14:06:16 CET 2022 make: Entering directory '/usr/src/kernels/4.18.0-408.el8.x86_64' CC [M] /var/lib/dkms/tn40xx/004/build/tn40.o CC [M] /var/lib/dkms/tn40xx/004/build/CX4.o CC [M] /var/lib/dkms/tn40xx/004/build/CX4_Linux.o CC [M] /var/lib/dkms/tn40xx/004/build/QT2025_phy.o /var/lib/dkms/tn40xx/004/build/tn40.c: In function ‘bdx_ethtool_ops’: /var/lib/dkms/tn40xx/004/build/tn40.c:4097:19: error: initialization of ‘int ()(struct net_device , struct ethtool_coalesce , struct kernel_ethtool_coalesce , struct netlink_ext_ack )’ from incompatible pointer type ‘int ()(struct net_device , struct ethtool_coalesce )’ [-Werror=incompatible-pointer-types] .get_coalesce = bdx_get_coalesce, ^~~~ /var/lib/dkms/tn40xx/004/build/tn40.c:4097:19: note: (near initialization for ‘bdx_ethtool_ops..get_coalesce’) /var/lib/dkms/tn40xx/004/build/tn40.c:4098:19: error: initialization of ‘int ()(struct net_device , struct ethtool_coalesce , struct kernel_ethtool_coalesce , struct netlink_ext_ack )’ from incompatible pointer type ‘int ()(struct net_device , struct ethtool_coalesce )’ [-Werror=incompatible-pointer-types] .set_coalesce = bdx_set_coalesce, ^~~~ /var/lib/dkms/tn40xx/004/build/tn40.c:4098:19: note: (near initialization for ‘bdx_ethtool_ops..set_coalesce’) /var/lib/dkms/tn40xx/004/build/tn40.c:4099:20: error: initialization of ‘void ()(struct net_device , struct ethtool_ringparam , struct kernel_ethtool_ringparam , struct netlink_ext_ack )’ from incompatible pointer type ‘void ()(struct net_device , struct ethtool_ringparam )’ [-Werror=incompatible-pointer-types] .get_ringparam = bdx_get_ringparam, ^~~~~ /var/lib/dkms/tn40xx/004/build/tn40.c:4099:20: note: (near initialization for ‘bdx_ethtool_ops..get_ringparam’) /var/lib/dkms/tn40xx/004/build/tn40.c:4100:20: error: initialization of ‘int ()(struct net_device , struct ethtool_ringparam , struct kernel_ethtool_ringparam , struct netlink_ext_ack )’ from incompatible pointer type ‘int ()(struct net_device , struct ethtool_ringparam )’ [-Werror=incompatible-pointer-types] .set_ringparam = bdx_set_ringparam, ^~~~~ /var/lib/dkms/tn40xx/004/build/tn40.c:4100:20: note: (near initialization for ‘bdx_ethtool_ops..set_ringparam’) CC [M] /var/lib/dkms/tn40xx/004/build/QT2025_phy_Linux.o CC [M] /var/lib/dkms/tn40xx/004/build/TLK10232_phy.o CC [M] /var/lib/dkms/tn40xx/004/build/TLK10232_phy_Linux.o CC [M] /var/lib/dkms/tn40xx/004/build/AQR105_phy.o CC [M] /var/lib/dkms/tn40xx/004/build/AQR105_phy_Linux.o cc1: some warnings being treated as errors make[1]: [scripts/Makefile.build:315: /var/lib/dkms/tn40xx/004/build/tn40.o] Error 1 make[1]: Waiting for unfinished jobs.... make: *** [Makefile:1577: module/var/lib/dkms/tn40xx/004/build] Error 2 make: Leaving directory '/usr/src/kernels/4.18.0-408.el8.x86_64' `

acooks commented 8 months ago

bdx_[gs]etringparam fixed for old kernels in commit db4c74d7479263 included in release/tn40xx-006 bdx[gs]et_coalesce fixed for old kernels in commit 06f728adbce673, also included in release/tn40xx-006