# Realtek Semiconductor

## Flonaldo

Hi, I can't set my Realtek Semiconductor 8168; it's a GigaBit; when i type 

```
ifconfig eth0 up
```

 my system say 

```
unknow interface: No such device
```

; i'm using a 2.6.12-gentoo-r10 kernel and i built-in the in the kernel the support for 

```
Realtek 8169 gigabit ethernet
```

I don't know why but my ethernet doesn't work! Sorry for my english    :Embarassed: 

----------

## NeddySeagoon

Flonaldo,

Please post the ethernet line from the oitput of lspci. You can do this from the liveCD and the output of lsmod, again from the liveCD with the network working.

The process in this post  may help.

----------

## Flonaldo

 *NeddySeagoon wrote:*   

> Flonaldo,
> 
> Please post the ethernet line from the oitput of lspci. You can do this from the liveCD and the output of lsmod, again from the liveCD with the network working.
> 
> The process in this post  may help.

 

well, my live cd doens't find my ethernet!  :Twisted Evil:  The classic red string   :Twisted Evil: 

lspci | grep Ethernet 

```
Ethernet Controller : Realtek Semiconductor Co., LDT.: Unknow Device 8168 (rev01)
```

any idea?

----------

## NeddySeagoon

Flonaldo,

Boot the liveCD  and do 

```
modprobe r8169
```

the liveCD is not 100% at spotting 1Gb network cards.

```
ifconfig -a
```

 should show eth0 now but its not yet running.

Run 

```
net-setup eth0
```

Now check it works.

If thats OK you need the Realtek 8169 gigabit ethernet support as a module in your kernel.

Some !Gb network cards do not autonegiotiate wth some 100Mb switches, so yo umay need to use module parameters to fix thet.

----------

## Flonaldo

 *NeddySeagoon wrote:*   

> Flonaldo,
> 
> Boot the liveCD  and do 
> 
> ```
> ...

 

I'm sorry but there is no way to set my card! I tried with r8169 module but it doesn't work! I tried to set my connection both by dhcpcd and manually but nothing...

I really dont't know why, i'm not a noob but...this is unbelivable! I also check if my phisical card was present   :Laughing: 

----------

## CYberF0x

I have the same problem with my Asus U5A Notebook.

modprobe r8169 shows nothing in the dmesg logs

Same lscpi output.

I have no conlusion   :Rolling Eyes: 

please help us  :Smile: 

----------

## wildhorse

I managed to get the RTL8169 up once I included the driver into the kernel, but never got it completely working as it should. Thus my conclusion at

https://forums.gentoo.org/viewtopic-t-443762.html

----------

## NeddySeagoon

CYberF0x,

Its good that modprobe r8139 shows nothing in dmesg. That means it loaded without errors.

Does 

```
ifconfig -a 
```

show eth0 now ?

----------

## CYberF0x

Nope ifconfig shows only this f*** ethernet over firewire device

if tested it with debian testing and the same problem...

----------

## GKar

Your Card is a 8168 not a 8169.

Use this one:

http://www.realtek.com.tw/downloads/downloads1-3.aspx?keyword=8168

----------

## helamonster

I have the same chipset and the 8169 driver doesn't seem to work, so I try the driver provided by the manufacturer version 1.02 (from http://www.realtek.com.tw/downloads/downloads1-3.aspx?keyword=8168 ), but this is what I get:

```
# make clean modules

make -C src/ clean

make[1]: Entering directory `/mnt/archive/installs/drivers/Realtek 8169 Gigabit Ethernet/r1000/src'

Makefile:28: /archive/installs/drivers/Realtek: No such file or directory

Makefile:28: 8169: No such file or directory

Makefile:28: Gigabit: No such file or directory

Makefile:28: Ethernet/r1000/src/Makefile_linux26x: No such file or directory

make[1]: *** No rule to make target `Ethernet/r1000/src/Makefile_linux26x'.  Stop.

make[1]: Leaving directory `/mnt/archive/installs/drivers/Realtek 8169 Gigabit Ethernet/r1000/src'

make: *** [clean] Error 2
```

I haven't spent much time on it, so I haven't yet figured out how to get it to compile correctly. If anyone has a quick answer, please let me know. Otherwise, I will continue to tinker with it...

----------

## helamonster

Duh! The makefile wasn't prepared for paths with spaces!

I could fix it, but I'm lazy -- I  just renamed my directory and now it compiles OK :)

----------

## ikostadinov

Hey,

I just bought a new Asus A8F and got the same problem. I cannot install Gentoo until I get my network working. (Well, I can download distribution image.... but I don't want to). Here is the lspci output for the ethernet card:

```
Ethernet Controller : Realtek Semiconductor Co., LDT.: Unknow Device 8168 (rev01)
```

```
modprobe r8169
```

 or 

```
modprobe 8139too
```

don't help at all - I checked dmesg. I cannot touch the kernel at this point I guess or? Can't compile the r1000 driver either.

I read the thread 5 times already  :Surprised: (

Any help will be appreciated.

----------

## pagan1

@ikostadinov:

You have a realtek 8168. This ist not the same as 8169 an does not work with the 8169 module. You need, as mentioned above by GKar, the driver from http://www.realtek.com.tw/downloads/downloads1-3.aspx?keyword=8168

Anyways, i am trying to compile the r1000 module  on the 2006.0 livecd and it fails (i suppose due to read only filesystem)

```

livecd r1000 # make clean modules

make -C src/ clean

make[1]: Entering directory `/root/r1000/src'

rm -f *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags

make[1]: Leaving directory `/root/r1000/src'

make -C src/ modules

make[1]: Entering directory `/root/r1000/src'

make -C /lib/modules/2.6.15-gentoo-r5/build SUBDIRS=/root/r1000/src modules

make: *** /lib/modules/2.6.15-gentoo-r5/build: No such file or directory.  Stop$

make[1]: Leaving directory `/root/r1000/src'

make: *** [modules] Error 2

```

I have no clue what to do about it.  It compiles just fine on my other slackware box, but if i try to insmod the r1000.ko compiled on the slackware box on the gentoo livece box ist says "invalid module format".   :Sad: 

----------

## procyon112

 *pagan1 wrote:*   

> @ikostadinov:
> 
> I have no clue what to do about it.  It compiles just fine on my other slackware box, but if i try to insmod the r1000.ko compiled on the slackware box on the gentoo livece box ist says "invalid module format".  :(

 

Ok, I just did this on an MSI-1034 laptop and had the same issues.  Here's how I got it to work:

WIth the livecd, do a completely networkless install from the CD.  Burn a CD with the latest kernel.org sources AND the sources for the 8168 driver.  After completing the livecd install with no network, boot into your new environment and mount the CD with the kernel.  untar the sources to the usual place /usr/src/linux-blahblahblah and make a link if you like to /usr/src/linux.  Go build yourself a stock kernel from the official sources and then reboot into it.  Now that you are running a kernel you have sources to, you can compile the driver normally as per the README.  modprobe r1000 and restart net.eth0 and you are up.  Now emerge --sync, emerge gentoo-sources, do the kernel compile again, reboot, rebuild the driver and you have, finally, the driver running under a real Gentoo kernel.

PITA, but it works finally ;)

----------

## ikostadinov

Hey,

sorry for the late response. I got it to work the same way:

1. networkless install

2. compiling r1000

3. live happily ever after with working network  :Surprised: )

Thanx for the responses!

I.

----------

## StuTheBearded

Yeah the 8169 can't possibly work with the 8168 chip for the simple reason their on different buses, the 8169 is a PCI chip the 8168 is a PCI-E chip now please correct me if i'm wrong but i was aware these are very different. Shame theres no kernel module :S looks like the realtek driver it is

----------

## dsd

i have a feeling that the r8169 driver might be working, or if not, close to working with this hardware. can someone try this patch?

http://dev.gentoo.org/~dsd/kernel/r8168.patch

----------

## dsd

ok, i think a couple more modifications will be needed. can someone please show the output of "lspci -vvv" for the card?

----------

## devilbush

 *dsd wrote:*   

> ok, i think a couple more modifications will be needed. can someone please show the output of "lspci -vvv" for the card?

 

Will any lspci output regarding a r8169 do?  If so:

```

02:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

        Subsystem: Micro-Star International Co., Ltd. Unknown device 025c

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-

        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

        Latency: 32 (8000ns min, 16000ns max), Cache Line Size 10

        Interrupt: pin A routed to IRQ 20

        Region 0: I/O ports at 9000 [size=256]

        Region 1: Memory at fdefd000 (32-bit, non-prefetchable) [size=256]

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

        Capabilities: [dc] Power Management version 2

                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)

                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

```

----------

## dsd

thanks, i do need one of them as well

----------

## procyon112

 *dsd wrote:*   

> ok, i think a couple more modifications will be needed. can someone please show the output of "lspci -vvv" for the card?

 

```

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Unknown device 8168 (rev 01)

        Subsystem: Micro-Star International Co., Ltd. Unknown device 0341

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

        Latency: 0, Cache Line Size 08

        Interrupt: pin A routed to IRQ 177

        Region 0: I/O ports at c800 [size=256]

        Region 2: Memory at ff2ff000 (64-bit, non-prefetchable) [size=4K]

        Expansion ROM at ff2e0000 [disabled] [size=64K]

        Capabilities: [40] Power Management version 2

                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)

                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

        Capabilities: [48] Vital Product Data

        Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable-

                Address: 0000000000000000  Data: 0000

        Capabilities: [60] Express Endpoint IRQ 0

                Device: Supported: MaxPayload 1024 bytes, PhantFunc 0, ExtTag-

                Device: Latency L0s unlimited, L1 unlimited

                Device: AtnBtn+ AtnInd+ PwrInd+

                Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-

                Device: RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+

                Device: MaxPayload 128 bytes, MaxReadReq 512 bytes

                Link: Supported Speed 2.5Gb/s, Width x4, ASPM L0s L1, Port 0

                Link: Latency L0s unlimited, L1 unlimited

                Link: ASPM Disabled RCB 64 bytes CommClk+ ExtSynch-

                Link: Speed 2.5Gb/s, Width x4

        Capabilities: [84] Vendor Specific Information

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [12c] Virtual Channel

        Capabilities: [148] Device Serial Number 00-00-00-00-00-00-00-9c

        Capabilities: [154] Power Budgeting

```

----------

## dsd

new patch: http://dev.gentoo.org/~dsd/kernel/r8168.patch

hit refresh to make sure you have the latest version

this should (fingers crossed) allow the r8168 hardware to work, swift testing reports appreciated if you want this hardware supported on gentoo's next release media  :Wink: 

----------

## StuTheBearded

i'll give it a go when I get home  :Smile:  how do I apply said patch? and for each new patch do I just add that on top the last one?

----------

## dsd

assuming you havent applied the first one:

cd  /usr/src/linux

patch -p1 -i /path/to/patch

if you have applied the first one, you can revert the old one with -R or just start with clean sources

----------

## StuTheBearded

right cool thanks  :Smile:  not being used to patching source code its not the sort of thing i'd tend to go and learn unless I need to.

----------

## agnitio

 *dsd wrote:*   

> new patch: http://dev.gentoo.org/~dsd/kernel/r8168.patch
> 
> hit refresh to make sure you have the latest version
> 
> this should (fingers crossed) allow the r8168 hardware to work, swift testing reports appreciated if you want this hardware supported on gentoo's next release media 

 

I tried this out, it patches and compiles nicely, and I get an interface when I run ifconfig. I haven't been able to try the network card out physically because I'm always using my wireless interface, but it seems fine so far. Great job, thanks alot. I hope you get this upstream so that this support is included in the vanilla kernel (and maybe included as a patch in gentoo-sources until then).

----------

## dsd

it was reported that it doesnt work. please try applying this patch instead:

http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.17-rc6/r8169/0005-r8169-sync-with-vendor-s-driver.txt

----------

## BlueFusion

EDIT: Ebuild topic now located at https://forums.gentoo.org/viewtopic-p-3401458.html#3401458

I'm working on an ebuild for the r1000 driver now, but need some help (I'm an ebuild newbie  :Embarassed:  ).

I can't get it to digest due to the unusual file name (with parenthesis) at the realtek site (

http://www.realtek.com.tw/downloads/downloads1-3.aspx?software=True&refdesign=True&spec=True&other=True&series=2004111&lineID=1&famID=4 ).

Here's what I've got so far:

```
# Copyright 1999-2006 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

inherit linux-mod

DESCRIPTION="Driver for the Realtek RTL8168 PCI-Express Ethernet Device"

HOMEPAGE="http://www.realtek.com.tw"

SRC_URI="ftp://61.56.86.122/cn/nic/rtl8111brtl8168b/linux-r1000(103).zip"

DEPEND="virtual/linux-sources"

LICENSE="UNKNOWN"

SLOT="0"

KEYWORDS="~amd64 ~x86"

IUSE=""

BUILD_TARGETS="all"

MODULE_NAMES="r1000(kernel/drivers/net:)"

src_unpack() {

    unpack linux-r1000\(103\).zip

    cd ${WORKDIR}/r1000

    epatch "${FILESDIR}"/r1000-1.0.3-fix.patch

}

src_compile() {

    linux-mod_src_compile

}

src_install() {

   linux-mod_src_install

    dodoc README

}
```

When I run ebuild /usr/portage/net-misc/r1000/r1000-1.0.3.ebuild digest, it fails as it looks for the file "103", because of the parenthesis in the SRC_URI.

By the way, here's the patch file, because the version available on the website has a typo.  I emailed the guy about it, but apparently he's out of the office until next week.

```
--- src/r1000_n.c.orig  2006-06-23 20:49:38.000000000 -0400

+++ src/r1000_n.c       2006-06-23 20:51:10.000000000 -0400

@@ -1447,7 +1447,7 @@

 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)

        synchronize_irq ();

 #else

-       synchronize_irq(entdev->irq);

+       synchronize_irq(netdev->irq);

 #endif

        free_irq (netdev->irq, netdev);
```

Any ideas how to fix the SRC_URI thing and if there are any other problems with my first from-scratch ebuild?  Also, I don't know what kind of license the file is...there are no notes of the license in the download, and I don't see any on the site...

----------

## agnitio

 *dsd wrote:*   

> it was reported that it doesnt work. please try applying this patch instead:
> 
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.17-rc6/r8169/0005-r8169-sync-with-vendor-s-driver.txt

 

Thanks, I'll try this out instead then. By the way, any sign of if/when this will be included upstream so that one doesn't have to patch manually everytime a new kernel is installed (granted that this is not that often, but still...).  :Smile: 

----------

## dracula1985

 *dsd wrote:*   

> it was reported that it doesnt work. please try applying this patch instead:
> 
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.17-rc6/r8169/0005-r8169-sync-with-vendor-s-driver.txt

 

I tryed it with kernel 2.6.17-r2, but patch don't go right, I think because it was written for another kernel version...

Following this thread the realtek module compile and works: https://forums.gentoo.org/viewtopic-t-462360.html

But I hope the patch to the kernel module will be integrated to next vanilla or gentoo-sources...

----------

## socksz

Hi all,

I have read this topic, but i've the same problem!

Someone is successful to resolve this problem?

My lspci output is the same of Flonaldo.

I've booted on Gentoo LiveCD but my network is down because ifconfig eth0 report:

```
eth0  Link encap: UNSPEC HWaddr 00-E0-18-00-03-57-B2-B3-00-00-00-00-00-00-00

            etc etc

```

I've tryed to port r1000 drivers on gentoo with a usb-key but when i run make clean modules:

```
make -C src/ clean

make[1]: Entering direcoty `/home/gentoo/r1000_v1.04/src'

rm -f *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags

make[1]: Leaving directory `/home/gentoo/r1000_v1.04/src'

make -C src/ modules

make[1]: Entering directory `/home/gentoo/r1000_v1.04/src'

make -C  /lib/modules/2.6.15-gentoo-r5/build: No such file or directory. Stop.

make: Entering an unknow directorymake: Leaving an unknow directorymake[1]: *** [modules] Error 2

make[1]: Leaving directory `/home/gentoo/r1000_v1.04/src'

make: *** [modules] Error 2 
```

I've read https://forums.gentoo.org/viewtopic-t-462360.html

but i don't have /usr/src/linux !

```

$ ls -l /usr/src

total 0
```

I'm on livecd.. 

How can i resolve?

thanks! bye   :Wink: 

----------

## dsd

gentoo-sources-2.6.18-r1 should support this hardware through the r8169 module

----------

## roderick

 *dsd wrote:*   

> gentoo-sources-2.6.18-r1 should support this hardware through the r8169 module

 

Is there any live CD/DVD that supports the r8168 out of the box? If not, what is the best approach to install?

----------

## eigenVector

 *roderick wrote:*   

>  *dsd wrote:*   gentoo-sources-2.6.18-r1 should support this hardware through the r8169 module 
> 
> Is there any live CD/DVD that supports the r8168 out of the box? If not, what is the best approach to install?

 

*Bump*

----------

## roderick

Here's the hoakiness I had to endure to install Gentoo on my Acer 9412.

1) Obtain 3-4 liveCD/DVD distros until I got one that worked with my combination of hardware. Kubuntu was what I ended up using successfully, as it gave me net, correctly picked up my SATA hard-drive as /dev/sda drive and not an /dev/hda, and X launched perfectly.

2) From within Kubuntu, partition your hard drive as desired and format/tweak with mke2fs/tune2fs. 

3) Follow the alternative install guide from Gentoo Install Docs (the Knoppix section should be fine to follow).

What took me the longest was to realize that the Gentoo Live DVD detected my SATA hard drive under IDE. When I then installed kernel 2.6.18 (which uses newer drivers under SCSI for SATA) it would segfault. It took forever to figure out that I was using the wrong settings, and Kubuntu's older 2.6.15 kernel was patched to use the newer SCSI SATA driver settings.

Anyway, it will work fine with Kubuntu. And then ensure you get the 2.6.18 gentoo-sources and build the r8169 driver as it works with the RealTek Gig card (Kubunto still uses the r1000 module, but the newer Gentoo kernel patched the r8169 driver).

----------

## eigenVector

 *roderick wrote:*   

> Anyway, it will work fine with Kubuntu. And then ensure you get the 2.6.18 gentoo-sources and build the r8169 driver as it works with the RealTek Gig card (Kubunto still uses the r1000 module, but the newer Gentoo kernel patched the r8169 driver).

 

Forgive me if I sound uber noob, but this is my second linux distribution.  I started diving into linux with ubuntu a few months back and I'm really eager to get gentoo up and running.

Here's what I've done so far...

Booting from a ubuntu live cd switch over to the command line (gave me a working internet)...

set up my hard drive for partitioning...

compiled the kernel (using 2.6.18-r1 was a real pain since I never knew how masked packages worked, but nevertheless its built)

setup user accounts

restarted, booted into 2.6.18-gentoo-r1 command line successfully (no x or gui installed at this point)

I try to modprobe r8169 but it doesn't exist in /lib/modules/2.6...gentoo-r1/kernel/drivers/net

I do see a r8169.c in /usr/src/linux-2.6...gentoo-r1/drivers/net

how can I get this built so that I can modprobe r8169

Once again, sorry for sounding so nub... just really trying to learn more about this linux world...

----------

## roderick

 *eigenVector wrote:*   

>  *roderick wrote:*   Anyway, it will work fine with Kubuntu. And then ensure you get the 2.6.18 gentoo-sources and build the r8169 driver as it works with the RealTek Gig card (Kubunto still uses the r1000 module, but the newer Gentoo kernel patched the r8169 driver). 
> 
> Forgive me if I sound uber noob, but this is my second linux distribution.  I started diving into linux with ubuntu a few months back and I'm really eager to get gentoo up and running.
> 
> Here's what I've done so far...
> ...

 

Make sure your /usr/src/linux/.config has the following line:

CONFIG_R8169=m

Then, do:  make && make modules_install

Then you can modprobe it.

----------

## eigenVector

 *roderick wrote:*   

> Make sure your /usr/src/linux/.config has the following line:
> 
> CONFIG_R8169=m
> 
> Then, do:  make && make modules_install
> ...

 

This worked... thanks roderick!

----------

## roderick

 *eigenVector wrote:*   

>  *roderick wrote:*   Make sure your /usr/src/linux/.config has the following line:
> 
> CONFIG_R8169=m
> 
> Then, do:  make && make modules_install
> ...

 

Glad to be of assistance.

----------

