]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/e1000e/netdev.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / e1000e / netdev.c
index f388a01793254231c49c3f3ea1624fb65c758f2d..bfb2d6c85c544cb8fa856f7b34900bac7c44756f 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "e1000.h"
 
-#define DRV_VERSION "0.3.3.4-k2"
+#define DRV_VERSION "0.3.3.4-k4"
 char e1000e_driver_name[] = "e1000e";
 const char e1000e_driver_version[] = DRV_VERSION;
 
@@ -621,15 +621,16 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
        struct e1000_buffer *buffer_info;
        unsigned int i, eop;
        unsigned int count = 0;
-       bool cleaned = 0;
+       bool cleaned;
        unsigned int total_tx_bytes = 0, total_tx_packets = 0;
 
        i = tx_ring->next_to_clean;
        eop = tx_ring->buffer_info[i].next_to_watch;
        eop_desc = E1000_TX_DESC(*tx_ring, eop);
 
-       while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
-               for (cleaned = 0; !cleaned; ) {
+       while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
+              (count < tx_ring->count)) {
+               for (cleaned = 0; !cleaned; count++) {
                        tx_desc = E1000_TX_DESC(*tx_ring, i);
                        buffer_info = &tx_ring->buffer_info[i];
                        cleaned = (i == eop);
@@ -655,10 +656,6 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
 
                eop = tx_ring->buffer_info[i].next_to_watch;
                eop_desc = E1000_TX_DESC(*tx_ring, eop);
-#define E1000_TX_WEIGHT 64
-               /* weight of a sort for tx, to avoid endless transmit cleanup */
-               if (count++ == E1000_TX_WEIGHT)
-                       break;
        }
 
        tx_ring->next_to_clean = i;
@@ -682,8 +679,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
                /* Detect a transmit hang in hardware, this serializes the
                 * check with the clearing of time_stamp and movement of i */
                adapter->detect_tx_hung = 0;
-               if (tx_ring->buffer_info[eop].time_stamp &&
-                   time_after(jiffies, tx_ring->buffer_info[eop].time_stamp
+               if (tx_ring->buffer_info[i].time_stamp &&
+                   time_after(jiffies, tx_ring->buffer_info[i].time_stamp
                               + (adapter->tx_timeout_factor * HZ))
                    && !(er32(STATUS) & E1000_STATUS_TXOFF)) {
                        e1000_print_tx_hang(adapter);
@@ -694,7 +691,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
        adapter->total_tx_packets += total_tx_packets;
        adapter->net_stats.tx_bytes += total_tx_bytes;
        adapter->net_stats.tx_packets += total_tx_packets;
-       return cleaned;
+       return (count < tx_ring->count);
 }
 
 /**
@@ -1264,7 +1261,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
        u32 icr = er32(ICR);
 
        if (!(icr & E1000_ICR_INT_ASSERTED)) {
-               ew32(IMS, E1000_IMS_OTHER);
+               if (!test_bit(__E1000_DOWN, &adapter->state))
+                       ew32(IMS, E1000_IMS_OTHER);
                return IRQ_NONE;
        }
 
@@ -1281,7 +1279,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
        }
 
 no_link_interrupt:
-       ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
+       if (!test_bit(__E1000_DOWN, &adapter->state))
+               ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
 
        return IRQ_HANDLED;
 }
@@ -2010,7 +2009,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
 clean_rx:
        adapter->clean_rx(adapter, &work_done, budget);
 
-       if (tx_cleaned)
+       if (!tx_cleaned)
                work_done = budget;
 
        /* If budget not fully consumed, exit the polling mode */
@@ -2018,10 +2017,12 @@ clean_rx:
                if (adapter->itr_setting & 3)
                        e1000_set_itr(adapter);
                napi_complete(napi);
-               if (adapter->msix_entries)
-                       ew32(IMS, adapter->rx_ring->ims_val);
-               else
-                       e1000_irq_enable(adapter);
+               if (!test_bit(__E1000_DOWN, &adapter->state)) {
+                       if (adapter->msix_entries)
+                               ew32(IMS, adapter->rx_ring->ims_val);
+                       else
+                               e1000_irq_enable(adapter);
+               }
        }
 
        return work_done;
@@ -5130,6 +5131,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 },
 
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574LA), board_82574 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82583V), board_82583 },
 
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),