[SLE] how to build your own NIC driver module?
I need a bit help here.... It's nothing SuSE specific but it might also be helpful for others? I try to learn more about the driver structure under Linux. I am using an Accton Cheetah PC 10/100 network card in a SuSE 6.1 box, Kernel 2.2.5 (one of the servers), here with a Realtek RTL8129/8139 driver at the moment. This was working fine for weeks now but 2 days ago the PC lost his network connection while I copied a 12MB file from the server to another PC (via Samba). I have never had a problem before, even when I did my own performance testing by uploading a 50MB file from a workstation to that server various times and also uploading the same file to the Win NT server for comparisons. The change which I made in between was the replacement of the 10Mb hub by a 10/100MB hub (which btw. makes the expected, significant difference when I upload the 50MB file to the SuSE box now). Ok, to cut the story: I downloaded a Linux driver from Accton's site for that card which was written for RH, kernel 2.0.36 as they state. The zipped file contains a module 'en1207d.o' and the source (?) 'en1207d.c' (I am unsure whether that's all for a driver's source needed? Do other drivers also have an additional .h source file?). I wanted to load the module with insmod but it told me that it was written for 2.0.36! Now I would like to try to build a module for the existing 2.2.5 kernel. The questions: Where do I have to put the .c file? I hope when it sits in the proper directory, I can create the module with a kernel compile + make modules + make modules_install? If it works that way, what will I have to do, to list that driver also in the selection list with the other available drivers under Yast? Am I on the right track here or will that never work? Regards, Michael Doerner -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Hi, On Sun, 29 Aug 1999, Michael Doerner wrote: <SNIP>
Ok, to cut the story: I downloaded a Linux driver from Accton's site for that card which was written for RH, kernel 2.0.36 as they state. The zipped file contains a module 'en1207d.o' and the source (?) 'en1207d.c' (I am unsure whether that's all for a driver's source needed? Do other drivers also have an additional .h source file?).
I wanted to load the module with insmod but it told me that it was written for 2.0.36! Now I would like to try to build a module for the existing 2.2.5 kernel. The questions:
Where do I have to put the .c file? I hope when it sits in the proper directory, I can create the module with a kernel compile + make modules + make modules_install? If it works that way, what will I have to do, to list that driver also in the selection list with the other available drivers under Yast?
Am I on the right track here or will that never work?
I doubt that this driver will compile with the 2.2.x kernel. There were quite a few changes in the data structures. Apart from that, I have no idea how to integrate a new driver in the kernel source tree. Sorry! Bye, LenZ -- ------------------------------------------------------------------ Lenz Grimmer SuSE GmbH mailto:grimmer@suse.de Schanzaeckerstr. 10 http://www.suse.de/~grimmer 90443 Nuernberg, Germany -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
On 29 Aug 1999, Lenz Grimmer wrote: lg> Hi, lg> lg> On Sun, 29 Aug 1999, Michael Doerner wrote: lg> lg> <SNIP> lg> lg> > Ok, to cut the story: I downloaded a Linux driver from Accton's site lg> > for that card which was written for RH, kernel 2.0.36 as they state. lg> > The zipped file contains a module 'en1207d.o' and the source (?) lg> > 'en1207d.c' (I am unsure whether that's all for a driver's source lg> > needed? Do other drivers also have an additional .h source file?). Programmers typically (not all mind you) will use a .h file (header file) so that they can keep the header information from cluttering the actual code. If the code is fairly small, then they can group the header information within the code it self. You can do a quick grep of the .c file to see if it calls the .h file, or open and scan it visually, you will see something along the following, #include "en1207d.h" usually toward the top of the file. lg> > lg> > I wanted to load the module with insmod but it told me that it was lg> > written for 2.0.36! Now I would like to try to build a module for the lg> > existing 2.2.5 kernel. The questions: lg> > lg> > Where do I have to put the .c file? I hope when it sits in the proper lg> > directory, I can create the module with a kernel compile + make lg> > modules + make modules_install? If it works that way, what will I have lg> > to do, to list that driver also in the selection list with the other lg> > available drivers under Yast? Your best bet is to look at the source of the kernel, see how its calling a similar module during make and add any appropriate lines so that it will call the file you have when its needed. If you have never done something like this, then I hope you have plenty of time :) (see below notes about it working though) lg> > lg> > Am I on the right track here or will that never work? lg> lg> I doubt that this driver will compile with the 2.2.x kernel. There were lg> quite a few changes in the data structures. Apart from that, I have no lg> idea how to integrate a new driver in the kernel source tree. Sorry! I doubt it will compile either, many things have changed in the 2.2.x kernels compared to the 2.0.x your best bet would be to ask in the kernel mailing list and see what pops up. I must warn you though, I get roughly 250+ messages a day in that list (thank god for procmail and digests) On a different note, anyone else get a vacation notice from someone at getlife being gone from 8/30 till 9/09, not sure if it was on this list or one of my others. I guess a quick filter can fix it though :) -- S.Toms - tomas@primenet.com - http://www.primenet.com/~tomas S.u.S.E. Linux v6.1+ - Kernel 2.2.11 You can learn many things from children. How much patience you have, for instance. -- Franklin P. Jones -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Many thanks for all help regarding my idea to build a new NIC driver module. That's definitely something where I want to look into but I will have to do that at another time. For the moment I swapped the NIC with an Intel and that seems to be working fine. Michael P.S.: I am just running SuSE 6.2 upgrade on my test system.... 6.2 finally also arrived in New Zealand where SuSE is still a minority (...RH...). I am waiting for SuSE shares. -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Lenx, I know I'm being lazy asking this rather than digging around and finding the answer myself, but I am lazy, so... How recent or up to date is the knfs code that is released with the SuSE distribution? I am running 6.2, and I'm curious about whether I really need to download all the most recent patches, or if they're already included in the SuSE distribution? - Herman Knief <HR> <UL> <LI>application/x-pkcs7-signature attachment: smime.p7s </UL> N§²æìržzǧué[h²ë)îÅ맲æìržzˬyÊ&ÚuØÚÊ&©Ý²Ç§ué[h²ë)îÅè^.±ç([(rØ^¶m§ÿðÃ.±ç(ô®Š+·ðèïÅ
participants (4)
-
grimmer@suse.de
-
herman@knief.net
-
michael.doerner@clear.net.nz
-
tomas@primenet.com