Inject code where in device driver for checking on receive packets?



Hello,

I am trying to write some code to count the number of packets received
by an Intel Gigabit NIC. I just want to add a couple of lines in
/usr/src/linux/drivers/net/e1000/e1000_main.c.

I checked the code and I cannot understand where it is to be added. The
most logical place seems to be the e1000_intr() function since that is
where the interrupt handler is. But the interrupt can be generated for
several reasons. So exactly where?

My best guess is it's right inside this code. Am I correct?

if
(likely(netif_rx_schedule_prep(&adapter->polling_netdev[0])))
__netif_rx_schedule(&adapter->polling_netdev[0]);

Any other pointers will also be appreciated.

Thanks.
Azeem.

.