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