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
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