devices/e1000/e1000_main-2.6.13-ethercat.c
changeset 727 fc533d28c6f8
parent 724 f188f8a0cafd
child 1011 a0759d0dded4
equal deleted inserted replaced
726:5e230b4fe1a0 727:fc533d28c6f8
  2665 {
  2665 {
  2666 	struct net_device *netdev = data;
  2666 	struct net_device *netdev = data;
  2667 	struct e1000_adapter *adapter = netdev_priv(netdev);
  2667 	struct e1000_adapter *adapter = netdev_priv(netdev);
  2668 	struct e1000_hw *hw = &adapter->hw;
  2668 	struct e1000_hw *hw = &adapter->hw;
  2669 	uint32_t icr = E1000_READ_REG(hw, ICR);
  2669 	uint32_t icr = E1000_READ_REG(hw, ICR);
  2670 #ifndef CONFIG_E1000_NAPI
       
  2671 	unsigned int i;
  2670 	unsigned int i;
       
  2671 #ifdef CONFIG_E1000_NAPI
       
  2672 	int work_done = 0;
  2672 #endif
  2673 #endif
  2673 
  2674 
  2674 	if(unlikely(!icr))
  2675 	if(unlikely(!icr))
  2675 		return IRQ_NONE;  /* Not our interrupt */
  2676 		return IRQ_NONE;  /* Not our interrupt */
  2676 
  2677 
  2679 		if (!adapter->ecdev)
  2680 		if (!adapter->ecdev)
  2680             mod_timer(&adapter->watchdog_timer, jiffies);
  2681             mod_timer(&adapter->watchdog_timer, jiffies);
  2681 	}
  2682 	}
  2682 
  2683 
  2683 #ifdef CONFIG_E1000_NAPI
  2684 #ifdef CONFIG_E1000_NAPI
  2684 	if(!adapter->ecdev && likely(netif_rx_schedule_prep(netdev))) {
  2685 	if (adapter->ecdev) {
  2685 
  2686 		for(i = 0; i < E1000_MAX_INTR; i++)
  2686 		/* Disable interrupts and register for poll. The flush 
  2687 			if(unlikely(!adapter->clean_rx(adapter, &work_done, 100) &
  2687 		  of the posted write is intentionally left out.
  2688 						!e1000_clean_tx_irq(adapter)))
  2688 		*/
  2689 				break;
  2689 
  2690 	} else {
  2690 		atomic_inc(&adapter->irq_sem);
  2691 		if(likely(netif_rx_schedule_prep(netdev))) {
  2691 		E1000_WRITE_REG(hw, IMC, ~0);
  2692 
  2692 		__netif_rx_schedule(netdev);
  2693 			/* Disable interrupts and register for poll. The flush 
       
  2694 			   of the posted write is intentionally left out.
       
  2695 			 */
       
  2696 
       
  2697 			atomic_inc(&adapter->irq_sem);
       
  2698 			E1000_WRITE_REG(hw, IMC, ~0);
       
  2699 			__netif_rx_schedule(netdev);
       
  2700 		}
  2693 	}
  2701 	}
  2694 #else
  2702 #else
  2695 	/* Writing IMC and IMS is needed for 82547.
  2703 	/* Writing IMC and IMS is needed for 82547.
  2696 	   Due to Hub Link bus being occupied, an interrupt
  2704 	   Due to Hub Link bus being occupied, an interrupt
  2697 	   de-assertion message is not able to be sent.
  2705 	   de-assertion message is not able to be sent.