diff -r 07fd94c5119d -r 72e7507b3f1b devices/e1000/e1000_main-2.6.13-ethercat.c --- a/devices/e1000/e1000_main-2.6.13-ethercat.c Thu Sep 13 11:08:46 2007 +0000 +++ b/devices/e1000/e1000_main-2.6.13-ethercat.c Wed Oct 03 08:58:01 2007 +0000 @@ -164,8 +164,8 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); static void e1000_restore_vlan(struct e1000_adapter *adapter); +#ifdef CONFIG_PM static int e1000_suspend(struct pci_dev *pdev, uint32_t state); -#ifdef CONFIG_PM static int e1000_resume(struct pci_dev *pdev); #endif @@ -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. @@ -3760,6 +3768,7 @@ return 0; } +#ifdef CONFIG_PM static int e1000_suspend(struct pci_dev *pdev, uint32_t state) { @@ -3853,7 +3862,6 @@ return 0; } -#ifdef CONFIG_PM static int e1000_resume(struct pci_dev *pdev) {