# Realtek 8168/8169

## acid_elf

I am trying to install gentoo on my newest computer, an HP dv7, Core2Duo, keyword amd64. Yes, it is dual booting with Vista, but I have tried to disable WOL in Vista. I think that worked, but I am not sure. The network card works on the install cd, minimal 2009-07-23, regardless of whether it loads after Vista reboots, or from cold. However, once I build the kernel and reboot, the card does not work. I have the computer connected through a hub to a router, and my old (circa 2002) gentoo laptop on the hub listening with wireshark.

The network card reports to windows as an Realtek RTL8168C(P)/8111C(P) Family PCI-E GBE NIC, on the install cd it lists as 8169 if I remember correctly. Since I can get no network connection, getting information back to the forums is posing a difficulty. I have not gotten pciutils installed for just that reason.

I have tried kernel 2.6.29-r5, since it is stable for 64bit. I first tried using the kernel driver, Realtek 8169 which creates r8169.ko. The boot sequence loads that module, but the card does not function. At best, ever other attempt to use dhcpcd resulted in some garbage 'Ethernet II' packets showing up on the line. I removed that module, and tried both of Realtek's drivers, 8168 and 8169. The 8169 from Realtek loads, but does not create an eth0 interface. 8168 loads and creates the interface, but no packets show up.

I am baffled by this. Searching this forum and others have provided varied information, certain kernels that may work or other attempts to use certain drivers but no followup posts that I could see stating what worked. I am hoping someone here has seen the same issue, or can point me to a [solved] post. Thanks in advance for any help.

----------

## Bones McCracker

I have a Realtek 8169 that works fine with the kernel module (r8169).

From lspci

 *Quote:*   

> 02:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
> 
> 	Subsystem: Netgear GA311
> 
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
> ...

 

I realize that's not an 8168.

Searching briefly, I came across this:

http://www.jamesonwilliams.com/hardy-r8168

It looks like it's basically indicating one should use the driver from Realtek specifically for the 8168 (and blacklist the 8169).

----------

## acid_elf

I rechecked the live cd, and I was wrong. The card does list under lspci as an 8168C/8111C. I tried building the Realtek drivers from their source, and removed the r8169 driver from all search paths (rm r8169.ko and rebuilt kernel without it enabled). Upon issuing 'modprobe r8168', dmesg said that the card was detected, eth0 was created, and I still got just garbage on the line if I got any packets at all.

I am baffled. What confuses me most, is that it works on the install cd, which is running 2.6.29-gentoo-r5 and lists the r8169 module as the driver in use. But when I build the same kernel with the same module, it does not. Is there an alternate option I should consider, to get the kernel and modules in similar condition as to the install cd? Is the .config file hidden on the disk somewhere, or should I consider genkernel?

----------

## acid_elf

And, since I realize now that I probably posted this in the wrong forum, could a kind mod please send it over to kernel & hardware? I don't want to double post a second topic there.

----------

## Bones McCracker

So, from what you're saying, with the live cd in use, the device is recognized as a 8168C/8111C, the 8169 driver is applied, and this works.

Looking at the source code for the driver...

# less /usr/src/linux-2.6.28-hardened-r9/drivers/net/r8169.c

```
/*

 * r8169.c: RealTek 8169/8168/8101 ethernet driver.

 *

 * Copyright (c) 2002 ShuChen <shuchen@realtek.com.tw>

 * Copyright (c) 2003 - 2007 Francois Romieu <romieu@fr.zoreil.com>

 * Copyright (c) a lot of people too. Please respect their work.

 *

 * See MAINTAINERS file for support contact information.

 */
```

It is apparently the driver for not only the 8169, but the 8168 and 8101.  Scouting around a bit on google leads me to believe that somebody (either Realtek or Fedora) combined the driver starting with kernel version 2.6.30 and that this was backported to previous kernel versions.  That answers one question.  You should be using the r8169 driver.

Just to be sure you've got the backported version, you might want to check your kernel source file for the driver as I have done above, and verify that it has the same comment, indicating that it's intended for the 8168 as well.

If so, then I would recommend abandoning the downloaded source from Realtek and that you instead focus on trying to get the included kernel module to work.

I don't know if the live cd has this enabled, but you may be able to find the kernel configuration file in gzipped form at /proc/config.gz.

However, the kernel configuration options for this are pretty intuitive.  Under Network device drivers, I think I just have the 8169 driver itself enabled, other than PHY device support (which automatically selects MII PHY Device drivers, which I don't even think enables anything unless a sub-option is selected, and I have none selected, because the Realtek option appears to be for 82** devices).

Other than that, I'd say it should be working, unless you disabled network device hotplugging or mangled the persistent net devices file in the udev configuration.

Sorry I can't be of more help.  It might not be a bad idea to start a new thread in kernel & hardware specifically asking for help from an 8168 user.

----------

