Welcome! Log In Create A New Profile

Advanced

Problem with my own interrupt handler on PCI ethernet device which is never called

Posted by stase 
Hi kernelnewbies community,


I am working about a network driver so as to get all packets which are reveived by a network interface like PCI NIC.
For achieving that, first I thougth to develop a network device named by example ex%d. Into the associated open callback, I put the following code to register an interrupt handler on PCI NIC:
ret = request_irq(net_dev->irq, irq_rx_handler_exemple, IRQF_SHARED, THIS_MODULE->name, net_dev); // net_dev->irq = 220
if (ret < 0) 
{
	printk(KERN_WARNING "irq: unable to register irq %d\n", net_dev->irq);
}
...
netif_start_queue(net_dev);
where 220 is the interrupt number.

I noticed that is is necessary to disable eth0 (i.e. ifconfig eth0 down) for adding my own interrupt handler. Is it a normal behaviour?

Once request_irq successed, I can see my module well-associated with the interrupt number 220 into interrupts file and with the ifconfig command:
Quote
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1f:d0:16:20:21
inet adr:192.168.0.100 Bcast:192.168.0.255 Masque:255.255.255.0
adr inet6: fe80::21f:d0ff:eb15:1578/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:27591 erreurs:0 :0 overruns:0 frame:0
TX packets:31093 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:16898788 (16.1 Mcool smiley Octets transmis:6883363 (6.5 Mcool smiley
Interruption:220 Adresse de base:0x8000

ex0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST NOARP MULTICAST MTU:1500 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:0 (0.0 cool smiley Octets transmis:0 (0.0 cool smiley
Interruption:220 Adresse de base:0xd000
But unfortunately, my own interrupt handler is never called. Do you know what I have to do or to test?
Maybe is it necessary to initalize some fields or others from the PCI device APIs?

If you need more information, ask me.
Thanks for your help.

;-)
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 14 plus 12?
Message: