Skip to contentSkip to conversation

How come realtek drivers are combined

DISCUSSION Mario Limonciello 2 participants 5 messages Jun 26, 2008 – Jul 1, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi:

I'm new to the list but didn't immediately see an answer to this in quick searches.

Realtek provides several (separated) drivers for their different chipsets, r8169, r8168, r8101, etc. I see that they are regularly all merged into the r8169 driver in the kernel. How come it works this way? Is it just because no one ever bothered to do it differently? Obviously, they all share a very similar code base so its somewhat sensible to try to produce a single driver. I would think it would work a lot better for everyone if Realtek and the kernel maintainers that work on the Realtek driver were directly in sync rather than having to play tag pulling patches from each other's drivers.

Thanks,

Signature · 3 lines
Mario Limonciello
*Dell | Linux Engineering*
[email protected]
#1 lore raw

Mario Limonciello <[email protected]> :
[...]

Quoted 4 lines

Realtek provides several (separated) drivers for their different chipsets, r8169, r8168, r8101, etc. I see that they are regularly all merged into the r8169 driver in the kernel. How come it works this way ?

I made it this way.

Quoted 1 line

Is it just because no one ever bothered to do it differently ?

It was suggested before but it was not strongly argumented and I have a strong bias against it as long as it is not clearly needed.

Quoted 2 lines

Obviously, they all share a very similar code base so its somewhat sensible to try to produce a single driver.

It was.

I'll probably end splitting things between the old pci-only 8169 and the newest pci-e though.

Quoted 4 lines

I would think it would work a lot better for everyone if Realtek and the kernel maintainers that work on the Realtek driver were directly in sync rather than having to play tag pulling patches from each other's drivers.

Given that the choice of operating systems for laptops on Dell's online shop does not include my favorite OS, "everyone" seems a bit of an overstatement to me (sorry, could not resist :o) ).

Compare two versions of the same driver from Realtek and you should realize that you are addressing a false problem.

Signature · 1 line
Ueimor
#2 lore raw

Francois:

Quoted 2 lines · Francois Romieu

I made it this way.

Ah.

Quoted 4 lines

Given that the choice of operating systems for laptops on Dell's online shop does not include my favorite OS, "everyone" seems a bit of an overstatement to me (sorry, could not resist :o) ).

You go and offer Redhat on business portables, and they want Ubuntu. You offer Ubuntu on consumer portables and then they want $(INSERT DISTRO HERE) :)
Offering this to every consumer as an option with every laptop though, that will take some time. For now, the consumers that want it can go to
http://www.dell.com/linux

Quoted 3 lines

Compare two versions of the same driver from Realtek and you should realize that you are addressing a false problem.

This is sometimes a bit difficult to do since I didn't see historical versioning on their website. It was a hunch, however.

Now I did see a fair deal of patches floating in from you, so I'll clone your netdev git tree and give this a run on some of the RTL8101's that are having trouble.

Thanks for the thorough explanation,

Signature · 3 lines
Mario Limonciello
*Dell | Linux Engineering*
[email protected]
#3 lore raw

Mario Limonciello <[email protected]> :
[...]

Quoted 2 lines

This is sometimes a bit difficult to do since I didn't see historical versioning on their website. It was a hunch, however.

ee ftp://210.51.181.211/cn/nic/ for the previous versions. It is rather coarse though.

Quoted 3 lines

Now I did see a fair deal of patches floating in from you, so I'll clone your netdev git tree and give this a run on some of the RTL8101's that are having trouble.

Don't expect miracle: the 8101/8102 part is not floating yet.

Signature · 1 line
Ueimor
#4 lore raw

Francois Romieu <[email protected]> :

Quoted 1 line

Mario Limonciello <[email protected]> :

[...]

Quoted 5 lines
Quoted 3 lines

Now I did see a fair deal of patches floating in from you, so I'll clone your netdev git tree and give this a run on some of the RTL8101's that are having trouble.

Don't expect miracle: the 8101/8102 part is not floating yet.

That being said, you can give a try to the version of the day at
http://userweb.kernel.org/~romieu/r8169/2.6.26-rc6/ and apply the patch below to it:

drivers/net/r8169.c +7 -2
index 8d18bb6..860a472 100644
@@ -2547,8 +2547,13 @@ static void rtl_hw_start_8101(struct net_device *dev)
 
 	if ((tp->mac_version == RTL_GIGA_MAC_VER_13) ||
 	    (tp->mac_version == RTL_GIGA_MAC_VER_16)) {
-		pci_write_config_word(pdev, 0x68, 0x00);
-		pci_write_config_word(pdev, 0x69, 0x08);
+		int cap;
+
+		cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+		if (cap != 0) {
+			pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL,
+					      PCI_EXP_DEVCTL_NOSNOOP_EN);
+		}
 	}
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
Signature · 1 line
Ueimor