# HG changeset patch # User Florian Pose # Date 1190025016 0 # Node ID fc533d28c6f8c2575936980a6081f10858198c46 # Parent 5e230b4fe1a04e1b682451653050f95be2501cc8 Fixed e1000 driver when NAPI is enabled. diff -r 5e230b4fe1a0 -r fc533d28c6f8 devices/e1000/e1000_main-2.6.13-ethercat.c --- a/devices/e1000/e1000_main-2.6.13-ethercat.c Mon Sep 17 10:24:30 2007 +0000 +++ b/devices/e1000/e1000_main-2.6.13-ethercat.c Mon Sep 17 10:30:16 2007 +0000 @@ -2667,8 +2667,9 @@ struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; uint32_t icr = E1000_READ_REG(hw, ICR); -#ifndef CONFIG_E1000_NAPI unsigned int i; +#ifdef CONFIG_E1000_NAPI + int work_done = 0; #endif if(unlikely(!icr)) @@ -2681,15 +2682,22 @@ } #ifdef CONFIG_E1000_NAPI - if(!adapter->ecdev && likely(netif_rx_schedule_prep(netdev))) { - - /* Disable interrupts and register for poll. The flush - of the posted write is intentionally left out. - */ - - atomic_inc(&adapter->irq_sem); - E1000_WRITE_REG(hw, IMC, ~0); - __netif_rx_schedule(netdev); + if (adapter->ecdev) { + for(i = 0; i < E1000_MAX_INTR; i++) + if(unlikely(!adapter->clean_rx(adapter, &work_done, 100) & + !e1000_clean_tx_irq(adapter))) + break; + } else { + if(likely(netif_rx_schedule_prep(netdev))) { + + /* Disable interrupts and register for poll. The flush + of the posted write is intentionally left out. + */ + + atomic_inc(&adapter->irq_sem); + E1000_WRITE_REG(hw, IMC, ~0); + __netif_rx_schedule(netdev); + } } #else /* Writing IMC and IMS is needed for 82547.