This is a driver issue on a vintage machine (AMD K8, Nvidia chipset) running Linux 3.11 (Mint distro, but I don't think it matters).
claudius ~ # uname -a
Linux claudius 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
claudius ~ # lspci
00:00.0 Host bridge: NVIDIA Corporation nForce3 250Gb Host Bridge (rev a1)
00:01.0 ISA bridge: NVIDIA Corporation nForce3 250Gb LPC Bridge (rev a2)
00:01.1 SMBus: NVIDIA Corporation nForce 250Gb PCI System Management (rev a1)
00:02.0 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)
00:02.1 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)
00:02.2 USB controller: NVIDIA Corporation nForce3 EHCI USB 2.0 Controller (rev a2)
00:05.0 Bridge: NVIDIA Corporation CK8S Ethernet Controller (rev a2)
00:08.0 IDE interface: NVIDIA Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)
00:0a.0 IDE interface: NVIDIA Corporation nForce3 Serial ATA Controller (rev a2)
00:0b.0 PCI bridge: NVIDIA Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)
00:0e.0 PCI bridge: NVIDIA Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:00.0 VGA compatible controller: NVIDIA Corporation NV34 [GeForce FX 5200] (rev a1)
02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller (rev 10)
I want the kernel to load an alternative driver for my Realtek 8169 PCI ethernet card, which you can see it at the end of the list as 02:05.0. Here's the detail:
claudius ~ # lspci -s 02:05.0 -vv -nn
02:05.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller [10ec:8169] (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RTL8169/8110 Family PCI Gigabit Ethernet NIC [10ec:8169]
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 19
Region 0: I/O ports at e800 [size=256]
Region 1: Memory at febffc00 (32-bit, non-prefetchable) [size=256]
Expansion ROM at febc0000 [disabled] [size=128K]
Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
The issue is that the r8169 simply doesn't work. It may even make Linux crash. I blacklisted it in /etc/modprobe.d/.
The solution seems to be using the r8168 driver instead. (There's also a related question on this site.) You can download the source from Realtek, compile and install it, which I did. If you modprobe r8168, it loads fine but doesn't associate with the hardware, so the card doesn't show up in ifconfig.
I think this has to do with the modalias (encodes the hardware info) and the device/driver mapping in /lib/modules/*/modules.alias.
claudius ~ # cat /sys/devices/pci0000\:00/0000\:00\:0e.0/0000\:02\:05.0/modalias
pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00
This is my card. Here's the Realtek driver mappings in the system:
claudius ~ # grep r816 /lib/modules/3.11.0-12-generic/modules.alias
alias pci:v00001186d00004300sv00001186sd00004C00bc*sc*i* r8169
alias pci:v000010ECd00008169sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008167sv*sd*bc*sc*i* r8169
alias pci:v00001186d00004300sv00001186sd00004B10bc*sc*i* r8168
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8168
I tried adding this line to the end of the file (knowing that you're not supposed to make manual edits):
alias pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00 r8168
Then unloaded and reloaded r8168 but that doesn't configure the card and there's nothing in dmesg.
What's the proper way to map my NIC to the r8168 driver? Do I have to rebuild the driver so it claims it can handle my card? Or is there some config data I have to add in the proper place?