r8169.o and the kernel headers
As I had put the old (unstable?) Ethernet card back into the spare PC, I ‘d predicted I’d simply transferred the problem from one box to another. Yep, sure had. Linux had the same symptoms using the natsemi driver on this card – poor connection and 50% packet loss.
So, I went and and brought a Surecom Gigabit card for under $40. It wasn’t a no-name clone, so it should be okay with Linux. But it did take me HOURS to get working. About 4, I’d tip.
The makers had included a diskette with Linux drivers. Actualy the SOURCE for the drivers. And there the fun starts. I had to compile them.
It compiled okay, but then refused to install. Debian said “kernel-module version mismatch” I was running (according to uname -r) 2.4.18-bf2.4 , but had apparently compiled for a ‘different’ version of the kernel; 2.4.18
After much reading and Googling I found:
1) The -bf2.4 is like a text-flag to allow different flavours of the same version (2.4.18) kernel to be distributed
2) The compile process, actually the makefile at the start, wasn’t fully aware of this -bf2.4 thing. Seems like it was determining I was on plain old 2.4.18
3) I should install the kernel-headers package for 2.4.18-bf2.4
4) I then ‘hacked’ (that is, edited) the makefile to explicitly point to the headers installed by 3)
The make/compile worked okay. I copied the resulting r8169.o file over to the correct location, buried under /lib/modules
And it half worked. It came active (insmod r8169) but then it said it searched the ISA bus and couldn’t find any cards.
I checked the website of the maker for updated Linux drivers. Thinking I’d found them I did the above again with the new – and different named – driver source. Same error!
A close look at the side of the cards original box revealed these ‘newer’ drivers were not actually for my card. Bit of a mis-labelling on the front of the box.
So time to look at hardware.
Yep, sure enough, the card wasn’t seated properly in the slot 🙁
A reboot later and the insmod r8169 worked. Aliased that to eth0 in modules.conf and away we go. Linux kindly ‘remembered’ the correct IP address etc from the previous eth0 configuration. Thus far it’s been MUCH more stable.
The above is the cut down version of what happened. I had been down all sorts of rabbit holes, including installing the kernel source, then unzipping it and untarring it. I gotta say, it’s a lot of mucking about for one 17 kb file; that’s all r8169.o was. I just couldn’t find a version compiled for my kernel anywhere. So had to do it by hand.
This Debian kernel (2.4.18) is quite ‘back level’ relative to other distributions. I’ve since found out that the above r8169 module has been in the Linux kernel since 2.4.21 For comparison Fedora Core 3 is on a 2.6 level kernel. I’m not whinging, I chose Debian with my eyes open