WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Tinycore and Realtek 81xx cards  (Read 3225 times)

Offline Alatun

  • Newbie
  • *
  • Posts: 41
Tinycore and Realtek 81xx cards
« on: January 24, 2017, 11:17:58 AM »
I've got a problem with the driver for Realtek NICs.

I've built a remastered version of Tinycore 6.4 that is being used to build thin clients that connect to a WINSRV using rdesktop.

The hardware involved is using a realtek 81xx onboard chip (DevID: 8168).
Initially Tinycore did not even get an IP using dhcpclient with the standard driver (r8169).

I searched the internet and there are several sites offering solutions for this (known) problem:
https://unixblogger.com/2011/10/18/the-pain-of-an-realtek-rtl8111rtl8168-ethernet-card/

The problem seems to be, that the r8169 driver in the open source tree claims to work for various device ids, but it doesn't.

As suggested I compiled my own driver using the sources from Realtek and added this driver to my modified version of Tinycore.
This worked for the machines I was using up to now.

A few days ago a tried to use this version on another machine and detected that no NIC was found (no interface configured).
This machine was using a Realtek NIC with device ID: 8167

I don't know exactly how the kernel determines which driver to use for a certain device, but my guess is that modules.alias is involved.
According the guide you should blacklist the orginial r8169 driver.

But this lead to the situation, that on the new machine NO driver was found. I took an unmodified version of Tinycore and retried
on the machine with the NIC ID8167. Now the NIC gets detected and it seems to work.

I did some greps to modules.alias

This is the output for grep r8169 for an unmodified Tinycore. (10EC seems to be RealTeks vendor id).

alias pci:v000010ECd00008169sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008167sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008136sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008129sv*sd*bc*sc*i* r8169


After compiling the driver from Realtek the relevant lines from modules.alias look like this:

alias pci:v000010ECd00008129sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008136sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008167sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008169sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8168
alias pci:v000010ECd00008161sv*sd*bc*sc*i* r8168


Now we got two entries for the same device. This seems to be reason to blacklist the r8169.

But in this state the system won't detect any NICs with device id d00008167 (in my case) any more.

What is the correct way to deal with this problem?

- manually edit modules.alias?

- can you blacklist a driver only for a specific device id?

- is there a way to prevent a driver claiming to handle a specific device id?

- any other suggestions?


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11028
Re: Tinycore and Realtek 81xx cards
« Reply #1 on: January 24, 2017, 11:51:52 AM »
Manually editing modules.alias should work, that's the "blacklist only for these ids" solution.

To stop a driver from claiming an id, you'd have to edit its source.
The only barriers that can stop you are the ones you create yourself.

Offline Alatun

  • Newbie
  • *
  • Posts: 41
Re: Tinycore and Realtek 81xx cards
« Reply #2 on: January 25, 2017, 04:52:18 AM »
I did a bit more research and found another solution.

While the guide mentioned in the blog may work to fix the problem for a single machine,  this approach is bad when trying to build a system that should work on many machines.

The open source driver handles these device ids: 8136, 8161, 8167, 8168 , 8169.

When replacing the open source driver with the vendor specific driver, you must compile three different drivers to cover all device ids of the open source driver.  Unfortunately the drivers are scattered on different pages according to link speed and bus interface.

r8101-1.030.02  dev id: 8136            (PCIe 10,100 Mbit)
r8168-8.043.02  dev id: 8161, 8168  (PCIe 10,100,1000 Mbit)
r8169-6.023.02  dev id: 8167, 8169  (PCI 10,100,1000 Mbit)

Maybe this info will help others with similar problems.
« Last Edit: January 25, 2017, 05:01:55 AM by Alatun »