# incorrect driver loaded for ethernet NIC[solved]

## Adel Ahmed

I have recently installed a new realtek pci ethernet NIC as a second ethernet NIC:

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)   => motherboard

05:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8129 (rev 10)                                                                                     => pci

I configured the 8139too as a module with 

support for older rtl-8129/8130 boards    

gentoo seems to be loading an incorrect driver:

lspci -k:

05:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8129 (rev 10)

	Subsystem: Coreco Inc RTL8111/8168 PCIe Gigabit Ethernet (misconfigured)

	Kernel driver in use: r8169

	Kernel modules: 8139too

what went wrong and how can I fix things?

thanksLast edited by Adel Ahmed on Sun Jan 04, 2015 1:50 pm; edited 1 time in total

----------

## SDNick484

Try forcing the module to be used as described in this post.  Assuming that (i.e. it lets you force the correct driver), then we'll need to figure out how to set it correctly on boot (should be easy to hack with a script but perhaps there's an easier way).

Personally, I've found setting up Realtek NICs to always be a pain although once you find the winning config, you should be good to go.

----------

## Naib

four things you can do

1) the in-kernel r8169 is perfectly fine for the r8168 chipset *IF* you have the firmware (emerge linux-firmware and at boot it will load the 8168 firmware and will be good)

2) use the in-tree r8168 drivers (emerge r8168 ) 

3) download the drivers from realtek (but thats just what emerge r8168 does)

4) use this r8169too kernel driver and make use of the module blacklist functionality to choose your prefered module:

```

cat /etc/modprobe.d/blacklist.conf 

blacklist r8168

```

I personally went the r8169 drivers + firmware blobs

```

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

   Subsystem: Gigabyte Technology Co., Ltd Motherboard

   Flags: bus master, fast devsel, latency 0, IRQ 56

   I/O ports at be00 [size=256]

   Memory at fbaff000 (64-bit, prefetchable) [size=4K]

   Memory at fbaf8000 (64-bit, prefetchable) [size=16K]

   [virtual] Expansion ROM at fbb00000 [disabled] [size=128K]

   Capabilities: [40] Power Management version 3

   Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+

   Capabilities: [70] Express Endpoint, MSI 01

   Capabilities: [ac] MSI-X: Enable- Count=4 Masked-

   Capabilities: [cc] Vital Product Data

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [140] Virtual Channel

   Capabilities: [160] Device Serial Number 03-00-00-00-68-4c-e0-00

   Kernel driver in use: r8169

   Kernel modules: r8169, r8168

```

----------

## Tony0945

Good choices, Naib. I've been down this road and finally took another path that I haven't regreted.

5. Buy an Intel ethernet card and add module e1000 to kernel config while blacklisting 8168 and r8169.

Cost me twenty bucks plus a spare PCI slot  and my connection troubles are over. Boots quickly and dependably. Realtek drivers are a mess. Not blaming the devs, Realtek design and nomenclature is a mess.Last edited by Tony0945 on Tue Dec 23, 2014 6:27 pm; edited 2 times in total

----------

## Naib

There is that  :Smile:  and that's why I have a good old tulip based nic in my PC as well.

I never understood why something as simple and old as an nic needs firmware

----------

## Adel Ahmed

echo 10ec 8169 > /sys/bus/pci/drivers/8139too/new_id   => does nothing I still have incorrect drivers loaded

1- linux-firmware is blocked by radeon ucode

2-  * Checking for suitable kernel configuration options...

 *   r8168-8.028.00 requires Realtek 8169 PCI Gigabit Ethernet adapter (CONFIG_R8169) to be DISABLED

I cannot disable r8169, my other card is already using that 

3 if that 's the same as 2, there's no point there

4 cant blacklist r8169

I'm still lost, problem is with the other ethernet card

thanks for your help

----------

## Naib

ok try #1 but selectively pull out the 8186 firmware blob, at least to see if it will work

----------

## Adel Ahmed

you lost me  :Very Happy:  what does pull out the 8186 firmware blob mean?

----------

## Naib

 *blakdeath wrote:*   

> you lost me  what does pull out the 8186 firmware blob mean?

 

Well... you are saying you cannot emerge linux-firmware because the radeon ucode blocks it (which is odd...)

Soo... what I am suggesting is manually put in the firmware for the network card to see if this is a viable solution. If it is the correct method can be determined

Take for instance my dmesg output:

```

[    5.939703] r8169 0000:03:00.0 eth0: RTL8168d/8111d at 0xffffc90000c70000, 6c:f0:49:e6:b0:ac, XID 083000c0 IRQ 40

```

This is telling me that the r8169 kernel driver is a  RTL8168d. 

If I do a:

 *Quote:*   

> equery f linux-firmware | grep 8168
> 
> /lib/firmware/rtl_nic/rtl8168d-1.fw
> 
> /lib/firmware/rtl_nic/rtl8168d-2.fw
> ...

 

One of these two are probably being used - for me. 

So..

1) download 

ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo/distfiles/linux-firmware-20141009.tar.xz   (or use whatever mirror you are happy with)

2) extract the rtl_nic directory 

3) copy the rtl_nic directory to /lib/firmware

4) reboot (or /etc/init.d/net.eth0 down && rmmod r8169 && modprobe r8169 && /etc/init.d/net.eth0 up

it should come up alot quicker

----------

## Adel Ahmed

thanks for the explanation first of all, I have tried these steps, and I have extracted the 8168 firmware files into /lib/firmawre:

localhost ~ # ls /lib/firmware/rtl_nic/

rtl8168d-1.fw  rtl8168e-1.fw  rtl8168e-3.fw  rtl8168f-2.fw  rtl8168g-2.fw

rtl8168d-2.fw  rtl8168e-2.fw  rtl8168f-1.fw  rtl8168g-1.fw  rtl8168g-3.fw

I am ending up with the same result however(r8169 kernel driver being used)

thanks

----------

## Adel Ahmed

bump

----------

## Adel Ahmed

help

----------

## Tony0945

As I understood Naib, the r8169 driver is correct. One just uses it with different firmware for the 8168 variants.

As I said previously, I personally gave up and bought this card:

www.amazon.com/gp/product/B001CY0P7G/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1

 and used the e1000 driver. 

The card is also available in plain PCI variants as well as PCI-E.

It doesn't really solve your problem, but of course, I couldn't solve it either.

----------

## bammbamm808

I'm doing just fine on the kernel's r8169 driver with the same ethernet chip.

----------

## Adel Ahmed

bammbamm, can I see your lspci -k, and do you have any other realtek cards?

----------

## bammbamm808

linux-3.17.7-gentoo, BTW

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B) (rev 02)

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (external gfx0 port B)

00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port B)

	Kernel driver in use: pcieport

00:03.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port C)

	Kernel driver in use: pcieport

00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port D)

	Kernel driver in use: pcieport

00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port E)

	Kernel driver in use: pcieport

00:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890 PCI to PCI bridge (PCI express gpp port G)

	Kernel driver in use: pcieport

00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)

	Subsystem: ASUSTeK Computer Inc. Device 84dd

	Kernel driver in use: ahci

00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Kernel driver in use: ohci-pci

	Kernel modules: ohci_pci

00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Kernel driver in use: ehci-pci

	Kernel modules: ehci_pci

00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Kernel driver in use: ohci-pci

	Kernel modules: ohci_pci

00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Kernel driver in use: ehci-pci

	Kernel modules: ehci_pci

00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller

	Kernel driver in use: piix4_smbus

	Kernel modules: i2c_piix4

00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller

00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)

00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller

	Kernel driver in use: ohci-pci

	Kernel modules: ohci_pci

00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller

	Kernel driver in use: ohci-pci

	Kernel modules: ohci_pci

00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller

	Kernel driver in use: ehci-pci

	Kernel modules: ehci_pci

00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration

00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map

00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control

	Kernel driver in use: k10temp

	Kernel modules: k10temp

00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control

01:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1)

	Subsystem: Device 196e:0865

	Kernel driver in use: nvidia

	Kernel modules: nvidia

01:00.1 Audio device: NVIDIA Corporation GF104 High Definition Audio Controller (rev a1)

	Subsystem: Device 196e:0865

02:00.0 Audio device: Creative Labs EMU20k2 [X-Fi Titanium Series] (rev 04)

	Subsystem: Creative Labs SB0880 [SoundBlaster X-Fi Titanium PCI-e]

	Kernel driver in use: snd_ctxfi

	Kernel modules: snd_ctxfi

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

	Subsystem: ASUSTeK Computer Inc. P8P67 and other motherboards

	Kernel driver in use: r8169

	Kernel modules: r8169

04:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

	Subsystem: ASUSTeK Computer Inc. P8B WS Motherboard

	Kernel driver in use: xhci_hcd

	Kernel modules: xhci_hcd

05:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

	Subsystem: ASUSTeK Computer Inc. P8B WS Motherboard

	Kernel driver in use: xhci_hcd

	Kernel modules: xhci_hcd

06:06.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)

	Subsystem: ASUSTeK Computer Inc. Motherboard

	Kernel driver in use: firewire_ohci

	Kernel modules: firewire_ohci

No other Realtek devices

----------

## Adel Ahmed

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

	Subsystem: Gigabyte Technology Co., Ltd Motherboard

	Kernel driver in use: r8169

05:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8129 (rev 10)

	Subsystem: Coreco Inc RTL8111/8168 PCIe Gigabit Ethernet (misconfigured)

	Kernel driver in use: r8169

	Kernel modules: 8139too

I'm having problems with the second NIC

----------

## Tony0945

I guessing the two card need different firmware. I think you might have to clone the driver and give it a different name and use a udev rule to load the correct one.

----------

## Adel Ahmed

I've removed the r8169 module from the kernel and it's working fine, this confirms that the problem is caused by incorrect module loading

I'll keep looking in that direction:

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

	Subsystem: Gigabyte Technology Co., Ltd Motherboard

05:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8129 (rev 10)

	Subsystem: Coreco Inc RTL8111/8168 PCIe Gigabit Ethernet (misconfigured)

	Kernel driver in use: 8139too

	Kernel modules: 8139too

----------

## Adel Ahmed

built in the 8139too module and modularized the 8169 module, everything is working fine now, I tried removing the 8139too module completely, the NIC is detected but no functionality is supported

this solves it.

thanks everyone

----------

