Click to See Complete Forum and Search --> : Module Compiling: RTL8139.o (D-Link DFE-530+ Revision D1)


rda918
06-13-2004, 06:03 PM
Hello fellow geeks!

First let me say that I do not consider myself a newbie as I have been using Linux on my PCs for over three years. However I have very little programming/compiling background and I am confused as to how you compile modules (independently from the kernel). All the websites I have come across are very vague to the commands used and I feel like I am missing something.

I've installed Slack 9.1 w/Kernel 2.4.22 on my friends Dell SmartStep 100D. It has a D-Link DFE-530+ Rev.D1 PCI Ethernet card (which uses the RTL8139.o module) inside which I want to get fired up. I have recompiled my kernel since installation and I did not see any options for the D-Link DFE-530TX+ or the RTL8139 module while i ran xconfig or menuconfig.

Seeing as this computer is a friends, I don't have the manufacturers disk that contains the module. Luckily I have another box that is online. After Googling around I come across a few different websites:

D-Link TechSupport - DFE-530TX+ (http://support.dlink.com/products/view.asp?productid=DFE%2D530TX%2B#) -- This site has the driver RTL8139.c
D-Link TechSupport - FAQ - DFE-530TX+ (http://support.dlink.com/faq/view.asp?prod_id=488&question=DFE-530TX+) -- Compilation instructions for Redhat 6.x and 7.0
D-Link TechSupport - FAQ (http://support.dlink.com/faq/view.asp?prod_id=487) -- This website states quite specifically that the DFE-530TX+ revision D1 and D2 must have the driver compiled from the floppy. PLEASE TELL ME THIS ISNT TRUE...There must be a driver somewhere out there...
LinuxForum: Compiling Kernel Modules - Kernel Programming (http://www.linuxforum.com/linux-kernel-programming/x204.html) -- And finally this website confuses me more than anything. It is talking about creating a makefile for the module to be compiled...I thought I was suppsoed to use gcc not make?

Anyways I went ahead and did

# gcc -c -Wall -D__KERNEL__ -DMODULE RTL8139.C
RTL8139.C:1464: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1464: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1467: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1469: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1472: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1473: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C: In function `void cleanup_module()':
RTL8139.C:1637: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1639: cannot convert `device*' to `net_device*' for argument `1' to `
void unregister_netdev(net_device*)'
RTL8139.C:1641: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'


Of course, I don't know what happened. I saw an error at the top: RTL8139.C:63:2: #error You must compile this driver with "-O"

So I did

#gcc -c -O -Wall -D__KERNEL__ -DMODULE RTL8139.C
RTL8139.C:1464: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1464: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1467: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1469: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1472: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1473: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C: In function `void cleanup_module()':
RTL8139.C:1637: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1639: cannot convert `device*' to `net_device*' for argument `1' to `
void unregister_netdev(net_device*)'
RTL8139.C:1641: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'


Still the same error...
Next I issued:

#gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c RTL8139.C
`[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1464: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1467: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1469: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1472: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1473: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1481: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C: In function `void cleanup_module()':
RTL8139.C:1637: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'
RTL8139.C:1639: cannot convert `device*' to `net_device*' for argument `1' to `
void unregister_netdev(net_device*)'
RTL8139.C:1641: invalid use of undefined type `struct device'
RTL8139.C:186: forward declaration of `struct device'


Still, the same error even after pluggin in "-O" to the above formula.
If you need the whole output, just let me know, I dont want to make this post unneccessarily long. (I know, kind of late for that:p...Sorry about the extreme length of this post!)

Well...Am I actually doing this right? Am I even supposed to use gcc? Or how do I compile it using a makefile (if, that is even an option, I'm just asking this question based on the information here (http://www.linuxforum.com/linux-kernel-programming/x204.html)). And again, will I have to go hunt down the manufacturers floppy disk containing the specific driver for needed for my DFE-530TX+ Rev.D1 as mentioned here (http://support.dlink.com/faq/view.asp?prod_id=487)?

Thanks to everyone who has taken the time to read this far,
And thanks in advance to anyone who has any insight into my situation!
-rda

bwkaz
06-13-2004, 07:16 PM
First, I hope that you just misspelled the module name. It's rtl8139.o, not RTL8139.o (Linux is case sensitive). Besides, .C files are generally C++, not C. You're going to have a heck of a time getting C++ and the kernel to work correctly (the kernel is written in C because the runtime requirements are a LOT lower)... But anyway,

Originally posted by rda918
I've installed Slack 9.1 w/Kernel 2.4.22 on my friends Dell SmartStep 100D. It has a D-Link DFE-530+ Rev.D1 PCI Ethernet card (which uses the RTL8139.o module) inside which I want to get fired up. I have recompiled my kernel since installation and I did not see any options for the D-Link DFE-530TX+ or the RTL8139 module while i ran xconfig or menuconfig. I guess you missed CONFIG_NET_PCI, which enables you to select CONFIG_8139TOO and CONFIG_RTL8139 (I think that's what the latter is called; it's no longer available in 2.6 kernels, which is all I have here to look at).

You can use either of them with any RTL-8139 chipset, which your D-Link is one of.

rda918
06-13-2004, 08:16 PM
First, I hope that you just misspelled the module name. It's rtl8139.o, not RTL8139.o (Linux is case sensitive). Besides, .C files are generally C++, not C. You're going to have a heck of a time getting C++ and the kernel to work correctly (the kernel is written in C because the runtime requirements are a LOT lower)... But anyway,

Yes...this was a typo. It is really rtl8139.c

I guess you missed CONFIG_NET_PCI, which enables you to select CONFIG_8139TOO and CONFIG_RTL8139 (I think that's what the latter is called; it's no longer available in 2.6 kernels, which is all I have here to look at).

You can use either of them with any RTL-8139 chipset, which your D-Link is one of.

Thank you for this information. I also came across this (http://lists.debian.org/debian-user/2002/03/msg00151.html) website. They are saying the same thing; you can use the module 8139too.o with D-Link DFE-530TX+ D1!

Luckily, during my last compile, I compiled that network card into the Kernel as a module. I added it to /etc/rc.d/rc.modules and it seems to load it.

Here is the output of lspci:

#lspci
00:00.0 Host bridge: Intel Corp. 82810 GMCH [Graphics Memory Controller Hub] (rev 03)
00:01.0 VGA compatible controller: Intel Corp. 82810 CGC [Chipset Graphics Controller] (rev 03)
00:1e.0 PCI bridge: Intel Corp. 82801AA PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corp. 82801AA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corp. 82801AA IDE (rev 02)
00:1f.2 USB Controller: Intel Corp. 82801AA USB (rev 02)
00:1f.5 Multimedia audio controller: Intel Corp. 82801AA AC'97 Audio (rev 02)
01:08.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)
01:0a.0 Communication controller: Conexant HCF 56k Data/Fax Modem (rev 08)


And, Here is the boot time message

8139too Fast Ethernet driver 0.9.26
PCI: Found IRQ 11 for device 01:08.0
PCI: Sharing IRQ 11 with 00:01.0
eth0: D-Link DFE-538TX (RealTek RTL8139) at 0xd08ec000, 00:50:ba:54:0f:14, IRQ 11
eth0: Setting half-duplex based on auto-negotiated partner ability 0000.
dhcpcd: MAC address = 00:50:ba:54:0f:14
dhcpcd[58]: broadcasting DHCP_DISCOVER

dhcpcd[58]: timed out waiting for a valid DHCP server response


Here is the output of ifconfig eth0

# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:50:BA:54:0F:14
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:128 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:8296 (8.1 Kb) TX bytes:1180 (1.1 Kb)
Interrupt:11 Base address:0xc000


So... It seems my NIC card has been recognized as a D-Link DFE-538TX :rolleyes: I guess it doesnt matter what it says it is, as long as it works.
Which brings me to my next problem...getting DHCP working. >_<

I'm aware that this has turned into a completely different problem than the one this thread was intended for-- but anyway, a few quick questions if you dont mind...


1.) Why does it say "eth0: Setting half-duplex based on auto-negotiated partner ability 0000" and does this have anything to do with why DHCP is failing?

-I have two linux boxes plugged into the same hub. Is it possible that they are recognizing each other?

2) What files have control over DHCP settings in Slackware 9.1?

ive run netconfig -- everything seems fine
/etc/rc.d/rc.inet1.conf has "yes" under DHCP

Thank you and sorry if I am offtopic now !
-rda

bwkaz
06-13-2004, 10:10 PM
Originally posted by rda918
1.) Why does it say "eth0: Setting half-duplex based on auto-negotiated partner ability 0000" and does this have anything to do with why DHCP is failing? It means that whatever your network card is plugged into is only capable of doing half-duplex. Which tells me that either it's plugged into a hub, or it's plugged directly into either a DSL or cable modem, because switches are capable of full duplex (at least, the vast majority of modern ones are at least).

It has nothing to do with the lack of DHCP, though.

-I have two linux boxes plugged into the same hub. Is it possible that they are recognizing each other? Ah, OK, a hub. That explains the half-duplex. But I don't understand the question... ?

2) What files have control over DHCP settings in Slackware 9.1? I have no idea (don't use Slackware), but I bet that a search for "slackware dhcp" at Google will tell you very quickly...

rda918
06-14-2004, 12:01 AM
Everything was perfect
I just had to unplug my cable modem and plug it back in
I did a simple
#dhcpcd eth0
and I was able to ping yahoo.com

Thank you !!! :cool: :D

ktulu022
09-11-2006, 04:44 PM
Hello, i got the same card but i have the same problem when i compile, i put the -O parameter and its dosnt work, can you put the code with you compile and how you make work this card, i have a linux mandrake 7.0 with kernel 2.2.14-15mdk, thanks.

je_fro
09-11-2006, 04:49 PM
In a terminal try "modprobe 8139too"
see if it's built with the kernel.

cybertron
09-11-2006, 06:09 PM
i have a linux mandrake 7.0 with kernel 2.2.14-15mdk, thanks.
Good heavens man! That distro is older than half the members of this forum.:D

Seriously, if you update to a newer version things will go much more smoothly for you.

ktulu022
09-12-2006, 03:43 PM
[QUOTE]

Hello folks, thanks for the answer, i run the command like root:
modprobe 8139too
its response with this error:
Canīt locate module 8139too

Sorry but i donīt expline every thing, i have servers with 3com net card and rtl8139 net card, but how you know this cards are very old, and i need to migrate to dlink dfe530tx+ i have installed the rtl8139.o module in my kernel, i try to run the rtl8139 module in the dfe but its doesnīt work, so i try to compile the driver what is in the cdrom but i have problems, the files its with this its a dlkfet-4.39.tar.gz, when you untar this file its give me this files:

linux.txt This file.
Makefile Makefile for generating driver object file
rhine_main.c The linux core driver source code file
rhine_proc.c The source to create proc entries
rhine_wol.c The WOL supporting source file
rhine.h The extended driver header file
rhine_proc.h The header file for proc entries
rhine_wol.h The WOL supporting header file
rhine_cfg.h The general and basic info header file
kcompat.h The header file for Linux kernel version
compatibility.

so i compile in a root terminal:
make
make install

And nothing, so i run the Makefile, and nothing, and i dont know what more to do, so i found in the dlink page this, and a driver name rtl8139.c so this instructions are for red hat:

$ cd floppy
$ cp rtl8139.c /root(or any temp directory)
$ cd /root
$ gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`

I run this:
gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`

and its give errors like /directory not found, i think because for the distro its this error but i dont know what to do, i think i have to locate the file config.h one of the error says its not found, and change the location here: `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`

what you think?


[QUOTE]

xD true, but i cant update the kernel version because i dont have autorization for this, but im gone to talk with the chief to see what he think about, thanks for the comment.

cybertron
09-12-2006, 05:36 PM
Point out to him that if you're using this in any area that requires security that there are probably gaping security holes in something that old. It's certainly not being updated by Mandrake anymore, and from looking at the last time the 2.2 kernel was updated on kernel.org I would say they aren't even bothering with security updates anymore either.

bwkaz
09-12-2006, 07:23 PM
Point out to him that if you're using this in any area that requires security And at this point, insert the clause "and as long as it's connected to a network, it will require security".

Yes, I'm serious. Any kind of network hookup means the machine may be attacked by someone on that network, even if (or maybe "especially if") the people on that network are co-workers. Exceptions may be made if the network is completely trusted, and you're only putting it on that network to download patches.

ktulu022
09-13-2006, 11:40 AM
Really true, but you know how the chief are, they think the attacks inside a network cant happend, but what more can i do, i really want to do the update but they dont want, and i fight with the modules to work, so thanks for your answers.

ktulu022
09-18-2006, 03:56 PM
hellow folks, i found the 8139too.c driver and i try to compile, this i downloaded from the realtek site, and its have a readme file, this readme file says the only what a have to do its change in the Makefile the line "newpath" for the path of my kernel, so i do, but its steel with the errors i desperate with this problem so, if some one wants to give me a hand with this thanks, by the way i search in this forum and in others forums and some says this module and the rtl8139 module are not compatible with the network card what i have, the card its have a DL10030B chipset not a rtl8139 chipset how its says here, so im a little confuse with some much stuff, for example in the dlink website its the driver with name rtl8139.c whos generate a rtl8139.o module wich its suppose to work with this card, but its doesnt, because i already have this module before try to compile this one, so i try to modprobe this with the dlink card and its doesnīt work, so i really want to make this card work in my linux, so i have two choises one its compile the 8139too.c driver and the other its upgrade my kernel, the option one its the best for me, but i start to considerate the seccond, the bad of the seccond its the problem with the program i use to operate in my job, if its doesnt compatible with this program i have to work only with the kernel i have, so if some one want to help me thanks, by the way, sorry to the moderator for make this post so bored and long and for my horrible english, thanks.

je_fro
09-18-2006, 06:32 PM
ktulu022 - compiling your own kernel isn't so hard, but I'm betting with a distro so old, you'll have to stick with 2.4 kernels. And, I'll bet that you'll have to find one that's patched specifically for mandrake. Perhaps someone who learned on mandrake will come along and advise you.
As for now, I'd start looking places like http://rpmfind.net/linux/RPM/Mandrake_Linux.html
for a kernel to install, and consult the documentation on how to do that. When you find some good mandrake-specific kernel upgrade docs, post back here with a link and tell us what you're trying...
See You Soon,
je_fro

cybertron
09-19-2006, 04:08 PM
I can't say for sure because I wasn't using Linux at all when Mandrake 7.0 was out (;)) but I used to compile my own kernels under Mandrake and never had to use any special patches. There were things that didn't work, like automounting since that required a kernel patch regardless of distro, but nothing show stopping.

ktulu022
09-20-2006, 12:05 PM
Hello folks, i read the documentation in www.kernel.org, and says the patchs its only patchs, its not a full upgrade for your kernel, compiling a new kernel its the best if you want to upgrade your kernel, but if you want to patch your kernel you can, see ya. :cool:

cybertron
09-20-2006, 01:55 PM
Yeah, but that's not the kind of patches we were talking about (at least I wasn't). Those patches will patch you to the next higher kernel version, but what I was thinking of was distro-specific patches that aren't in the main kernel that they use to add new features or fix bugs.

ktulu022
09-20-2006, 04:33 PM
The patchs its only to fix bugs but its not install the new features, and the new kernels are a totally updagrade with new features and fix bugs, thats what a understand when i read the documentation.

bwkaz
09-20-2006, 06:21 PM
It depends which "patches" you're talking about.

If you're talking about the patches that turn kernel 2.6.17 into 2.6.17.18 (or any other 2.6.17.x version), you're right. There are no new features in those specific patches. That's because kernel 2.6.17.18 has no new features in it compared to the base 2.6.17 (it's a "stable" tree, which only includes bugfixes).

But the patch file that turns 2.6.17 into 2.6.18 (that is, this file (http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.18.bz2)) most certainly does have new features in it. That patch file is the total set of changes between 2.6.17 and 2.6.18, and the kernel developers have included tons of new stuff in that version bump. (For a mostly-readable list of the new features, see here (http://wiki.kernelnewbies.org/LinuxChanges).)

ktulu022
09-29-2006, 04:14 PM
ok thanks for your answers, see ya soon.