Skip to contentSkip to conversation

adding new network device driver

Linux-ia64 Gururaj Ananthateerta 3 participants 4 messages Nov 10, 2001 – Nov 13, 2001

lore
Share & tools
lore
#0 lore raw

I have written a driver for a netwok deive. I want to add it in the kernel. I have compiled the code with 2.4.0 patched with the latest patch. The new kernel (my_kernel) contains my driver symbols.

When I boot with new kernel my driver probe routine is not entered. Is there anyplace I need to inform the kernel about the existence of the new driver.

THis is on ia64 on RH7.1 and whole thing is on Lion.

Thanks
Guru

#1 lore raw
Quoted 3 lines

When I boot with new kernel my driver probe routine is not entered. Is there anyplace I need to inform the kernel about the existence of the new driver.

If it's a module, you simply mark your init function with __init, like so:

int __init my_driver_init(void)

{
	...
}

And then if it can be built as a module, put
module_init(my_driver_init);

at the end. See most of the networking drivers for how they do this.

Then, at kernel build time, if your driver is built into the kernel (CONFIG_XXXX=Y), it gets its initialization routine called during the kernel startup. If it's a module, it gets called when you insmod your driver.

Of course, all of this isn't specific to IA-64, so this probably isn't the right list.

Thanks,
Matt

Signature · 6 lines
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions
www.dell.com/linux
#2 Linux Server provider with 17% in the US and 14% Worldwide (IDC)!
#3 Unix provider with 18% in the US (Dataquest)!
#2 lore raw
In reply to Gururaj Ananthateerta
Quoted 3 lines · Gururaj Ananthateerta

When I boot with new kernel my driver probe routine is not entered. Is there anyplace I need to inform the kernel about the existence of the new driver.

linux/Documentation/DocBook/kernel-hacking.tmpl, __initcall and friends.

#3 lore raw
In reply to Gururaj Ananthateerta

Updated Space.c and compiled the kernel.
The proble is called and my device is identified and configured. But there is some problem.
There are 2 ethernet devices (including mine) 1 is Intel EEpro100 and mine (gigabit controller). When the kernel boots it recognizes my NIC and EEpro100 NIC and hangs. I am unable to figure out whats going on. There is some confusions with ehto and eth1 that I am unable to follow.

Quoted 9 lines
Quoted 3 lines · Gururaj Ananthateerta

When I boot with new kernel my driver probe routine is not entered. Is there anyplace I need to inform the kernel about the existence of the new driver.

linux/Documentation/DocBook/kernel-hacking.tmpl, __initcall and friends.