Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[safe/jmp/linux-2.6] / drivers / net / e1000e / netdev.c
index 63e5688..14a80f8 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel PRO/1000 Linux driver
-  Copyright(c) 1999 - 2008 Intel Corporation.
+  Copyright(c) 1999 - 2009 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
 #include <linux/cpu.h>
 #include <linux/smp.h>
 #include <linux/pm_qos_params.h>
+#include <linux/aer.h>
 
 #include "e1000.h"
 
-#define DRV_VERSION "0.3.3.3-k6"
+#define DRV_VERSION "1.0.2-k2"
 char e1000e_driver_name[] = "e1000e";
 const char e1000e_driver_version[] = DRV_VERSION;
 
@@ -56,23 +57,14 @@ static const struct e1000_info *e1000_info_tbl[] = {
        [board_82572]           = &e1000_82572_info,
        [board_82573]           = &e1000_82573_info,
        [board_82574]           = &e1000_82574_info,
+       [board_82583]           = &e1000_82583_info,
        [board_80003es2lan]     = &e1000_es2_info,
        [board_ich8lan]         = &e1000_ich8_info,
        [board_ich9lan]         = &e1000_ich9_info,
        [board_ich10lan]        = &e1000_ich10_info,
+       [board_pchlan]          = &e1000_pch_info,
 };
 
-#ifdef DEBUG
-/**
- * e1000_get_hw_dev_name - return device name string
- * used by hardware layer to print debugging information
- **/
-char *e1000e_get_hw_dev_name(struct e1000_hw *hw)
-{
-       return hw->adapter->netdev->name;
-}
-#endif
-
 /**
  * e1000_desc_unused - calculate if we have unused descriptors
  **/
@@ -99,10 +91,10 @@ static void e1000_receive_skb(struct e1000_adapter *adapter,
        skb->protocol = eth_type_trans(skb, netdev);
 
        if (adapter->vlgrp && (status & E1000_RXD_STAT_VP))
-               vlan_hwaccel_receive_skb(skb, adapter->vlgrp,
-                                        le16_to_cpu(vlan));
+               vlan_gro_receive(&adapter->napi, adapter->vlgrp,
+                                le16_to_cpu(vlan), skb);
        else
-               netif_receive_skb(skb);
+               napi_gro_receive(&adapter->napi, skb);
 }
 
 /**
@@ -164,7 +156,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
        struct e1000_buffer *buffer_info;
        struct sk_buff *skb;
        unsigned int i;
-       unsigned int bufsz = adapter->rx_buffer_len + NET_IP_ALIGN;
+       unsigned int bufsz = adapter->rx_buffer_len;
 
        i = rx_ring->next_to_use;
        buffer_info = &rx_ring->buffer_info[i];
@@ -176,20 +168,13 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
                        goto map_skb;
                }
 
-               skb = netdev_alloc_skb(netdev, bufsz);
+               skb = netdev_alloc_skb_ip_align(netdev, bufsz);
                if (!skb) {
                        /* Better luck next round */
                        adapter->alloc_rx_buff_failed++;
                        break;
                }
 
-               /*
-                * Make buffer alignment 2 beyond a 16 byte boundary
-                * this will result in a 16 byte aligned IP header after
-                * the 14 byte MAC header is removed
-                */
-               skb_reserve(skb, NET_IP_ALIGN);
-
                buffer_info->skb = skb;
 map_skb:
                buffer_info->dma = pci_map_single(pdev, skb->data,
@@ -281,21 +266,14 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
                             cpu_to_le64(ps_page->dma);
                }
 
-               skb = netdev_alloc_skb(netdev,
-                                      adapter->rx_ps_bsize0 + NET_IP_ALIGN);
+               skb = netdev_alloc_skb_ip_align(netdev,
+                                               adapter->rx_ps_bsize0);
 
                if (!skb) {
                        adapter->alloc_rx_buff_failed++;
                        break;
                }
 
-               /*
-                * Make buffer alignment 2 beyond a 16 byte boundary
-                * this will result in a 16 byte aligned IP header after
-                * the 14 byte MAC header is removed
-                */
-               skb_reserve(skb, NET_IP_ALIGN);
-
                buffer_info->skb = skb;
                buffer_info->dma = pci_map_single(pdev, skb->data,
                                                  adapter->rx_ps_bsize0,
@@ -343,7 +321,6 @@ no_buffers:
 /**
  * e1000_alloc_jumbo_rx_buffers - Replace used jumbo receive buffers
  * @adapter: address of board private structure
- * @rx_ring: pointer to receive ring structure
  * @cleaned_count: number of buffers to allocate this pass
  **/
 
@@ -357,9 +334,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
        struct e1000_buffer *buffer_info;
        struct sk_buff *skb;
        unsigned int i;
-       unsigned int bufsz = 256 -
-                            16 /* for skb_reserve */ -
-                            NET_IP_ALIGN;
+       unsigned int bufsz = 256 - 16 /* for skb_reserve */;
 
        i = rx_ring->next_to_use;
        buffer_info = &rx_ring->buffer_info[i];
@@ -371,19 +346,13 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
                        goto check_page;
                }
 
-               skb = netdev_alloc_skb(netdev, bufsz);
+               skb = netdev_alloc_skb_ip_align(netdev, bufsz);
                if (unlikely(!skb)) {
                        /* Better luck next round */
                        adapter->alloc_rx_buff_failed++;
                        break;
                }
 
-               /* Make buffer alignment 2 beyond a 16 byte boundary
-                * this will result in a 16 byte aligned IP header after
-                * the 14 byte MAC header is removed
-                */
-               skb_reserve(skb, NET_IP_ALIGN);
-
                buffer_info->skb = skb;
 check_page:
                /* allocate a new page if necessary */
@@ -435,6 +404,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
 {
        struct net_device *netdev = adapter->netdev;
        struct pci_dev *pdev = adapter->pdev;
+       struct e1000_hw *hw = &adapter->hw;
        struct e1000_ring *rx_ring = adapter->rx_ring;
        struct e1000_rx_desc *rx_desc, *next_rxd;
        struct e1000_buffer *buffer_info, *next_buffer;
@@ -480,14 +450,23 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
 
                length = le16_to_cpu(rx_desc->length);
 
-               /* !EOP means multiple descriptors were used to store a single
-                * packet, also make sure the frame isn't just CRC only */
-               if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) {
+               /*
+                * !EOP means multiple descriptors were used to store a single
+                * packet, if that's the case we need to toss it.  In fact, we
+                * need to toss every packet with the EOP bit clear and the
+                * next frame that _does_ have the EOP bit set, as it is by
+                * definition only a frame fragment
+                */
+               if (unlikely(!(status & E1000_RXD_STAT_EOP)))
+                       adapter->flags2 |= FLAG2_IS_DISCARDING;
+
+               if (adapter->flags2 & FLAG2_IS_DISCARDING) {
                        /* All receives must fit into a single buffer */
-                       e_dbg("%s: Receive packet consumed multiple buffers\n",
-                             netdev->name);
+                       e_dbg("Receive packet consumed multiple buffers\n");
                        /* recycle */
                        buffer_info->skb = skb;
+                       if (status & E1000_RXD_STAT_EOP)
+                               adapter->flags2 &= ~FLAG2_IS_DISCARDING;
                        goto next_desc;
                }
 
@@ -497,6 +476,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
                        goto next_desc;
                }
 
+               /* adjust length to remove Ethernet CRC */
+               if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
+                       length -= 4;
+
                total_rx_bytes += length;
                total_rx_packets++;
 
@@ -507,9 +490,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
                 */
                if (length < copybreak) {
                        struct sk_buff *new_skb =
-                           netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
+                           netdev_alloc_skb_ip_align(netdev, length);
                        if (new_skb) {
-                               skb_reserve(new_skb, NET_IP_ALIGN);
                                skb_copy_to_linear_data_offset(new_skb,
                                                               -NET_IP_ALIGN,
                                                               (skb->data -
@@ -554,8 +536,8 @@ next_desc:
 
        adapter->total_rx_bytes += total_rx_bytes;
        adapter->total_rx_packets += total_rx_packets;
-       adapter->net_stats.rx_bytes += total_rx_bytes;
-       adapter->net_stats.rx_packets += total_rx_packets;
+       netdev->stats.rx_bytes += total_rx_bytes;
+       netdev->stats.rx_packets += total_rx_packets;
        return cleaned;
 }
 
@@ -563,25 +545,43 @@ static void e1000_put_txbuf(struct e1000_adapter *adapter,
                             struct e1000_buffer *buffer_info)
 {
        if (buffer_info->dma) {
-               pci_unmap_page(adapter->pdev, buffer_info->dma,
-                              buffer_info->length, PCI_DMA_TODEVICE);
+               if (buffer_info->mapped_as_page)
+                       pci_unmap_page(adapter->pdev, buffer_info->dma,
+                                      buffer_info->length, PCI_DMA_TODEVICE);
+               else
+                       pci_unmap_single(adapter->pdev, buffer_info->dma,
+                                        buffer_info->length,
+                                        PCI_DMA_TODEVICE);
                buffer_info->dma = 0;
        }
        if (buffer_info->skb) {
                dev_kfree_skb_any(buffer_info->skb);
                buffer_info->skb = NULL;
        }
+       buffer_info->time_stamp = 0;
 }
 
-static void e1000_print_tx_hang(struct e1000_adapter *adapter)
+static void e1000_print_hw_hang(struct work_struct *work)
 {
+       struct e1000_adapter *adapter = container_of(work,
+                                                    struct e1000_adapter,
+                                                    print_hang_task);
        struct e1000_ring *tx_ring = adapter->tx_ring;
        unsigned int i = tx_ring->next_to_clean;
        unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
        struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop);
+       struct e1000_hw *hw = &adapter->hw;
+       u16 phy_status, phy_1000t_status, phy_ext_status;
+       u16 pci_status;
+
+       e1e_rphy(hw, PHY_STATUS, &phy_status);
+       e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
+       e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
+
+       pci_read_config_word(adapter->pdev, PCI_STATUS, &pci_status);
 
-       /* detected Tx unit hang */
-       e_err("Detected Tx Unit Hang:\n"
+       /* detected Hardware unit hang */
+       e_err("Detected Hardware Unit Hang:\n"
              "  TDH                  <%x>\n"
              "  TDT                  <%x>\n"
              "  next_to_use          <%x>\n"
@@ -590,7 +590,12 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter)
              "  time_stamp           <%lx>\n"
              "  next_to_watch        <%x>\n"
              "  jiffies              <%lx>\n"
-             "  next_to_watch.status <%x>\n",
+             "  next_to_watch.status <%x>\n"
+             "MAC Status             <%x>\n"
+             "PHY Status             <%x>\n"
+             "PHY 1000BASE-T Status  <%x>\n"
+             "PHY Extended Status    <%x>\n"
+             "PCI Status             <%x>\n",
              readl(adapter->hw.hw_addr + tx_ring->head),
              readl(adapter->hw.hw_addr + tx_ring->tail),
              tx_ring->next_to_use,
@@ -598,7 +603,12 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter)
              tx_ring->buffer_info[eop].time_stamp,
              eop,
              jiffies,
-             eop_desc->upper.fields.status);
+             eop_desc->upper.fields.status,
+             er32(STATUS),
+             phy_status,
+             phy_1000t_status,
+             phy_ext_status,
+             pci_status);
 }
 
 /**
@@ -617,15 +627,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;
        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)) {
+               bool cleaned = false;
+               for (; !cleaned; count++) {
                        tx_desc = E1000_TX_DESC(*tx_ring, i);
                        buffer_info = &tx_ring->buffer_info[i];
                        cleaned = (i == eop);
@@ -651,17 +662,13 @@ 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;
 
 #define TX_WAKE_THRESHOLD 32
-       if (cleaned && netif_carrier_ok(netdev) &&
-                    e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) {
+       if (count && netif_carrier_ok(netdev) &&
+           e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) {
                /* Make sure that anybody stopping the queue after this
                 * sees the new next_to_clean.
                 */
@@ -680,19 +687,19 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
                 * check with the clearing of time_stamp and movement of i
                 */
                adapter->detect_tx_hung = 0;
-               if (tx_ring->buffer_info[eop].dma &&
-                   time_after(jiffies, tx_ring->buffer_info[eop].time_stamp
-                              + (adapter->tx_timeout_factor * HZ))
-                   && !(er32(STATUS) & E1000_STATUS_TXOFF)) {
-                       e1000_print_tx_hang(adapter);
+               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)) {
+                       schedule_work(&adapter->print_hang_task);
                        netif_stop_queue(netdev);
                }
        }
        adapter->total_tx_bytes += total_tx_bytes;
        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;
+       netdev->stats.tx_bytes += total_tx_bytes;
+       netdev->stats.tx_packets += total_tx_packets;
+       return (count < tx_ring->count);
 }
 
 /**
@@ -705,6 +712,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
 static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                                  int *work_done, int work_to_do)
 {
+       struct e1000_hw *hw = &adapter->hw;
        union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
        struct net_device *netdev = adapter->netdev;
        struct pci_dev *pdev = adapter->pdev;
@@ -747,10 +755,16 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                                 PCI_DMA_FROMDEVICE);
                buffer_info->dma = 0;
 
-               if (!(staterr & E1000_RXD_STAT_EOP)) {
-                       e_dbg("%s: Packet Split buffers didn't pick up the "
-                             "full packet\n", netdev->name);
+               /* see !EOP comment in other rx routine */
+               if (!(staterr & E1000_RXD_STAT_EOP))
+                       adapter->flags2 |= FLAG2_IS_DISCARDING;
+
+               if (adapter->flags2 & FLAG2_IS_DISCARDING) {
+                       e_dbg("Packet Split buffers didn't pick up the full "
+                             "packet\n");
                        dev_kfree_skb_irq(skb);
+                       if (staterr & E1000_RXD_STAT_EOP)
+                               adapter->flags2 &= ~FLAG2_IS_DISCARDING;
                        goto next_desc;
                }
 
@@ -762,8 +776,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                length = le16_to_cpu(rx_desc->wb.middle.length0);
 
                if (!length) {
-                       e_dbg("%s: Last part of the packet spanning multiple "
-                             "descriptors\n", netdev->name);
+                       e_dbg("Last part of the packet spanning multiple "
+                             "descriptors\n");
                        dev_kfree_skb_irq(skb);
                        goto next_desc;
                }
@@ -802,6 +816,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                        pci_dma_sync_single_for_device(pdev, ps_page->dma,
                                PAGE_SIZE, PCI_DMA_FROMDEVICE);
 
+                       /* remove the CRC */
+                       if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
+                               l1 -= 4;
+
                        skb_put(skb, l1);
                        goto copydone;
                } /* if */
@@ -823,6 +841,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                        skb->truesize += length;
                }
 
+               /* strip the ethernet crc, problem is we're using pages now so
+                * this whole operation can get a little cpu intensive
+                */
+               if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
+                       pskb_trim(skb, skb->len - 4);
+
 copydone:
                total_rx_bytes += skb->len;
                total_rx_packets++;
@@ -861,8 +885,8 @@ next_desc:
 
        adapter->total_rx_bytes += total_rx_bytes;
        adapter->total_rx_packets += total_rx_packets;
-       adapter->net_stats.rx_bytes += total_rx_bytes;
-       adapter->net_stats.rx_packets += total_rx_packets;
+       netdev->stats.rx_bytes += total_rx_bytes;
+       netdev->stats.rx_packets += total_rx_packets;
        return cleaned;
 }
 
@@ -1041,8 +1065,8 @@ next_desc:
 
        adapter->total_rx_bytes += total_rx_bytes;
        adapter->total_rx_packets += total_rx_packets;
-       adapter->net_stats.rx_bytes += total_rx_bytes;
-       adapter->net_stats.rx_packets += total_rx_packets;
+       netdev->stats.rx_bytes += total_rx_bytes;
+       netdev->stats.rx_packets += total_rx_packets;
        return cleaned;
 }
 
@@ -1110,6 +1134,7 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter)
 
        rx_ring->next_to_clean = 0;
        rx_ring->next_to_use = 0;
+       adapter->flags2 &= ~FLAG2_IS_DISCARDING;
 
        writel(0, adapter->hw.hw_addr + rx_ring->head);
        writel(0, adapter->hw.hw_addr + rx_ring->tail);
@@ -1139,7 +1164,7 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
         * read ICR disables interrupts using IAM
         */
 
-       if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
+       if (icr & E1000_ICR_LSC) {
                hw->mac.get_link_status = 1;
                /*
                 * ICH8 workaround-- Call gig speed drop workaround on cable
@@ -1166,12 +1191,12 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
                        mod_timer(&adapter->watchdog_timer, jiffies + 1);
        }
 
-       if (netif_rx_schedule_prep(netdev, &adapter->napi)) {
+       if (napi_schedule_prep(&adapter->napi)) {
                adapter->total_tx_bytes = 0;
                adapter->total_tx_packets = 0;
                adapter->total_rx_bytes = 0;
                adapter->total_rx_packets = 0;
-               __netif_rx_schedule(netdev, &adapter->napi);
+               __napi_schedule(&adapter->napi);
        }
 
        return IRQ_HANDLED;
@@ -1189,7 +1214,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
        struct e1000_hw *hw = &adapter->hw;
        u32 rctl, icr = er32(ICR);
 
-       if (!icr)
+       if (!icr || test_bit(__E1000_DOWN, &adapter->state))
                return IRQ_NONE;  /* Not our interrupt */
 
        /*
@@ -1205,7 +1230,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
         * IMC write
         */
 
-       if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
+       if (icr & E1000_ICR_LSC) {
                hw->mac.get_link_status = 1;
                /*
                 * ICH8 workaround-- Call gig speed drop workaround on cable
@@ -1233,12 +1258,12 @@ static irqreturn_t e1000_intr(int irq, void *data)
                        mod_timer(&adapter->watchdog_timer, jiffies + 1);
        }
 
-       if (netif_rx_schedule_prep(netdev, &adapter->napi)) {
+       if (napi_schedule_prep(&adapter->napi)) {
                adapter->total_tx_bytes = 0;
                adapter->total_tx_packets = 0;
                adapter->total_rx_bytes = 0;
                adapter->total_rx_packets = 0;
-               __netif_rx_schedule(netdev, &adapter->napi);
+               __napi_schedule(&adapter->napi);
        }
 
        return IRQ_HANDLED;
@@ -1252,7 +1277,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;
        }
 
@@ -1269,7 +1295,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;
 }
@@ -1307,10 +1334,10 @@ static irqreturn_t e1000_intr_msix_rx(int irq, void *data)
                adapter->rx_ring->set_itr = 0;
        }
 
-       if (netif_rx_schedule_prep(netdev, &adapter->napi)) {
+       if (napi_schedule_prep(&adapter->napi)) {
                adapter->total_rx_bytes = 0;
                adapter->total_rx_packets = 0;
-               __netif_rx_schedule(netdev, &adapter->napi);
+               __napi_schedule(&adapter->napi);
        }
        return IRQ_HANDLED;
 }
@@ -1465,11 +1492,11 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
        int err = 0, vector = 0;
 
        if (strlen(netdev->name) < (IFNAMSIZ - 5))
-               sprintf(adapter->rx_ring->name, "%s-rx0", netdev->name);
+               sprintf(adapter->rx_ring->name, "%s-rx-0", netdev->name);
        else
                memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ);
        err = request_irq(adapter->msix_entries[vector].vector,
-                         &e1000_intr_msix_rx, 0, adapter->rx_ring->name,
+                         e1000_intr_msix_rx, 0, adapter->rx_ring->name,
                          netdev);
        if (err)
                goto out;
@@ -1478,11 +1505,11 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
        vector++;
 
        if (strlen(netdev->name) < (IFNAMSIZ - 5))
-               sprintf(adapter->tx_ring->name, "%s-tx0", netdev->name);
+               sprintf(adapter->tx_ring->name, "%s-tx-0", netdev->name);
        else
                memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ);
        err = request_irq(adapter->msix_entries[vector].vector,
-                         &e1000_intr_msix_tx, 0, adapter->tx_ring->name,
+                         e1000_intr_msix_tx, 0, adapter->tx_ring->name,
                          netdev);
        if (err)
                goto out;
@@ -1491,7 +1518,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter)
        vector++;
 
        err = request_irq(adapter->msix_entries[vector].vector,
-                         &e1000_msix_other, 0, netdev->name, netdev);
+                         e1000_msix_other, 0, netdev->name, netdev);
        if (err)
                goto out;
 
@@ -1522,7 +1549,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
                e1000e_set_interrupt_capability(adapter);
        }
        if (adapter->flags & FLAG_MSI_ENABLED) {
-               err = request_irq(adapter->pdev->irq, &e1000_intr_msi, 0,
+               err = request_irq(adapter->pdev->irq, e1000_intr_msi, 0,
                                  netdev->name, netdev);
                if (!err)
                        return err;
@@ -1532,7 +1559,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
                adapter->int_mode = E1000E_INT_MODE_LEGACY;
        }
 
-       err = request_irq(adapter->pdev->irq, &e1000_intr, IRQF_SHARED,
+       err = request_irq(adapter->pdev->irq, e1000_intr, IRQF_SHARED,
                          netdev->name, netdev);
        if (err)
                e_err("Unable to allocate interrupt, Error: %d\n", err);
@@ -1685,7 +1712,6 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
 
        tx_ring->next_to_use = 0;
        tx_ring->next_to_clean = 0;
-       spin_lock_init(&adapter->tx_queue_lock);
 
        return 0;
 err:
@@ -1986,41 +2012,33 @@ static int e1000_clean(struct napi_struct *napi, int budget)
        struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
        struct e1000_hw *hw = &adapter->hw;
        struct net_device *poll_dev = adapter->netdev;
-       int tx_cleaned = 0, work_done = 0;
+       int tx_cleaned = 1, work_done = 0;
 
-       /* Must NOT use netdev_priv macro here. */
-       adapter = poll_dev->priv;
+       adapter = netdev_priv(poll_dev);
 
        if (adapter->msix_entries &&
            !(adapter->rx_ring->ims_val & adapter->tx_ring->ims_val))
                goto clean_rx;
 
-       /*
-        * e1000_clean is called per-cpu.  This lock protects
-        * tx_ring from being cleaned by multiple cpus
-        * simultaneously.  A failure obtaining the lock means
-        * tx_ring is currently being cleaned anyway.
-        */
-       if (spin_trylock(&adapter->tx_queue_lock)) {
-               tx_cleaned = e1000_clean_tx_irq(adapter);
-               spin_unlock(&adapter->tx_queue_lock);
-       }
+       tx_cleaned = e1000_clean_tx_irq(adapter);
 
 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 */
        if (work_done < budget) {
                if (adapter->itr_setting & 3)
                        e1000_set_itr(adapter);
-               netif_rx_complete(poll_dev, napi);
-               if (adapter->msix_entries)
-                       ew32(IMS, adapter->rx_ring->ims_val);
-               else
-                       e1000_irq_enable(adapter);
+               napi_complete(napi);
+               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;
@@ -2037,11 +2055,14 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
             E1000_MNG_DHCP_COOKIE_STATUS_VLAN) &&
            (vid == adapter->mng_vlan_id))
                return;
+
        /* add VID to filter table */
-       index = (vid >> 5) & 0x7F;
-       vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
-       vfta |= (1 << (vid & 0x1F));
-       e1000e_write_vfta(hw, index, vfta);
+       if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
+               index = (vid >> 5) & 0x7F;
+               vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+               vfta |= (1 << (vid & 0x1F));
+               hw->mac.ops.write_vfta(hw, index, vfta);
+       }
 }
 
 static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
@@ -2066,10 +2087,12 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
        }
 
        /* remove VID from filter table */
-       index = (vid >> 5) & 0x7F;
-       vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
-       vfta &= ~(1 << (vid & 0x1F));
-       e1000e_write_vfta(hw, index, vfta);
+       if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) {
+               index = (vid >> 5) & 0x7F;
+               vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
+               vfta &= ~(1 << (vid & 0x1F));
+               hw->mac.ops.write_vfta(hw, index, vfta);
+       }
 }
 
 static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
@@ -2201,7 +2224,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
        /* Setup the HW Tx Head and Tail descriptor pointers */
        tdba = tx_ring->dma;
        tdlen = tx_ring->count * sizeof(struct e1000_tx_desc);
-       ew32(TDBAL, (tdba & DMA_32BIT_MASK));
+       ew32(TDBAL, (tdba & DMA_BIT_MASK(32)));
        ew32(TDBAH, (tdba >> 32));
        ew32(TDLEN, tdlen);
        ew32(TDH, 0);
@@ -2253,8 +2276,6 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
                ew32(TARC(1), tarc);
        }
 
-       e1000e_config_collision_dist(hw);
-
        /* Setup Transmit Descriptor Settings for eop descriptor */
        adapter->txd_cmd = E1000_TXD_CMD_EOP | E1000_TXD_CMD_IFCS;
 
@@ -2267,6 +2288,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
 
        ew32(TCTL, tctl);
 
+       e1000e_config_collision_dist(hw);
+
        adapter->tx_queue_len = adapter->netdev->tx_queue_len;
 }
 
@@ -2299,25 +2322,34 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
        else
                rctl |= E1000_RCTL_LPE;
 
-       /* Enable hardware CRC frame stripping */
-       rctl |= E1000_RCTL_SECRC;
+       /* Some systems expect that the CRC is included in SMBUS traffic. The
+        * hardware strips the CRC before sending to both SMBUS (BMC) and to
+        * host memory when this is enabled
+        */
+       if (adapter->flags2 & FLAG2_CRC_STRIPPING)
+               rctl |= E1000_RCTL_SECRC;
+
+       /* Workaround Si errata on 82577 PHY - configure IPG for jumbos */
+       if ((hw->phy.type == e1000_phy_82577) && (rctl & E1000_RCTL_LPE)) {
+               u16 phy_data;
+
+               e1e_rphy(hw, PHY_REG(770, 26), &phy_data);
+               phy_data &= 0xfff8;
+               phy_data |= (1 << 2);
+               e1e_wphy(hw, PHY_REG(770, 26), phy_data);
+
+               e1e_rphy(hw, 22, &phy_data);
+               phy_data &= 0x0fff;
+               phy_data |= (1 << 14);
+               e1e_wphy(hw, 0x10, 0x2823);
+               e1e_wphy(hw, 0x11, 0x0003);
+               e1e_wphy(hw, 22, phy_data);
+       }
 
        /* Setup buffer sizes */
        rctl &= ~E1000_RCTL_SZ_4096;
        rctl |= E1000_RCTL_BSEX;
        switch (adapter->rx_buffer_len) {
-       case 256:
-               rctl |= E1000_RCTL_SZ_256;
-               rctl &= ~E1000_RCTL_BSEX;
-               break;
-       case 512:
-               rctl |= E1000_RCTL_SZ_512;
-               rctl &= ~E1000_RCTL_BSEX;
-               break;
-       case 1024:
-               rctl |= E1000_RCTL_SZ_1024;
-               rctl &= ~E1000_RCTL_BSEX;
-               break;
        case 2048:
        default:
                rctl |= E1000_RCTL_SZ_2048;
@@ -2440,8 +2472,6 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
                ew32(ITR, 1000000000 / (adapter->itr * 256));
 
        ctrl_ext = er32(CTRL_EXT);
-       /* Reset delay timers after every interrupt */
-       ctrl_ext |= E1000_CTRL_EXT_INT_TIMER_CLR;
        /* Auto-Mask interrupts upon ICR access */
        ctrl_ext |= E1000_CTRL_EXT_IAME;
        ew32(IAM, 0xffffffff);
@@ -2453,7 +2483,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
         * the Base and Length of the Rx Descriptor Ring
         */
        rdba = rx_ring->dma;
-       ew32(RDBAL, (rdba & DMA_32BIT_MASK));
+       ew32(RDBAL, (rdba & DMA_BIT_MASK(32)));
        ew32(RDBAH, (rdba >> 32));
        ew32(RDLEN, rdlen);
        ew32(RDH, 0);
@@ -2483,21 +2513,23 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
         * packet size is equal or larger than the specified value (in 8 byte
         * units), e.g. using jumbo frames when setting to E1000_ERT_2048
         */
-       if ((adapter->flags & FLAG_HAS_ERT) &&
-           (adapter->netdev->mtu > ETH_DATA_LEN)) {
-               u32 rxdctl = er32(RXDCTL(0));
-               ew32(RXDCTL(0), rxdctl | 0x3);
-               ew32(ERT, E1000_ERT_2048 | (1 << 13));
-               /*
-                * With jumbo frames and early-receive enabled, excessive
-                * C4->C2 latencies result in dropped transactions.
-                */
-               pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
-                                         e1000e_driver_name, 55);
-       } else {
-               pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
-                                         e1000e_driver_name,
-                                         PM_QOS_DEFAULT_VALUE);
+       if (adapter->flags & FLAG_HAS_ERT) {
+               if (adapter->netdev->mtu > ETH_DATA_LEN) {
+                       u32 rxdctl = er32(RXDCTL(0));
+                       ew32(RXDCTL(0), rxdctl | 0x3);
+                       ew32(ERT, E1000_ERT_2048 | (1 << 13));
+                       /*
+                        * With jumbo frames and early-receive enabled,
+                        * excessive C-state transition latencies result in
+                        * dropped transactions.
+                        */
+                       pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
+                                                 adapter->netdev->name, 55);
+               } else {
+                       pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
+                                                 adapter->netdev->name,
+                                                 PM_QOS_DEFAULT_VALUE);
+               }
        }
 
        /* Enable Receives */
@@ -2509,22 +2541,14 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
  *  @hw: pointer to the HW structure
  *  @mc_addr_list: array of multicast addresses to program
  *  @mc_addr_count: number of multicast addresses to program
- *  @rar_used_count: the first RAR register free to program
- *  @rar_count: total number of supported Receive Address Registers
  *
- *  Updates the Receive Address Registers and Multicast Table Array.
+ *  Updates the Multicast Table Array.
  *  The caller must have a packed mc_addr_list of multicast addresses.
- *  The parameter rar_count will usually be hw->mac.rar_entry_count
- *  unless there are workarounds that change this.  Currently no func pointer
- *  exists and all implementations are handled in the generic version of this
- *  function.
  **/
 static void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
-                                     u32 mc_addr_count, u32 rar_used_count,
-                                     u32 rar_count)
+                                     u32 mc_addr_count)
 {
-       hw->mac.ops.update_mc_addr_list(hw, mc_addr_list, mc_addr_count,
-                                       rar_used_count, rar_count);
+       hw->mac.ops.update_mc_addr_list(hw, mc_addr_list, mc_addr_count);
 }
 
 /**
@@ -2540,7 +2564,6 @@ static void e1000_set_multi(struct net_device *netdev)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_hw *hw = &adapter->hw;
-       struct e1000_mac_info *mac = &hw->mac;
        struct dev_mc_list *mc_ptr;
        u8  *mta_list;
        u32 rctl;
@@ -2582,15 +2605,14 @@ static void e1000_set_multi(struct net_device *netdev)
                        mc_ptr = mc_ptr->next;
                }
 
-               e1000_update_mc_addr_list(hw, mta_list, i, 1,
-                                         mac->rar_entry_count);
+               e1000_update_mc_addr_list(hw, mta_list, i);
                kfree(mta_list);
        } else {
                /*
                 * if we're called from probe, we might not have
                 * anything to do here, so clear out the list
                 */
-               e1000_update_mc_addr_list(hw, NULL, 0, 1, mac->rar_entry_count);
+               e1000_update_mc_addr_list(hw, NULL, 0);
        }
 }
 
@@ -2621,18 +2643,8 @@ static void e1000_configure(struct e1000_adapter *adapter)
  **/
 void e1000e_power_up_phy(struct e1000_adapter *adapter)
 {
-       u16 mii_reg = 0;
-
-       /* Just clear the power down bit to wake the phy back up */
-       if (adapter->hw.phy.media_type == e1000_media_type_copper) {
-               /*
-                * According to the manual, the phy will retain its
-                * settings across a power-down/up cycle
-                */
-               e1e_rphy(&adapter->hw, PHY_CONTROL, &mii_reg);
-               mii_reg &= ~MII_CR_POWER_DOWN;
-               e1e_wphy(&adapter->hw, PHY_CONTROL, mii_reg);
-       }
+       if (adapter->hw.phy.ops.power_up)
+               adapter->hw.phy.ops.power_up(&adapter->hw);
 
        adapter->hw.mac.ops.setup_link(&adapter->hw);
 }
@@ -2640,35 +2652,17 @@ void e1000e_power_up_phy(struct e1000_adapter *adapter)
 /**
  * e1000_power_down_phy - Power down the PHY
  *
- * Power down the PHY so no link is implied when interface is down
- * The PHY cannot be powered down is management or WoL is active
+ * Power down the PHY so no link is implied when interface is down.
+ * The PHY cannot be powered down if management or WoL is active.
  */
 static void e1000_power_down_phy(struct e1000_adapter *adapter)
 {
-       struct e1000_hw *hw = &adapter->hw;
-       u16 mii_reg;
-
        /* WoL is enabled */
        if (adapter->wol)
                return;
 
-       /* non-copper PHY? */
-       if (adapter->hw.phy.media_type != e1000_media_type_copper)
-               return;
-
-       /* reset is blocked because of a SoL/IDER session */
-       if (e1000e_check_mng_mode(hw) || e1000_check_reset_block(hw))
-               return;
-
-       /* manageability (AMT) is enabled */
-       if (er32(MANC) & E1000_MANC_SMBUS_EN)
-               return;
-
-       /* power down the PHY */
-       e1e_rphy(hw, PHY_CONTROL, &mii_reg);
-       mii_reg |= MII_CR_POWER_DOWN;
-       e1e_wphy(hw, PHY_CONTROL, mii_reg);
-       mdelay(1);
+       if (adapter->hw.phy.ops.power_down)
+               adapter->hw.phy.ops.power_down(&adapter->hw);
 }
 
 /**
@@ -2753,22 +2747,37 @@ void e1000e_reset(struct e1000_adapter *adapter)
         *   with ERT support assuming ERT set to E1000_ERT_2048), or
         * - the full Rx FIFO size minus one full frame
         */
-       if (adapter->flags & FLAG_HAS_ERT)
-               hwm = min(((pba << 10) * 9 / 10),
-                         ((pba << 10) - (E1000_ERT_2048 << 3)));
-       else
-               hwm = min(((pba << 10) * 9 / 10),
-                         ((pba << 10) - adapter->max_frame_size));
+       if (hw->mac.type == e1000_pchlan) {
+               /*
+                * Workaround PCH LOM adapter hangs with certain network
+                * loads.  If hangs persist, try disabling Tx flow control.
+                */
+               if (adapter->netdev->mtu > ETH_DATA_LEN) {
+                       fc->high_water = 0x3500;
+                       fc->low_water  = 0x1500;
+               } else {
+                       fc->high_water = 0x5000;
+                       fc->low_water  = 0x3000;
+               }
+       } else {
+               if ((adapter->flags & FLAG_HAS_ERT) &&
+                   (adapter->netdev->mtu > ETH_DATA_LEN))
+                       hwm = min(((pba << 10) * 9 / 10),
+                                 ((pba << 10) - (E1000_ERT_2048 << 3)));
+               else
+                       hwm = min(((pba << 10) * 9 / 10),
+                                 ((pba << 10) - adapter->max_frame_size));
 
-       fc->high_water = hwm & 0xFFF8; /* 8-byte granularity */
-       fc->low_water = fc->high_water - 8;
+               fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
+               fc->low_water = fc->high_water - 8;
+       }
 
        if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
                fc->pause_time = 0xFFFF;
        else
                fc->pause_time = E1000_FC_PAUSE_TIME;
        fc->send_xon = 1;
-       fc->type = fc->original_type;
+       fc->current_mode = fc->requested_mode;
 
        /* Allow time for pending master requests to run */
        mac->ops.reset_hw(hw);
@@ -2781,10 +2790,16 @@ void e1000e_reset(struct e1000_adapter *adapter)
                e1000_get_hw_control(adapter);
 
        ew32(WUC, 0);
+       if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP)
+               e1e_wphy(&adapter->hw, BM_WUC, 0);
 
        if (mac->ops.init_hw(hw))
                e_err("Hardware Error\n");
 
+       /* additional part of the flow-control workaround above */
+       if (hw->mac.type == e1000_pchlan)
+               ew32(FCRTV_PCH, 0x1000);
+
        e1000_update_mng_vlan(adapter);
 
        /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
@@ -2793,7 +2808,8 @@ void e1000e_reset(struct e1000_adapter *adapter)
        e1000e_reset_adaptive(hw);
        e1000_get_phy_info(hw);
 
-       if (!(adapter->flags & FLAG_SMART_POWER_DOWN)) {
+       if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) &&
+           !(adapter->flags & FLAG_SMART_POWER_DOWN)) {
                u16 phy_data = 0;
                /*
                 * speed up time to link by disabling smart power down, ignore
@@ -2810,6 +2826,12 @@ int e1000e_up(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
 
+       /* DMA latency requirement to workaround early-receive/jumbo issue */
+       if (adapter->flags & FLAG_HAS_ERT)
+               pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
+                                      adapter->netdev->name,
+                                      PM_QOS_DEFAULT_VALUE);
+
        /* hardware has been reset, we need to reload some things */
        e1000_configure(adapter);
 
@@ -2820,6 +2842,8 @@ int e1000e_up(struct e1000_adapter *adapter)
                e1000_configure_msix(adapter);
        e1000_irq_enable(adapter);
 
+       netif_wake_queue(adapter->netdev);
+
        /* fire a link change interrupt to start the watchdog */
        ew32(ICS, E1000_ICS_LSC);
        return 0;
@@ -2842,7 +2866,7 @@ void e1000e_down(struct e1000_adapter *adapter)
        ew32(RCTL, rctl & ~E1000_RCTL_EN);
        /* flush and sleep below */
 
-       netif_tx_stop_all_queues(netdev);
+       netif_stop_queue(netdev);
 
        /* disable transmits in the hardware */
        tctl = er32(TCTL);
@@ -2868,6 +2892,10 @@ void e1000e_down(struct e1000_adapter *adapter)
        e1000_clean_tx_ring(adapter);
        e1000_clean_rx_ring(adapter);
 
+       if (adapter->flags & FLAG_HAS_ERT)
+               pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
+                                         adapter->netdev->name);
+
        /*
         * TODO: for power management, we could drop the link and
         * pci_disable_device here.
@@ -2906,8 +2934,6 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
        if (e1000_alloc_queues(adapter))
                return -ENOMEM;
 
-       spin_lock_init(&adapter->tx_queue_lock);
-
        /* Explicitly disable IRQ since the NIC can be in any state. */
        e1000_irq_disable(adapter);
 
@@ -2927,7 +2953,7 @@ static irqreturn_t e1000_intr_msi_test(int irq, void *data)
        struct e1000_hw *hw = &adapter->hw;
        u32 icr = er32(ICR);
 
-       e_dbg("%s: icr is %08X\n", netdev->name, icr);
+       e_dbg("icr is %08X\n", icr);
        if (icr & E1000_ICR_RXSEQ) {
                adapter->flags &= ~FLAG_MSI_TEST_FAILED;
                wmb();
@@ -2964,7 +2990,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
        if (err)
                goto msi_test_failed;
 
-       err = request_irq(adapter->pdev->irq, &e1000_intr_msi_test, 0,
+       err = request_irq(adapter->pdev->irq, e1000_intr_msi_test, 0,
                          netdev->name, netdev);
        if (err) {
                pci_disable_msi(adapter->pdev);
@@ -2997,7 +3023,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
                goto msi_test_failed;
 
        /* okay so the test worked, restore settings */
-       e_dbg("%s: MSI interrupt test succeeded!\n", netdev->name);
+       e_dbg("MSI interrupt test succeeded!\n");
 msi_test_failed:
        e1000e_set_interrupt_capability(adapter);
        e1000_request_irq(adapter);
@@ -3068,6 +3094,8 @@ static int e1000_open(struct net_device *netdev)
        if (test_bit(__E1000_TESTING, &adapter->state))
                return -EBUSY;
 
+       netif_carrier_off(netdev);
+
        /* allocate transmit descriptors */
        err = e1000e_setup_tx_resources(adapter);
        if (err)
@@ -3124,7 +3152,7 @@ static int e1000_open(struct net_device *netdev)
 
        e1000_irq_enable(adapter);
 
-       netif_tx_start_all_queues(netdev);
+       netif_start_queue(netdev);
 
        /* fire a link status change interrupt to start the watchdog */
        ew32(ICS, E1000_ICS_LSC);
@@ -3256,8 +3284,10 @@ static void e1000_update_phy_info(unsigned long data)
  **/
 void e1000e_update_stats(struct e1000_adapter *adapter)
 {
+       struct net_device *netdev = adapter->netdev;
        struct e1000_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
+       u16 phy_data;
 
        /*
         * Prevent stats update while adapter is being reset, or if the pci
@@ -3277,11 +3307,34 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
        adapter->stats.roc += er32(ROC);
 
        adapter->stats.mpc += er32(MPC);
-       adapter->stats.scc += er32(SCC);
-       adapter->stats.ecol += er32(ECOL);
-       adapter->stats.mcc += er32(MCC);
-       adapter->stats.latecol += er32(LATECOL);
-       adapter->stats.dc += er32(DC);
+       if ((hw->phy.type == e1000_phy_82578) ||
+           (hw->phy.type == e1000_phy_82577)) {
+               e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data))
+                       adapter->stats.scc += phy_data;
+
+               e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data))
+                       adapter->stats.ecol += phy_data;
+
+               e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data))
+                       adapter->stats.mcc += phy_data;
+
+               e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data))
+                       adapter->stats.latecol += phy_data;
+
+               e1e_rphy(hw, HV_DC_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data))
+                       adapter->stats.dc += phy_data;
+       } else {
+               adapter->stats.scc += er32(SCC);
+               adapter->stats.ecol += er32(ECOL);
+               adapter->stats.mcc += er32(MCC);
+               adapter->stats.latecol += er32(LATECOL);
+               adapter->stats.dc += er32(DC);
+       }
        adapter->stats.xonrxc += er32(XONRXC);
        adapter->stats.xontxc += er32(XONTXC);
        adapter->stats.xoffrxc += er32(XOFFRXC);
@@ -3299,20 +3352,35 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
 
        hw->mac.tx_packet_delta = er32(TPT);
        adapter->stats.tpt += hw->mac.tx_packet_delta;
-       hw->mac.collision_delta = er32(COLC);
+       if ((hw->phy.type == e1000_phy_82578) ||
+           (hw->phy.type == e1000_phy_82577)) {
+               e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data))
+                       hw->mac.collision_delta = phy_data;
+       } else {
+               hw->mac.collision_delta = er32(COLC);
+       }
        adapter->stats.colc += hw->mac.collision_delta;
 
        adapter->stats.algnerrc += er32(ALGNERRC);
        adapter->stats.rxerrc += er32(RXERRC);
-       if (hw->mac.type != e1000_82574)
-               adapter->stats.tncrs += er32(TNCRS);
+       if ((hw->phy.type == e1000_phy_82578) ||
+           (hw->phy.type == e1000_phy_82577)) {
+               e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
+               if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data))
+                       adapter->stats.tncrs += phy_data;
+       } else {
+               if ((hw->mac.type != e1000_82574) &&
+                   (hw->mac.type != e1000_82583))
+                       adapter->stats.tncrs += er32(TNCRS);
+       }
        adapter->stats.cexterr += er32(CEXTERR);
        adapter->stats.tsctc += er32(TSCTC);
        adapter->stats.tsctfc += er32(TSCTFC);
 
        /* Fill out the OS statistics structure */
-       adapter->net_stats.multicast = adapter->stats.mprc;
-       adapter->net_stats.collisions = adapter->stats.colc;
+       netdev->stats.multicast = adapter->stats.mprc;
+       netdev->stats.collisions = adapter->stats.colc;
 
        /* Rx Errors */
 
@@ -3320,22 +3388,22 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
         * RLEC on some newer hardware can be incorrect so build
         * our own version based on RUC and ROC
         */
-       adapter->net_stats.rx_errors = adapter->stats.rxerrc +
+       netdev->stats.rx_errors = adapter->stats.rxerrc +
                adapter->stats.crcerrs + adapter->stats.algnerrc +
                adapter->stats.ruc + adapter->stats.roc +
                adapter->stats.cexterr;
-       adapter->net_stats.rx_length_errors = adapter->stats.ruc +
+       netdev->stats.rx_length_errors = adapter->stats.ruc +
                                              adapter->stats.roc;
-       adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs;
-       adapter->net_stats.rx_frame_errors = adapter->stats.algnerrc;
-       adapter->net_stats.rx_missed_errors = adapter->stats.mpc;
+       netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
+       netdev->stats.rx_frame_errors = adapter->stats.algnerrc;
+       netdev->stats.rx_missed_errors = adapter->stats.mpc;
 
        /* Tx Errors */
-       adapter->net_stats.tx_errors = adapter->stats.ecol +
+       netdev->stats.tx_errors = adapter->stats.ecol +
                                       adapter->stats.latecol;
-       adapter->net_stats.tx_aborted_errors = adapter->stats.ecol;
-       adapter->net_stats.tx_window_errors = adapter->stats.latecol;
-       adapter->net_stats.tx_carrier_errors = adapter->stats.tncrs;
+       netdev->stats.tx_aborted_errors = adapter->stats.ecol;
+       netdev->stats.tx_window_errors = adapter->stats.latecol;
+       netdev->stats.tx_carrier_errors = adapter->stats.tncrs;
 
        /* Tx Dropped needs to be maintained elsewhere */
 
@@ -3391,7 +3459,10 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        u32 ctrl = er32(CTRL);
 
-       e_info("Link is Up %d Mbps %s, Flow Control: %s\n",
+       /* Link status message must follow this format for user tools */
+       printk(KERN_INFO "e1000e: %s NIC Link is Up %d Mbps %s, "
+              "Flow Control: %s\n",
+              adapter->netdev->name,
               adapter->link_speed,
               (adapter->link_duplex == FULL_DUPLEX) ?
                                "Full Duplex" : "Half Duplex",
@@ -3401,7 +3472,7 @@ static void e1000_print_link_info(struct e1000_adapter *adapter)
               ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
 }
 
-static bool e1000_has_link(struct e1000_adapter *adapter)
+bool e1000_has_link(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
        bool link_active = 0;
@@ -3476,6 +3547,7 @@ static void e1000_watchdog_task(struct work_struct *work)
                                        struct e1000_adapter, watchdog_task);
        struct net_device *netdev = adapter->netdev;
        struct e1000_mac_info *mac = &adapter->hw.mac;
+       struct e1000_phy_info *phy = &adapter->hw.phy;
        struct e1000_ring *tx_ring = adapter->tx_ring;
        struct e1000_hw *hw = &adapter->hw;
        u32 link, tctl;
@@ -3536,7 +3608,7 @@ static void e1000_watchdog_task(struct work_struct *work)
                        case SPEED_100:
                                txb2b = 0;
                                netdev->tx_queue_len = 100;
-                               /* maybe add some timeout factor ? */
+                               adapter->tx_timeout_factor = 10;
                                break;
                        }
 
@@ -3582,8 +3654,14 @@ static void e1000_watchdog_task(struct work_struct *work)
                        tctl |= E1000_TCTL_EN;
                        ew32(TCTL, tctl);
 
+                        /*
+                        * Perform any post-link-up configuration before
+                        * reporting link up.
+                        */
+                       if (phy->ops.cfg_on_link_up)
+                               phy->ops.cfg_on_link_up(hw);
+
                        netif_carrier_on(netdev);
-                       netif_tx_wake_all_queues(netdev);
 
                        if (!test_bit(__E1000_DOWN, &adapter->state))
                                mod_timer(&adapter->phy_info_timer,
@@ -3593,9 +3671,10 @@ static void e1000_watchdog_task(struct work_struct *work)
                if (netif_carrier_ok(netdev)) {
                        adapter->link_speed = 0;
                        adapter->link_duplex = 0;
-                       e_info("Link is Down\n");
+                       /* Link status message must follow this format */
+                       printk(KERN_INFO "e1000e: %s NIC Link is Down\n",
+                              adapter->netdev->name);
                        netif_carrier_off(netdev);
-                       netif_tx_stop_all_queues(netdev);
                        if (!test_bit(__E1000_DOWN, &adapter->state))
                                mod_timer(&adapter->phy_info_timer,
                                          round_jiffies(jiffies + 2 * HZ));
@@ -3632,6 +3711,8 @@ link_up:
                         */
                        adapter->tx_timeout_count++;
                        schedule_work(&adapter->reset_task);
+                       /* return immediately since reset is imminent */
+                       return;
                }
        }
 
@@ -3676,68 +3757,64 @@ static int e1000_tso(struct e1000_adapter *adapter,
        u8 ipcss, ipcso, tucss, tucso, hdr_len;
        int err;
 
-       if (skb_is_gso(skb)) {
-               if (skb_header_cloned(skb)) {
-                       err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
-                       if (err)
-                               return err;
-               }
+       if (!skb_is_gso(skb))
+               return 0;
 
-               hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
-               mss = skb_shinfo(skb)->gso_size;
-               if (skb->protocol == htons(ETH_P_IP)) {
-                       struct iphdr *iph = ip_hdr(skb);
-                       iph->tot_len = 0;
-                       iph->check = 0;
-                       tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr,
-                                                                iph->daddr, 0,
-                                                                IPPROTO_TCP,
-                                                                0);
-                       cmd_length = E1000_TXD_CMD_IP;
-                       ipcse = skb_transport_offset(skb) - 1;
-               } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) {
-                       ipv6_hdr(skb)->payload_len = 0;
-                       tcp_hdr(skb)->check =
-                               ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
-                                                &ipv6_hdr(skb)->daddr,
-                                                0, IPPROTO_TCP, 0);
-                       ipcse = 0;
-               }
-               ipcss = skb_network_offset(skb);
-               ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
-               tucss = skb_transport_offset(skb);
-               tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
-               tucse = 0;
+       if (skb_header_cloned(skb)) {
+               err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
+               if (err)
+                       return err;
+       }
 
-               cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
-                              E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
+       hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
+       mss = skb_shinfo(skb)->gso_size;
+       if (skb->protocol == htons(ETH_P_IP)) {
+               struct iphdr *iph = ip_hdr(skb);
+               iph->tot_len = 0;
+               iph->check = 0;
+               tcp_hdr(skb)->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
+                                                        0, IPPROTO_TCP, 0);
+               cmd_length = E1000_TXD_CMD_IP;
+               ipcse = skb_transport_offset(skb) - 1;
+       } else if (skb_is_gso_v6(skb)) {
+               ipv6_hdr(skb)->payload_len = 0;
+               tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
+                                                      &ipv6_hdr(skb)->daddr,
+                                                      0, IPPROTO_TCP, 0);
+               ipcse = 0;
+       }
+       ipcss = skb_network_offset(skb);
+       ipcso = (void *)&(ip_hdr(skb)->check) - (void *)skb->data;
+       tucss = skb_transport_offset(skb);
+       tucso = (void *)&(tcp_hdr(skb)->check) - (void *)skb->data;
+       tucse = 0;
 
-               i = tx_ring->next_to_use;
-               context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
-               buffer_info = &tx_ring->buffer_info[i];
+       cmd_length |= (E1000_TXD_CMD_DEXT | E1000_TXD_CMD_TSE |
+                      E1000_TXD_CMD_TCP | (skb->len - (hdr_len)));
 
-               context_desc->lower_setup.ip_fields.ipcss  = ipcss;
-               context_desc->lower_setup.ip_fields.ipcso  = ipcso;
-               context_desc->lower_setup.ip_fields.ipcse  = cpu_to_le16(ipcse);
-               context_desc->upper_setup.tcp_fields.tucss = tucss;
-               context_desc->upper_setup.tcp_fields.tucso = tucso;
-               context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
-               context_desc->tcp_seg_setup.fields.mss     = cpu_to_le16(mss);
-               context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
-               context_desc->cmd_and_length = cpu_to_le32(cmd_length);
+       i = tx_ring->next_to_use;
+       context_desc = E1000_CONTEXT_DESC(*tx_ring, i);
+       buffer_info = &tx_ring->buffer_info[i];
 
-               buffer_info->time_stamp = jiffies;
-               buffer_info->next_to_watch = i;
+       context_desc->lower_setup.ip_fields.ipcss  = ipcss;
+       context_desc->lower_setup.ip_fields.ipcso  = ipcso;
+       context_desc->lower_setup.ip_fields.ipcse  = cpu_to_le16(ipcse);
+       context_desc->upper_setup.tcp_fields.tucss = tucss;
+       context_desc->upper_setup.tcp_fields.tucso = tucso;
+       context_desc->upper_setup.tcp_fields.tucse = cpu_to_le16(tucse);
+       context_desc->tcp_seg_setup.fields.mss     = cpu_to_le16(mss);
+       context_desc->tcp_seg_setup.fields.hdr_len = hdr_len;
+       context_desc->cmd_and_length = cpu_to_le32(cmd_length);
 
-               i++;
-               if (i == tx_ring->count)
-                       i = 0;
-               tx_ring->next_to_use = i;
+       buffer_info->time_stamp = jiffies;
+       buffer_info->next_to_watch = i;
 
-               return 1;
-       }
+       i++;
+       if (i == tx_ring->count)
+               i = 0;
+       tx_ring->next_to_use = i;
 
-       return 0;
+       return 1;
 }
 
 static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
@@ -3748,23 +3825,30 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
        unsigned int i;
        u8 css;
        u32 cmd_len = E1000_TXD_CMD_DEXT;
+       __be16 protocol;
 
        if (skb->ip_summed != CHECKSUM_PARTIAL)
                return 0;
 
-       switch (skb->protocol) {
-       case __constant_htons(ETH_P_IP):
+       if (skb->protocol == cpu_to_be16(ETH_P_8021Q))
+               protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
+       else
+               protocol = skb->protocol;
+
+       switch (protocol) {
+       case cpu_to_be16(ETH_P_IP):
                if (ip_hdr(skb)->protocol == IPPROTO_TCP)
                        cmd_len |= E1000_TXD_CMD_TCP;
                break;
-       case __constant_htons(ETH_P_IPV6):
+       case cpu_to_be16(ETH_P_IPV6):
                /* XXX not handling all IPV6 headers */
                if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
                        cmd_len |= E1000_TXD_CMD_TCP;
                break;
        default:
                if (unlikely(net_ratelimit()))
-                       e_warn("checksum_partial proto=%x!\n", skb->protocol);
+                       e_warn("checksum_partial proto=%x!\n",
+                              be16_to_cpu(protocol));
                break;
        }
 
@@ -3802,8 +3886,9 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
                        unsigned int mss)
 {
        struct e1000_ring *tx_ring = adapter->tx_ring;
+       struct pci_dev *pdev = adapter->pdev;
        struct e1000_buffer *buffer_info;
-       unsigned int len = skb->len - skb->data_len;
+       unsigned int len = skb_headlen(skb);
        unsigned int offset = 0, size, count = 0, i;
        unsigned int f;
 
@@ -3813,32 +3898,24 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
                buffer_info = &tx_ring->buffer_info[i];
                size = min(len, max_per_txd);
 
-               /* Workaround for premature desc write-backs
-                * in TSO mode.  Append 4-byte sentinel desc */
-               if (mss && !nr_frags && size == len && size > 8)
-                       size -= 4;
-
                buffer_info->length = size;
-               /* set time_stamp *before* dma to help avoid a possible race */
                buffer_info->time_stamp = jiffies;
-               buffer_info->dma =
-                       pci_map_single(adapter->pdev,
-                               skb->data + offset,
-                               size,
-                               PCI_DMA_TODEVICE);
-               if (pci_dma_mapping_error(adapter->pdev, buffer_info->dma)) {
-                       dev_err(&adapter->pdev->dev, "TX DMA map failed\n");
-                       adapter->tx_dma_failed++;
-                       return -1;
-               }
                buffer_info->next_to_watch = i;
+               buffer_info->dma = pci_map_single(pdev, skb->data + offset,
+                                                 size, PCI_DMA_TODEVICE);
+               buffer_info->mapped_as_page = false;
+               if (pci_dma_mapping_error(pdev, buffer_info->dma))
+                       goto dma_error;
 
                len -= size;
                offset += size;
                count++;
-               i++;
-               if (i == tx_ring->count)
-                       i = 0;
+
+               if (len) {
+                       i++;
+                       if (i == tx_ring->count)
+                               i = 0;
+               }
        }
 
        for (f = 0; f < nr_frags; f++) {
@@ -3849,50 +3926,49 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
                offset = frag->page_offset;
 
                while (len) {
+                       i++;
+                       if (i == tx_ring->count)
+                               i = 0;
+
                        buffer_info = &tx_ring->buffer_info[i];
                        size = min(len, max_per_txd);
-                       /* Workaround for premature desc write-backs
-                        * in TSO mode.  Append 4-byte sentinel desc */
-                       if (mss && f == (nr_frags-1) && size == len && size > 8)
-                               size -= 4;
 
                        buffer_info->length = size;
                        buffer_info->time_stamp = jiffies;
-                       buffer_info->dma =
-                               pci_map_page(adapter->pdev,
-                                       frag->page,
-                                       offset,
-                                       size,
-                                       PCI_DMA_TODEVICE);
-                       if (pci_dma_mapping_error(adapter->pdev,
-                                                 buffer_info->dma)) {
-                               dev_err(&adapter->pdev->dev,
-                                       "TX DMA page map failed\n");
-                               adapter->tx_dma_failed++;
-                               return -1;
-                       }
-
                        buffer_info->next_to_watch = i;
+                       buffer_info->dma = pci_map_page(pdev, frag->page,
+                                                       offset, size,
+                                                       PCI_DMA_TODEVICE);
+                       buffer_info->mapped_as_page = true;
+                       if (pci_dma_mapping_error(pdev, buffer_info->dma))
+                               goto dma_error;
 
                        len -= size;
                        offset += size;
                        count++;
-
-                       i++;
-                       if (i == tx_ring->count)
-                               i = 0;
                }
        }
 
-       if (i == 0)
-               i = tx_ring->count - 1;
-       else
-               i--;
-
        tx_ring->buffer_info[i].skb = skb;
        tx_ring->buffer_info[first].next_to_watch = i;
 
        return count;
+
+dma_error:
+       dev_err(&pdev->dev, "TX DMA map failed\n");
+       buffer_info->dma = 0;
+       if (count)
+               count--;
+
+       while (count--) {
+               if (i==0)
+                       i += tx_ring->count;
+               i--;
+               buffer_info = &tx_ring->buffer_info[i];
+               e1000_put_txbuf(adapter, buffer_info);;
+       }
+
+       return 0;
 }
 
 static void e1000_tx_queue(struct e1000_adapter *adapter,
@@ -3965,8 +4041,8 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
        u16 length, offset;
 
        if (vlan_tx_tag_present(skb)) {
-               if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id)
-                   && (adapter->hw.mng_cookie.status &
+               if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) &&
+                   (adapter->hw.mng_cookie.status &
                        E1000_MNG_DHCP_COOKIE_STATUS_VLAN)))
                        return 0;
        }
@@ -4031,7 +4107,8 @@ static int e1000_maybe_stop_tx(struct net_device *netdev, int size)
 }
 
 #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 )
-static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
+static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
+                                   struct net_device *netdev)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_ring *tx_ring = adapter->tx_ring;
@@ -4040,7 +4117,6 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;
        unsigned int tx_flags = 0;
        unsigned int len = skb->len - skb->data_len;
-       unsigned long irq_flags;
        unsigned int nr_frags;
        unsigned int mss;
        int count = 0;
@@ -4109,18 +4185,12 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        if (adapter->hw.mac.tx_pkt_filtering)
                e1000_transfer_dhcp_info(adapter, skb);
 
-       if (!spin_trylock_irqsave(&adapter->tx_queue_lock, irq_flags))
-               /* Collision - tell upper layer to requeue */
-               return NETDEV_TX_LOCKED;
-
        /*
         * need: count + 2 desc gap to keep tail from touching
         * head, otherwise try next time
         */
-       if (e1000_maybe_stop_tx(netdev, count + 2)) {
-               spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
+       if (e1000_maybe_stop_tx(netdev, count + 2))
                return NETDEV_TX_BUSY;
-       }
 
        if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
                tx_flags |= E1000_TX_FLAGS_VLAN;
@@ -4132,7 +4202,6 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        tso = e1000_tso(adapter, skb);
        if (tso < 0) {
                dev_kfree_skb_any(skb);
-               spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
                return NETDEV_TX_OK;
        }
 
@@ -4149,22 +4218,19 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        if (skb->protocol == htons(ETH_P_IP))
                tx_flags |= E1000_TX_FLAGS_IPV4;
 
+       /* if count is 0 then mapping error has occured */
        count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss);
-       if (count < 0) {
-               /* handle pci_map_single() error in e1000_tx_map */
+       if (count) {
+               e1000_tx_queue(adapter, tx_flags, count);
+               /* Make sure there is space in the ring for the next send. */
+               e1000_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 2);
+
+       } else {
                dev_kfree_skb_any(skb);
-               spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
-               return NETDEV_TX_OK;
+               tx_ring->buffer_info[first].time_stamp = 0;
+               tx_ring->next_to_use = first;
        }
 
-       e1000_tx_queue(adapter, tx_flags, count);
-
-       netdev->trans_start = jiffies;
-
-       /* Make sure there is space in the ring for the next send. */
-       e1000_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 2);
-
-       spin_unlock_irqrestore(&adapter->tx_queue_lock, irq_flags);
        return NETDEV_TX_OK;
 }
 
@@ -4198,10 +4264,8 @@ static void e1000_reset_task(struct work_struct *work)
  **/
 static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
 {
-       struct e1000_adapter *adapter = netdev_priv(netdev);
-
        /* only return the current stats */
-       return &adapter->net_stats;
+       return &netdev->stats;
 }
 
 /**
@@ -4216,34 +4280,26 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
        struct e1000_adapter *adapter = netdev_priv(netdev);
        int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
 
-       if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||
-           (max_frame > MAX_JUMBO_FRAME_SIZE)) {
-               e_err("Invalid MTU setting\n");
+       /* Jumbo frame support */
+       if ((max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) &&
+           !(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
+               e_err("Jumbo Frames not supported.\n");
                return -EINVAL;
        }
 
-       /* Jumbo frame size limits */
-       if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) {
-               if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
-                       e_err("Jumbo Frames not supported.\n");
-                       return -EINVAL;
-               }
-               if (adapter->hw.phy.type == e1000_phy_ife) {
-                       e_err("Jumbo Frames not supported.\n");
-                       return -EINVAL;
-               }
-       }
-
-#define MAX_STD_JUMBO_FRAME_SIZE 9234
-       if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
-               e_err("MTU > 9216 not supported.\n");
+       /* Supported frame sizes */
+       if ((new_mtu < ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) ||
+           (max_frame > adapter->max_hw_frame_size)) {
+               e_err("Unsupported MTU setting\n");
                return -EINVAL;
        }
 
        while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
                msleep(1);
-       /* e1000e_down has a dependency on max_frame_size */
+       /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */
        adapter->max_frame_size = max_frame;
+       e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
+       netdev->mtu = new_mtu;
        if (netif_running(netdev))
                e1000e_down(adapter);
 
@@ -4256,13 +4312,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
         * fragmented skbs
         */
 
-       if (max_frame <= 256)
-               adapter->rx_buffer_len = 256;
-       else if (max_frame <= 512)
-               adapter->rx_buffer_len = 512;
-       else if (max_frame <= 1024)
-               adapter->rx_buffer_len = 1024;
-       else if (max_frame <= 2048)
+       if (max_frame <= 2048)
                adapter->rx_buffer_len = 2048;
        else
                adapter->rx_buffer_len = 4096;
@@ -4273,9 +4323,6 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
                adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN
                                         + ETH_FCS_LEN;
 
-       e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
-       netdev->mtu = new_mtu;
-
        if (netif_running(netdev))
                e1000e_up(adapter);
        else
@@ -4300,8 +4347,8 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
                data->phy_id = adapter->hw.phy.addr;
                break;
        case SIOCGMIIREG:
-               if (!capable(CAP_NET_ADMIN))
-                       return -EPERM;
+               e1000_phy_read_status(adapter);
+
                switch (data->reg_num & 0x1F) {
                case MII_BMCR:
                        data->val_out = adapter->phy_regs.bmcr;
@@ -4356,7 +4403,82 @@ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
        }
 }
 
-static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
+static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
+{
+       struct e1000_hw *hw = &adapter->hw;
+       u32 i, mac_reg;
+       u16 phy_reg;
+       int retval = 0;
+
+       /* copy MAC RARs to PHY RARs */
+       for (i = 0; i < adapter->hw.mac.rar_entry_count; i++) {
+               mac_reg = er32(RAL(i));
+               e1e_wphy(hw, BM_RAR_L(i), (u16)(mac_reg & 0xFFFF));
+               e1e_wphy(hw, BM_RAR_M(i), (u16)((mac_reg >> 16) & 0xFFFF));
+               mac_reg = er32(RAH(i));
+               e1e_wphy(hw, BM_RAR_H(i), (u16)(mac_reg & 0xFFFF));
+               e1e_wphy(hw, BM_RAR_CTRL(i), (u16)((mac_reg >> 16) & 0xFFFF));
+       }
+
+       /* copy MAC MTA to PHY MTA */
+       for (i = 0; i < adapter->hw.mac.mta_reg_count; i++) {
+               mac_reg = E1000_READ_REG_ARRAY(hw, E1000_MTA, i);
+               e1e_wphy(hw, BM_MTA(i), (u16)(mac_reg & 0xFFFF));
+               e1e_wphy(hw, BM_MTA(i) + 1, (u16)((mac_reg >> 16) & 0xFFFF));
+       }
+
+       /* configure PHY Rx Control register */
+       e1e_rphy(&adapter->hw, BM_RCTL, &phy_reg);
+       mac_reg = er32(RCTL);
+       if (mac_reg & E1000_RCTL_UPE)
+               phy_reg |= BM_RCTL_UPE;
+       if (mac_reg & E1000_RCTL_MPE)
+               phy_reg |= BM_RCTL_MPE;
+       phy_reg &= ~(BM_RCTL_MO_MASK);
+       if (mac_reg & E1000_RCTL_MO_3)
+               phy_reg |= (((mac_reg & E1000_RCTL_MO_3) >> E1000_RCTL_MO_SHIFT)
+                               << BM_RCTL_MO_SHIFT);
+       if (mac_reg & E1000_RCTL_BAM)
+               phy_reg |= BM_RCTL_BAM;
+       if (mac_reg & E1000_RCTL_PMCF)
+               phy_reg |= BM_RCTL_PMCF;
+       mac_reg = er32(CTRL);
+       if (mac_reg & E1000_CTRL_RFCE)
+               phy_reg |= BM_RCTL_RFCE;
+       e1e_wphy(&adapter->hw, BM_RCTL, phy_reg);
+
+       /* enable PHY wakeup in MAC register */
+       ew32(WUFC, wufc);
+       ew32(WUC, E1000_WUC_PHY_WAKE | E1000_WUC_PME_EN);
+
+       /* configure and enable PHY wakeup in PHY registers */
+       e1e_wphy(&adapter->hw, BM_WUFC, wufc);
+       e1e_wphy(&adapter->hw, BM_WUC, E1000_WUC_PME_EN);
+
+       /* activate PHY wakeup */
+       retval = hw->phy.ops.acquire(hw);
+       if (retval) {
+               e_err("Could not acquire PHY\n");
+               return retval;
+       }
+       e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT,
+                                (BM_WUC_ENABLE_PAGE << IGP_PAGE_SHIFT));
+       retval = e1000e_read_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, &phy_reg);
+       if (retval) {
+               e_err("Could not read PHY page 769\n");
+               goto out;
+       }
+       phy_reg |= BM_WUC_ENABLE_BIT | BM_WUC_HOST_WU_BIT;
+       retval = e1000e_write_phy_reg_mdic(hw, BM_WUC_ENABLE_REG, phy_reg);
+       if (retval)
+               e_err("Could not set PHY Host Wakeup bit\n");
+out:
+       hw->phy.ops.release(hw);
+
+       return retval;
+}
+
+static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -4398,8 +4520,9 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
                #define E1000_CTRL_ADVD3WUC 0x00100000
                /* phy power management enable */
                #define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000
-               ctrl |= E1000_CTRL_ADVD3WUC |
-                       E1000_CTRL_EN_PHY_PWR_MGMT;
+               ctrl |= E1000_CTRL_ADVD3WUC;
+               if (!(adapter->flags2 & FLAG2_HAS_PHY_WAKEUP))
+                       ctrl |= E1000_CTRL_EN_PHY_PWR_MGMT;
                ew32(CTRL, ctrl);
 
                if (adapter->hw.phy.media_type == e1000_media_type_fiber ||
@@ -4407,7 +4530,7 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
                    e1000_media_type_internal_serdes) {
                        /* keep the laser running in D3 */
                        ctrl_ext = er32(CTRL_EXT);
-                       ctrl_ext |= E1000_CTRL_EXT_SDP7_DATA;
+                       ctrl_ext |= E1000_CTRL_EXT_SDP3_DATA;
                        ew32(CTRL_EXT, ctrl_ext);
                }
 
@@ -4417,22 +4540,27 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
                /* Allow time for pending master requests to run */
                e1000e_disable_pcie_master(&adapter->hw);
 
-               ew32(WUC, E1000_WUC_PME_EN);
-               ew32(WUFC, wufc);
-               pci_enable_wake(pdev, PCI_D3hot, 1);
-               pci_enable_wake(pdev, PCI_D3cold, 1);
+               if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
+                       /* enable wakeup by the PHY */
+                       retval = e1000_init_phy_wakeup(adapter, wufc);
+                       if (retval)
+                               return retval;
+               } else {
+                       /* enable wakeup by the MAC */
+                       ew32(WUFC, wufc);
+                       ew32(WUC, E1000_WUC_PME_EN);
+               }
        } else {
                ew32(WUC, 0);
                ew32(WUFC, 0);
-               pci_enable_wake(pdev, PCI_D3hot, 0);
-               pci_enable_wake(pdev, PCI_D3cold, 0);
        }
 
+       *enable_wake = !!wufc;
+
        /* make sure adapter isn't asleep if manageability is enabled */
-       if (adapter->flags & FLAG_MNG_PT_ENABLED) {
-               pci_enable_wake(pdev, PCI_D3hot, 1);
-               pci_enable_wake(pdev, PCI_D3cold, 1);
-       }
+       if ((adapter->flags & FLAG_MNG_PT_ENABLED) ||
+           (hw->mac.ops.check_mng_mode(hw)))
+               *enable_wake = true;
 
        if (adapter->hw.phy.type == e1000_phy_igp_3)
                e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
@@ -4445,11 +4573,49 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 
        pci_disable_device(pdev);
 
-       pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
        return 0;
 }
 
+static void e1000_power_off(struct pci_dev *pdev, bool sleep, bool wake)
+{
+       if (sleep && wake) {
+               pci_prepare_to_sleep(pdev);
+               return;
+       }
+
+       pci_wake_from_d3(pdev, wake);
+       pci_set_power_state(pdev, PCI_D3hot);
+}
+
+static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep,
+                                    bool wake)
+{
+       struct net_device *netdev = pci_get_drvdata(pdev);
+       struct e1000_adapter *adapter = netdev_priv(netdev);
+
+       /*
+        * The pci-e switch on some quad port adapters will report a
+        * correctable error when the MAC transitions from D0 to D3.  To
+        * prevent this we need to mask off the correctable errors on the
+        * downstream port of the pci-e switch.
+        */
+       if (adapter->flags & FLAG_IS_QUAD_PORT) {
+               struct pci_dev *us_dev = pdev->bus->self;
+               int pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP);
+               u16 devctl;
+
+               pci_read_config_word(us_dev, pos + PCI_EXP_DEVCTL, &devctl);
+               pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL,
+                                     (devctl & ~PCI_EXP_DEVCTL_CERE));
+
+               e1000_power_off(pdev, sleep, wake);
+
+               pci_write_config_word(us_dev, pos + PCI_EXP_DEVCTL, devctl);
+       } else {
+               e1000_power_off(pdev, sleep, wake);
+       }
+}
+
 static void e1000e_disable_l1aspm(struct pci_dev *pdev)
 {
        int pos;
@@ -4476,6 +4642,18 @@ static void e1000e_disable_l1aspm(struct pci_dev *pdev)
 }
 
 #ifdef CONFIG_PM
+static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
+{
+       int retval;
+       bool wake;
+
+       retval = __e1000_shutdown(pdev, &wake);
+       if (!retval)
+               e1000_complete_shutdown(pdev, true, wake);
+
+       return retval;
+}
+
 static int e1000_resume(struct pci_dev *pdev)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
@@ -4485,6 +4663,7 @@ static int e1000_resume(struct pci_dev *pdev)
 
        pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
+       pci_save_state(pdev);
        e1000e_disable_l1aspm(pdev);
 
        err = pci_enable_device_mem(pdev);
@@ -4507,8 +4686,37 @@ static int e1000_resume(struct pci_dev *pdev)
        }
 
        e1000e_power_up_phy(adapter);
+
+       /* report the system wakeup cause from S3/S4 */
+       if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
+               u16 phy_data;
+
+               e1e_rphy(&adapter->hw, BM_WUS, &phy_data);
+               if (phy_data) {
+                       e_info("PHY Wakeup cause - %s\n",
+                               phy_data & E1000_WUS_EX ? "Unicast Packet" :
+                               phy_data & E1000_WUS_MC ? "Multicast Packet" :
+                               phy_data & E1000_WUS_BC ? "Broadcast Packet" :
+                               phy_data & E1000_WUS_MAG ? "Magic Packet" :
+                               phy_data & E1000_WUS_LNKC ? "Link Status "
+                               " Change" : "other");
+               }
+               e1e_wphy(&adapter->hw, BM_WUS, ~0);
+       } else {
+               u32 wus = er32(WUS);
+               if (wus) {
+                       e_info("MAC Wakeup cause - %s\n",
+                               wus & E1000_WUS_EX ? "Unicast Packet" :
+                               wus & E1000_WUS_MC ? "Multicast Packet" :
+                               wus & E1000_WUS_BC ? "Broadcast Packet" :
+                               wus & E1000_WUS_MAG ? "Magic Packet" :
+                               wus & E1000_WUS_LNKC ? "Link Status Change" :
+                               "other");
+               }
+               ew32(WUS, ~0);
+       }
+
        e1000e_reset(adapter);
-       ew32(WUS, ~0);
 
        e1000_init_manageability(adapter);
 
@@ -4531,7 +4739,12 @@ static int e1000_resume(struct pci_dev *pdev)
 
 static void e1000_shutdown(struct pci_dev *pdev)
 {
-       e1000_suspend(pdev, PMSG_SUSPEND);
+       bool wake = false;
+
+       __e1000_shutdown(pdev, &wake);
+
+       if (system_state == SYSTEM_POWER_OFF)
+               e1000_complete_shutdown(pdev, false, wake);
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
@@ -4567,6 +4780,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
 
        netif_device_detach(netdev);
 
+       if (state == pci_channel_io_perm_failure)
+               return PCI_ERS_RESULT_DISCONNECT;
+
        if (netif_running(netdev))
                e1000e_down(adapter);
        pci_disable_device(pdev);
@@ -4588,24 +4804,30 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_hw *hw = &adapter->hw;
        int err;
+       pci_ers_result_t result;
 
        e1000e_disable_l1aspm(pdev);
        err = pci_enable_device_mem(pdev);
        if (err) {
                dev_err(&pdev->dev,
                        "Cannot re-enable PCI device after reset.\n");
-               return PCI_ERS_RESULT_DISCONNECT;
-       }
-       pci_set_master(pdev);
-       pci_restore_state(pdev);
+               result = PCI_ERS_RESULT_DISCONNECT;
+       } else {
+               pci_set_master(pdev);
+               pci_restore_state(pdev);
+               pci_save_state(pdev);
 
-       pci_enable_wake(pdev, PCI_D3hot, 0);
-       pci_enable_wake(pdev, PCI_D3cold, 0);
+               pci_enable_wake(pdev, PCI_D3hot, 0);
+               pci_enable_wake(pdev, PCI_D3cold, 0);
 
-       e1000e_reset(adapter);
-       ew32(WUS, ~0);
+               e1000e_reset(adapter);
+               ew32(WUS, ~0);
+               result = PCI_ERS_RESULT_RECOVERED;
+       }
+
+       pci_cleanup_aer_uncorrect_error_status(pdev);
 
-       return PCI_ERS_RESULT_RECOVERED;
+       return result;
 }
 
 /**
@@ -4673,20 +4895,40 @@ static void e1000_eeprom_checks(struct e1000_adapter *adapter)
                return;
 
        ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &buf);
-       if (!(le16_to_cpu(buf) & (1 << 0))) {
+       if (!ret_val && (!(le16_to_cpu(buf) & (1 << 0)))) {
                /* Deep Smart Power Down (DSPD) */
                dev_warn(&adapter->pdev->dev,
                         "Warning: detected DSPD enabled in EEPROM\n");
        }
 
        ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf);
-       if (le16_to_cpu(buf) & (3 << 2)) {
+       if (!ret_val && (le16_to_cpu(buf) & (3 << 2))) {
                /* ASPM enable */
                dev_warn(&adapter->pdev->dev,
                         "Warning: detected ASPM enabled in EEPROM\n");
        }
 }
 
+static const struct net_device_ops e1000e_netdev_ops = {
+       .ndo_open               = e1000_open,
+       .ndo_stop               = e1000_close,
+       .ndo_start_xmit         = e1000_xmit_frame,
+       .ndo_get_stats          = e1000_get_stats,
+       .ndo_set_multicast_list = e1000_set_multi,
+       .ndo_set_mac_address    = e1000_set_mac,
+       .ndo_change_mtu         = e1000_change_mtu,
+       .ndo_do_ioctl           = e1000_ioctl,
+       .ndo_tx_timeout         = e1000_tx_timeout,
+       .ndo_validate_addr      = eth_validate_addr,
+
+       .ndo_vlan_rx_register   = e1000_vlan_rx_register,
+       .ndo_vlan_rx_add_vid    = e1000_vlan_rx_add_vid,
+       .ndo_vlan_rx_kill_vid   = e1000_vlan_rx_kill_vid,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = e1000_netpoll,
+#endif
+};
+
 /**
  * e1000_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -4720,16 +4962,16 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
                return err;
 
        pci_using_dac = 0;
-       err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
+       err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
        if (!err) {
-               err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+               err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
                if (!err)
                        pci_using_dac = 1;
        } else {
-               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+               err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
                if (err) {
                        err = pci_set_consistent_dma_mask(pdev,
-                                                         DMA_32BIT_MASK);
+                                                         DMA_BIT_MASK(32));
                        if (err) {
                                dev_err(&pdev->dev, "No usable DMA "
                                        "configuration, aborting\n");
@@ -4738,14 +4980,20 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
                }
        }
 
-       err = pci_request_selected_regions(pdev,
+       err = pci_request_selected_regions_exclusive(pdev,
                                          pci_select_bars(pdev, IORESOURCE_MEM),
                                          e1000e_driver_name);
        if (err)
                goto err_pci_reg;
 
+       /* AER (Advanced Error Reporting) hooks */
+       pci_enable_pcie_error_reporting(pdev);
+
        pci_set_master(pdev);
-       pci_save_state(pdev);
+       /* PCI config space info */
+       err = pci_save_state(pdev);
+       if (err)
+               goto err_alloc_etherdev;
 
        err = -ENOMEM;
        netdev = alloc_etherdev(sizeof(struct e1000_adapter));
@@ -4762,8 +5010,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        adapter->ei = ei;
        adapter->pba = ei->pba;
        adapter->flags = ei->flags;
+       adapter->flags2 = ei->flags2;
        adapter->hw.adapter = adapter;
        adapter->hw.mac.type = ei->mac;
+       adapter->max_hw_frame_size = ei->max_hw_frame_size;
        adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
 
        mmio_start = pci_resource_start(pdev, 0);
@@ -4784,24 +5034,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        }
 
        /* construct the net_device struct */
-       netdev->open                    = &e1000_open;
-       netdev->stop                    = &e1000_close;
-       netdev->hard_start_xmit         = &e1000_xmit_frame;
-       netdev->get_stats               = &e1000_get_stats;
-       netdev->set_multicast_list      = &e1000_set_multi;
-       netdev->set_mac_address         = &e1000_set_mac;
-       netdev->change_mtu              = &e1000_change_mtu;
-       netdev->do_ioctl                = &e1000_ioctl;
+       netdev->netdev_ops              = &e1000e_netdev_ops;
        e1000e_set_ethtool_ops(netdev);
-       netdev->tx_timeout              = &e1000_tx_timeout;
        netdev->watchdog_timeo          = 5 * HZ;
        netif_napi_add(netdev, &adapter->napi, e1000_clean, 64);
-       netdev->vlan_rx_register        = e1000_vlan_rx_register;
-       netdev->vlan_rx_add_vid         = e1000_vlan_rx_add_vid;
-       netdev->vlan_rx_kill_vid        = e1000_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       netdev->poll_controller         = e1000_netpoll;
-#endif
        strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
 
        netdev->mem_start = mmio_start;
@@ -4863,12 +5099,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        if (pci_using_dac)
                netdev->features |= NETIF_F_HIGHDMA;
 
-       /*
-        * We should not be using LLTX anymore, but we are still Tx faster with
-        * it.
-        */
-       netdev->features |= NETIF_F_LLTX;
-
        if (e1000e_enable_mng_pass_thru(&adapter->hw))
                adapter->flags |= FLAG_MNG_PT_ENABLED;
 
@@ -4894,7 +5124,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 
        e1000_eeprom_checks(adapter);
 
-       /* copy the MAC address out of the NVM */
+       /* copy the MAC address */
        if (e1000e_read_mac_addr(&adapter->hw))
                e_err("NVM Read Error while reading MAC address\n");
 
@@ -4919,12 +5149,13 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
        INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
        INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
+       INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
 
        /* Initialize link parameters. User can change them with ethtool */
        adapter->hw.mac.autoneg = 1;
        adapter->fc_autoneg = 1;
-       adapter->hw.fc.original_type = e1000_fc_default;
-       adapter->hw.fc.type = e1000_fc_default;
+       adapter->hw.fc.requested_mode = e1000_fc_default;
+       adapter->hw.fc.current_mode = e1000_fc_default;
        adapter->hw.phy.autoneg_advertised = 0x2f;
 
        /* ring size defaults */
@@ -4939,6 +5170,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
                /* APME bit in EEPROM is mapped to WUC.APME */
                eeprom_data = er32(WUC);
                eeprom_apme_mask = E1000_WUC_APME;
+               if (eeprom_data & E1000_WUC_PHY_WAKE)
+                       adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP;
        } else if (adapter->flags & FLAG_APME_IN_CTRL3) {
                if (adapter->flags & FLAG_APME_CHECK_PORT_B &&
                    (adapter->hw.bus.func == 1))
@@ -4963,6 +5196,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 
        /* initialize the wol settings based on the eeprom settings */
        adapter->wol = adapter->eeprom_wol;
+       device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+
+       /* save off EEPROM version number */
+       e1000_read_nvm(&adapter->hw, 5, 1, &adapter->eeprom_vers);
 
        /* reset the hardware with the new settings */
        e1000e_reset(adapter);
@@ -4975,15 +5212,14 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        if (!(adapter->flags & FLAG_HAS_AMT))
                e1000_get_hw_control(adapter);
 
-       /* tell the stack to leave us alone until e1000_open() is called */
-       netif_carrier_off(netdev);
-       netif_tx_stop_all_queues(netdev);
-
        strcpy(netdev->name, "eth%d");
        err = register_netdev(netdev);
        if (err)
                goto err_register;
 
+       /* carrier off reporting is important to ethtool even BEFORE open */
+       netif_carrier_off(netdev);
+
        e1000_print_device_info(adapter);
 
        return 0;
@@ -5001,6 +5237,7 @@ err_hw_init:
 err_sw_init:
        if (adapter->hw.flash_address)
                iounmap(adapter->hw.flash_address);
+       e1000e_reset_interrupt_capability(adapter);
 err_flashmap:
        iounmap(adapter->hw.hw_addr);
 err_ioremap:
@@ -5036,19 +5273,24 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
        del_timer_sync(&adapter->watchdog_timer);
        del_timer_sync(&adapter->phy_info_timer);
 
+       cancel_work_sync(&adapter->reset_task);
+       cancel_work_sync(&adapter->watchdog_task);
+       cancel_work_sync(&adapter->downshift_task);
+       cancel_work_sync(&adapter->update_phy_task);
+       cancel_work_sync(&adapter->print_hang_task);
        flush_scheduled_work();
 
+       if (!(netdev->flags & IFF_UP))
+               e1000_power_down_phy(adapter);
+
+       unregister_netdev(netdev);
+
        /*
         * Release control of h/w to f/w.  If f/w is AMT enabled, this
         * would have already happened in close and is redundant.
         */
        e1000_release_hw_control(adapter);
 
-       unregister_netdev(netdev);
-
-       if (!e1000_check_reset_block(&adapter->hw))
-               e1000_phy_hw_reset(&adapter->hw);
-
        e1000e_reset_interrupt_capability(adapter);
        kfree(adapter->tx_ring);
        kfree(adapter->rx_ring);
@@ -5061,6 +5303,9 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
 
        free_netdev(netdev);
 
+       /* AER disable */
+       pci_disable_pcie_error_reporting(pdev);
+
        pci_disable_device(pdev);
 }
 
@@ -5071,7 +5316,7 @@ static struct pci_error_handlers e1000_err_handler = {
        .resume = e1000_io_resume,
 };
 
-static struct pci_device_id e1000_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 },
@@ -5092,6 +5337,8 @@ 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),
          board_80003es2lan },
@@ -5109,6 +5356,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_C), board_ich8lan },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M), board_ich8lan },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M_AMT), board_ich8lan },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_82567V_3), board_ich8lan },
 
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE), board_ich9lan },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G), board_ich9lan },
@@ -5127,6 +5375,11 @@ static struct pci_device_id e1000_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan },
 
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DM), board_pchlan },
+       { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DC), board_pchlan },
+
        { }     /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
@@ -5157,12 +5410,10 @@ static int __init e1000_init_module(void)
        int ret;
        printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n",
               e1000e_driver_name, e1000e_driver_version);
-       printk(KERN_INFO "%s: Copyright (c) 1999-2008 Intel Corporation.\n",
+       printk(KERN_INFO "%s: Copyright (c) 1999 - 2009 Intel Corporation.\n",
               e1000e_driver_name);
        ret = pci_register_driver(&e1000_driver);
-       pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name,
-                              PM_QOS_DEFAULT_VALUE);
-                               
+
        return ret;
 }
 module_init(e1000_init_module);
@@ -5176,7 +5427,6 @@ module_init(e1000_init_module);
 static void __exit e1000_exit_module(void)
 {
        pci_unregister_driver(&e1000_driver);
-       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, e1000e_driver_name);
 }
 module_exit(e1000_exit_module);