Realtek 8168

From LinuxMCE
Revision as of 14:22, 1 October 2008 by Gilles.cresci (Talk | contribs)

Jump to: navigation, search


The Realtek RTL8168 network card on LinuxMCE

This card is supposed to work with the r8169 module, but this seems to fail for newer cards. Realtek provides the source code for a r8168 module on their site.

What you need to do

  • Download the driver from Realtek (at the time of this article, the version is 8.008.00, released 2008/7/24) to compile the r8168 module
  • Install the linux-source package, to hack into the r8169 module.

The default r8169 module and Realtek's r8168 overlap on a PCI ID, and that's why you need the kernel source. You'll compile the r8169 without the PCI ID that r8168 will associate with.

>>TODO: Insert section of required packages for the build to work

Compiling Realtek's r8168 module

  • Download the Realtek driver: you'll get a file called r8168-8.008.00.tar.bz2
  • unpack the file: tar -jxf r8168-8.008.00.tar.bz2
  • switch into the directory that is created: cd r8168-8.008.00
  • build the module: make
  • copy the module to the running kernel: cp src/r8168.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/

Hacking the r8169 module

  • Install the kernel source: apt-get install linux-source
  • Un pack the kernel source: cd /usr/src; tar -jxf linux-source-2.6.22.tar.bz2
  • Switch to the kernel directory: cd linux-source-2.6.22
  • Copy the running kernel's configuration: cp /boot/config-2.6.22-14-generic .config
  • Prepare the kernel so you can build modules: make scripts prepare
  • Apply this patch:

(patch < r8168.diff)


--- drivers/net/r8169.c.orig	2008-09-05 17:07:29.000000000 +0300
+++ drivers/net/r8169.c	2008-09-04 23:49:51.000000000 +0300
@@ -162,7 +162,7 @@
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8129), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8136), 0, 0, RTL_CFG_2 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8167), 0, 0, RTL_CFG_0 },
-	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8168), 0, 0, RTL_CFG_1 },
+	//{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8168), 0, 0, RTL_CFG_1 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK,	0x8169), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4300), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(0x1259,			0xc107), 0, 0, RTL_CFG_0 },
  • Build the network modules: make M=`pwd`/drivers/net modules
  • Confirm that the new r8169 module doesn't have the "pci:v000010ECd00008168sv" alias: modinfo drivers/net/r8169.ko
  • Copy the new r8169.ko to the running kernel: cp drivers/net/r8169.ko /lib/modules/2.6.22-14-generic/kernel/drivers/net/
  • Run depmod
  • Load the module: modprobe r8168

MDs

After you created the modules as described above:

  • Copy the modules to all the affected MD filesystems, in the corresponding location
  • Follow the instructions on the Unrecognized NIC page