Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Realtek 8168 does not compile with kernel 2.6.17
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Mon Jul 10, 2006 10:38 pm    Post subject: [Solved] Realtek 8168 does not compile with kernel 2.6.17 Reply with quote

I've been using the drivers from the realtek website [url]http://www.realtek.com.tw/downloads/downloads1-3.aspx?keyword=8168#2004111Unix%20(Linux)[/url] (the r8169 won't work for me) with the 2.6.16-r12 gentoo-sources.
Recently I compiled gentoo-sources-2.6.17-r2, now I'm getting the following error:
Quote:
/mnt/stick/r1000/src/r1000_n.c:46: error: syntax error before string constant
/mnt/stick/r1000/src/r1000_n.c:46: warning: type defaults to `int' in declaration of `MODULE_PARM'
/mnt/stick/r1000/src/r1000_n.c:46: warning: function declaration isn't a prototype
/mnt/stick/r1000/src/r1000_n.c:46: warning: data definition has no type or storage class
make[3]: *** [/mnt/stick/r1000/src/r1000_n.o] Error 1
make[2]: *** [_module_/mnt/stick/r1000/src] Error 2
make[1]: *** [modules] Error 2
make: *** [modules] Error 2


here's what that file looks like around line 46:
Quote:
43 MODULE_DEVICE_TABLE (pci, r1000_pci_tbl);
44 MODULE_AUTHOR ("Realtek");
45 MODULE_DESCRIPTION ("Linux device driver for Realtek Ethernet Controllers");
46 MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");
47 MODULE_LICENSE("GPL");



I don't really have any idea what this means, so I'd be very happy if somebody could have a look at it.

P.S.: someone has already asked for an ebuild here: https://bugs.gentoo.org/show_bug.cgi?id=129216


Last edited by kwisatz_haderais on Tue Jul 18, 2006 9:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Tue Jul 11, 2006 2:32 pm    Post subject: Reply with quote

This isn't going to help very much but the way of describing the module parameters has changed with 2.6.17. This article http://lwn.net/Articles/107303/ from October 2004 says that a patch was posted marking it obsolete.

RealTek is not the only late one, though: http://www.handhelds.org/hypermail/oe-commits/61/6183.html
Quote:
From: rwhitby commit <oe-commits_at_handhelds.org>
Date: Tue, 20 Jun 2006 07:20:47 +0200 (CEST)

ixp4xx, ixp425-eth: Updated for 2.6.17 kernel (MODULE_PARM now removed)


r1000_n.c (aka RTL6168B) has
Code:
MODULE_AUTHOR ("Realtek");
MODULE_DESCRIPTION ("Linux device driver for Realtek Ethernet Controllers");
MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i");

and r8169.c from 2.6.17-gentoo-r2/drivers/net has
Code:
MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>")
MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
module_param_array(media, int, &num_media, 0);
MODULE_PARM_DESC(media, "force phy operation. Deprecated by ethtool (8).");
module_param(rx_copybreak, int, 0);
MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
module_param(use_dac, int, 0);
MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
module_param_named(debug, debug.msg_enable, int, 0);
MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");

There doesn't seem to be enough information (for me at least) to see how to change r1000 so it means waiting on RealTek.
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 11, 2006 5:52 pm    Post subject: Reply with quote

I'd help me if I were into kernel hacking ;)
I appreciate your help though!

I submitted an ebuild for the driver... (not a very good one though)
https://bugs.gentoo.org/show_bug.cgi?id=129216
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Mon Jul 17, 2006 7:54 pm    Post subject: Reply with quote

http://www.mail-archive.com/netdev@vger.kernel.org/msg13809.html

does this mean, support should have been merged into the kernel driver or not? I don't quite get it.
Nevertheless, the r8169 (still) doesn't work for me, so I guess no.
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Tue Jul 18, 2006 3:04 pm    Post subject: Reply with quote

Quote:
http://www.mail-archive.com/netdev@vger.kernel.org/msg13809.html
does this mean, support should have been merged into the kernel driver or not?

From the message pointed at by the URL above
Quote:
add several PCI ID for the PCI-E adapters
From what I could see, the r1000 is a PCI-E version of the r8169 so it may be in a kernel. However, the kernel being talked about is (presumably) now available as 2.6.17-gentoo-r{1,2,3} but drivers/net/r8169.c shows no sign of it. The pci_device_id table (which is one of the things patched) is
Code:
static struct pci_device_id rtl8169_pci_tbl[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8169), },
        { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4300), },
        { PCI_DEVICE(0x16ec,                    0x0116), },
        { PCI_VENDOR_ID_LINKSYS,                0x1032, PCI_ANY_ID, 0x0024, },
        {0,},
};
but, in the patch submitted, it should be
Code:
 static struct pci_device_id rtl8169_pci_tbl[] = {
       { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8136), 0, 0, 2 },
       { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8167), 0, 0, 2 },
       { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8168), 0, 0, 2 },
       { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8169), 0, 0, 1 },
       { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4300), 0, 0, 1 },
       { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, 1 },
       { PCI_VENDOR_ID_LINKSYS,                0x1032,
               PCI_ANY_ID, 0x0024, 0, 0, 1 },
        {0,},
 };
I believe we can safely conclude that the patch is not in the current 2.6.17-gentoo-r3.

Of course, you can always apply the patch yourself :D
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 18, 2006 3:09 pm    Post subject: Reply with quote

wynn wrote:
Of course, you can always apply the patch yourself :D

I was thinking of that. Guess I'll give it a try when I'm at home later.

Thanks again for your advice.
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Tue Jul 18, 2006 4:21 pm    Post subject: Reply with quote

Quote:
Of course, you can always apply the patch yourself
Sorry to spoil your surprise: linux-2.6.17-gentoo-r3/drivers/net/r8169.c patched using the copies from http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.17-rc6/r8169
The files are
Code:
0001-r8169-mac-address-change-support.txt
0002-r8169-RX-fifo-overflow-recovery.txt
0003-r8169-hardware-flow-control.txt
0004-r8169-remove-rtl8169_init_board.txt
0005-r8169-sync-with-vendor-s-driver.txt
He says that 0001- is only for review, I was going to omit it but didn't realize it was the first. Kernel recompiled and installed and now running: there's only an r8169 here so it's not a proper test.

The email you quoted said they were patches against 2.6.17-rc6 — after a time I realized that this meant they would not be in 2.6.17 but in 2.6.18. If you download patch-2.6.18-rc2.bz2 from kernel.org, you will find the patch included but it is missing the "mac address change support" patch I think.
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 18, 2006 4:58 pm    Post subject: Reply with quote

wynn wrote:
The email you quoted said they were patches against 2.6.17-rc6 — after a time I realized that this meant they would not be in 2.6.17 but in 2.6.18. If you download patch-2.6.18-rc2.bz2 from kernel.org, you will find the patch included but it is missing the "mac address change support" patch I think.


Oh well, I thought release candidates were pre-stable versions...
Actually, you didnt't really spoil my surprise with your 8169 ;)

Getting it to work would be the last step for my MSI S262 to be supported completely...
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 18, 2006 5:01 pm    Post subject: Reply with quote

ok... this made me utterly curious, guess I'll be driving home now ;)
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 18, 2006 7:40 pm    Post subject: Reply with quote

argh, damn it!
The driver loads, even recognizes my link status (up/down) but I can't get a dhcp lease. (which was no a problem at all using the r1000 and 2.6.16) :(

I sent an email to francois romieu
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Tue Jul 18, 2006 9:07 pm    Post subject: Reply with quote

francois romieu wrote:
How does the patched driver behave if you replace NET_IP_ALIGN by the
value "8" in drivers/net/r8169.c ?


nice! ;)
Back to top
View user's profile Send private message
juangamnik
n00b
n00b


Joined: 10 May 2005
Posts: 17

PostPosted: Sun Jul 30, 2006 11:17 pm    Post subject: Reply with quote

kwisatz_haderais wrote:
Getting it to work would be the last step for my MSI S262 to be supported completely...


I have the MSI S262, too. Could you tell me how you solved your problems?

Does that mean ACPI and suspending resuming works for you? For me it does shutdown CPU1 but not CPU0 sometimes and the system does not shut down. Even a halt doesn't work then anymore. Some times (not very frequently) it shuts down, returns but can't load X screen anymore, it remains black. Switching of dri in xorg.conf reduces the error frequency two every 5 or 6 times of suspending (I'm using suspend2-2.6.17).

Will the 8169 module support the r1000 or r8168 (lspci) with the 2.6.18? What did you do about the Graphics module and the Wireless lan module. For the wireless lan I use the ipw3945 ebuild and it doesn't seem to be supported in 2.6.17 even though in http://www.michael-prokop.at/blog/ it is mentioned that the 2.6.17 kernel has support for ipw3945 with the ebuild ipw3945-ucode...

For my suspend problem there are more infos here: https://forums.gentoo.org/viewtopic-t-482112-highlight-suspend2.html
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Mon Jul 31, 2006 10:05 pm    Post subject: Reply with quote

juangamnik wrote:

Does that mean ACPI and suspending resuming works for you?


Well, I don't use supend @ all, I've never even tried to, so I cannot help you there, sorry.

juangamnik wrote:
Will the 8169 module support the r1000 or r8168 (lspci) with the 2.6.18?


Most probably, yes. You may want to patch your 2.6.17 kernel with the patches mentioned above, it works like a charm.

juangamnik wrote:
What did you do about the Graphics module and the Wireless lan module. For the wireless lan I use the ipw3945 ebuild and it doesn't seem to be supported in 2.6.17 even though in http://www.michael-prokop.at/blog/ it is mentioned that the 2.6.17 kernel has support for ipw3945 with the ebuild ipw3945-ucode...


my ipw3945 works like a charm as well. Have you made sure your wlan switch is turned on? (press once)
What's the matter with the graphics module? The driver supplied by xorg-x11 - using the ~x86 xorg-server - works for me.
Back to top
View user's profile Send private message
juangamnik
n00b
n00b


Joined: 10 May 2005
Posts: 17

PostPosted: Tue Aug 01, 2006 9:27 pm    Post subject: Reply with quote

Quote:
my ipw3945 works like a charm as well.

Mine, too. But I use the ipw3945 ebuild which has to be reemerged after every kernel-compile. So I was curious if it is supported by the kernel,yet?!?

Quote:
Most probably, yes. You may want to patch your 2.6.17 kernel with the patches mentioned above, it works like a charm.

Could you give me a little advice how (code/shell snipplet)? There was something with changing a littlebit in 8169.ko afterwards... (you wrote something about a mail...)

I had another workaround. I commented out the moduleparameter but then I get a bug in my dmesg, but it works at all.

Quote:
Well, I don't use supend @ all, I've never even tried to, so I cannot help you there, sorry.


You don't use suspend modes at all or not suspend2? If you got it working another way, please tell me.

Another question: Do you know how to catch and handle acpi events?
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Thu Aug 03, 2006 3:34 pm    Post subject: Reply with quote

juangamnik wrote:
Mine, too. But I use the ipw3945 ebuild which has to be reemerged after every kernel-compile. So I was curious if it is supported by the kernel,yet?!?

Don't think so, that's the bcm43xx driver you're thinking of, I guess.

juangamnik wrote:
You don't use suspend modes at all or not suspend2? If you got it working another way, please tell me.

Not at all :) Do I need that? Or rather: Is it really useful?

juangamnik wrote:
Another question: Do you know how to catch and handle acpi events?

Nope, sorry
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Sat Aug 05, 2006 8:05 am    Post subject: Reply with quote

I guess you already had a look @ this article: http://www.gentoo.org/doc/en/power-management-guide.xml ?

Concerning Suspend2, can you explain in your own words what the advantages of using supend over simply shutting down the machine are?
Maybe I'd like to use it, I've only never considered it until now.
Back to top
View user's profile Send private message
TheS4int
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2005
Posts: 79

PostPosted: Sat Aug 12, 2006 2:12 pm    Post subject: Reply with quote

how can i apply the patches, and where are the patches?
iam using 2.6.17-r4, can i apply the patches anyway?

at this address are only txt files http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.17-rc6/r8169
how can i use this, if thats relevant for me.
_________________
Gigabyte GA 965P-DS3 --- C2D E6400 --- 2048MB G.Skill RAM --- 250GB SAMSUNG SATA HDD on ICH8 --- LG DVD/RW on JMicron (at the time not functional :( )
Back to top
View user's profile Send private message
kwisatz_haderais
Tux's lil' helper
Tux's lil' helper


Joined: 28 Sep 2004
Posts: 143

PostPosted: Sat Aug 12, 2006 11:22 pm    Post subject: Reply with quote

those "txt" files are the patches
Code:
man patch

see also: https://forums.gentoo.org/viewtopic-t-486635-highlight-r8169.html
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Sat Sep 09, 2006 9:27 am    Post subject: Reply with quote

It seems that the r8169 patch (adding support for RTL 8168/8111) is in mm-tree:

http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc6/2.6.18-rc6-mm1/announce.txt
http://www.kernel.org/diff/diffview.cgi?file=%2Fpub%2Flinux%2Fkernel%2Fpeople%2Fakpm%2Fpatches%2F2.6%2F2.6.18-rc6%2F2.6.18-rc6-mm1%2F2.6.18-rc6-mm1.bz2;z=1693

Don't know if it'll be in 2.6.18, but let's hope so. (I also might need the support in the near future...)
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Sep 26, 2006 12:55 pm    Post subject: actual status Reply with quote

If someone is still interested in the built-in support for 8168 chips, and its actual status, have a look at this bug.
cheers sebastian
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Fri Sep 29, 2006 8:45 am    Post subject: Reply with quote

It also seems that the support will go into the next stable release: 2.6.18.1.
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Sun Oct 01, 2006 11:38 pm    Post subject: Reply with quote

yes, that's the reason why i wrote the previous post.

(Quote from the link in my previous post)
Quote:
This will be fixed as of gentoo-sources-2.6.18-r1

_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum