LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   NIC interrupt capture (https://www.linuxquestions.org/questions/linux-kernel-70/nic-interrupt-capture-754418/)

vks_foe 09-11-2009 08:58 AM

NIC interrupt capture
 
Hi,
After the NIC copies the incoming data into memory, it updates the status field in the NIC descriptor and generates an interrupt for software processing. Can someone tell me how to catch this interrupt?

Mara 09-12-2009 01:47 PM

Typically NIC drivers do it and you can check the method (and the desired actions to be performed) in NIC driver code. Is it a known NIC or you're developing a driver?

vks_foe 09-13-2009 01:03 AM

Thanx for ur reply....i was trying with my own nic (realtek). Its driver file was r8169..
By the way i'm not developing any driver.. :)

Finally what was required was .. modification of the proper function in the driver source code... and its recompilation and insertion in place of pre-existing driver.

praveen24 09-15-2009 05:24 AM

Interrupt Catching
 
In the network driver responsible for interacting with your NIC registers,You will find a interrupt handler that is registered with the kernel.

request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *dev_name,
void *dev_id)


irq--->interrupt no.
irqreturn_t (*handler)(int, void *, struct pt_regs *)--->Handler routine
unsigned long flags-->flags saying whether it is shared or fast or something more,etc.
const char *dev_name-->owner of interrupts(Entry in /proc/interrupts)

void *dev_id--> If interrupts are shared then it matters.

So the main thing is that once you registered a handler in your driver code this handler will be invoked by the kernel when it receives the interrupt on that no. For better understanding google


All times are GMT -5. The time now is 11:42 AM.