Merge branch 'linus' into cont_syslog
[safe/jmp/linux-2.6] / drivers / net / bnx2.c
index 06b9011..949d7a9 100644 (file)
@@ -1,6 +1,6 @@
 /* bnx2.c: Broadcom NX2 network driver.
  *
- * Copyright (c) 2004-2009 Broadcom Corporation
+ * Copyright (c) 2004-2010 Broadcom Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -9,6 +9,7 @@
  * Written by: Michael Chan  (mchan@broadcom.com)
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -48,7 +49,6 @@
 #include <linux/cache.h>
 #include <linux/firmware.h>
 #include <linux/log2.h>
-#include <linux/list.h>
 
 #if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
 #define BCM_CNIC 1
 #include "bnx2_fw.h"
 
 #define DRV_MODULE_NAME                "bnx2"
-#define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "2.0.1"
-#define DRV_MODULE_RELDATE     "May 6, 2009"
-#define FW_MIPS_FILE_06                "bnx2/bnx2-mips-06-4.6.16.fw"
-#define FW_RV2P_FILE_06                "bnx2/bnx2-rv2p-06-4.6.16.fw"
-#define FW_MIPS_FILE_09                "bnx2/bnx2-mips-09-4.6.17.fw"
-#define FW_RV2P_FILE_09                "bnx2/bnx2-rv2p-09-4.6.15.fw"
+#define DRV_MODULE_VERSION     "2.0.15"
+#define DRV_MODULE_RELDATE     "May 4, 2010"
+#define FW_MIPS_FILE_06                "bnx2/bnx2-mips-06-5.0.0.j6.fw"
+#define FW_RV2P_FILE_06                "bnx2/bnx2-rv2p-06-5.0.0.j3.fw"
+#define FW_MIPS_FILE_09                "bnx2/bnx2-mips-09-5.0.0.j15.fw"
+#define FW_RV2P_FILE_09_Ax     "bnx2/bnx2-rv2p-09ax-5.0.0.j10.fw"
+#define FW_RV2P_FILE_09                "bnx2/bnx2-rv2p-09-5.0.0.j10.fw"
 
 #define RUN_AT(x) (jiffies + (x))
 
@@ -82,6 +82,7 @@ MODULE_FIRMWARE(FW_MIPS_FILE_06);
 MODULE_FIRMWARE(FW_RV2P_FILE_06);
 MODULE_FIRMWARE(FW_MIPS_FILE_09);
 MODULE_FIRMWARE(FW_RV2P_FILE_09);
+MODULE_FIRMWARE(FW_RV2P_FILE_09_Ax);
 
 static int disable_msi = 0;
 
@@ -145,7 +146,7 @@ static DEFINE_PCI_DEVICE_TABLE(bnx2_pci_tbl) = {
        { 0, }
 };
 
-static struct flash_spec flash_table[] =
+static const struct flash_spec flash_table[] =
 {
 #define BUFFERED_FLAGS         (BNX2_NV_BUFFERED | BNX2_NV_TRANSLATE)
 #define NONBUFFERED_FLAGS      (BNX2_NV_WREN)
@@ -234,7 +235,7 @@ static struct flash_spec flash_table[] =
         "Buffered flash (256kB)"},
 };
 
-static struct flash_spec flash_5709 = {
+static const struct flash_spec flash_5709 = {
        .flags          = BNX2_NV_BUFFERED,
        .page_bits      = BCM5709_FLASH_PAGE_BITS,
        .page_size      = BCM5709_FLASH_PAGE_SIZE,
@@ -245,6 +246,9 @@ static struct flash_spec flash_5709 = {
 
 MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
 
+static void bnx2_init_napi(struct bnx2 *bp);
+static void bnx2_del_napi(struct bnx2 *bp);
+
 static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
 {
        u32 diff;
@@ -621,6 +625,9 @@ bnx2_disable_int_sync(struct bnx2 *bp)
        int i;
 
        atomic_inc(&bp->intr_sem);
+       if (!netif_running(bp->dev))
+               return;
+
        bnx2_disable_int(bp);
        for (i = 0; i < bp->irq_nvecs; i++)
                synchronize_irq(bp->irq_tbl[i].vector);
@@ -645,26 +652,32 @@ bnx2_napi_enable(struct bnx2 *bp)
 }
 
 static void
-bnx2_netif_stop(struct bnx2 *bp)
+bnx2_netif_stop(struct bnx2 *bp, bool stop_cnic)
 {
-       bnx2_cnic_stop(bp);
-       bnx2_disable_int_sync(bp);
+       if (stop_cnic)
+               bnx2_cnic_stop(bp);
        if (netif_running(bp->dev)) {
                bnx2_napi_disable(bp);
                netif_tx_disable(bp->dev);
-               bp->dev->trans_start = jiffies; /* prevent tx timeout */
        }
+       bnx2_disable_int_sync(bp);
+       netif_carrier_off(bp->dev);     /* prevent tx timeout */
 }
 
 static void
-bnx2_netif_start(struct bnx2 *bp)
+bnx2_netif_start(struct bnx2 *bp, bool start_cnic)
 {
        if (atomic_dec_and_test(&bp->intr_sem)) {
                if (netif_running(bp->dev)) {
                        netif_tx_wake_all_queues(bp->dev);
+                       spin_lock_bh(&bp->phy_lock);
+                       if (bp->link_up)
+                               netif_carrier_on(bp->dev);
+                       spin_unlock_bh(&bp->phy_lock);
                        bnx2_napi_enable(bp);
                        bnx2_enable_int(bp);
-                       bnx2_cnic_start(bp);
+                       if (start_cnic)
+                               bnx2_cnic_start(bp);
                }
        }
 }
@@ -967,33 +980,27 @@ bnx2_report_link(struct bnx2 *bp)
 {
        if (bp->link_up) {
                netif_carrier_on(bp->dev);
-               printk(KERN_INFO PFX "%s NIC %s Link is Up, ", bp->dev->name,
-                      bnx2_xceiver_str(bp));
-
-               printk("%d Mbps ", bp->line_speed);
-
-               if (bp->duplex == DUPLEX_FULL)
-                       printk("full duplex");
-               else
-                       printk("half duplex");
+               netdev_info(bp->dev, "NIC %s Link is Up, %d Mbps %s duplex",
+                           bnx2_xceiver_str(bp),
+                           bp->line_speed,
+                           bp->duplex == DUPLEX_FULL ? "full" : "half");
 
                if (bp->flow_ctrl) {
                        if (bp->flow_ctrl & FLOW_CTRL_RX) {
-                               printk(", receive ");
+                               pr_cont(", receive ");
                                if (bp->flow_ctrl & FLOW_CTRL_TX)
-                                       printk("& transmit ");
+                                       pr_cont("& transmit ");
                        }
                        else {
-                               printk(", transmit ");
+                               pr_cont(", transmit ");
                        }
-                       printk("flow control ON");
+                       pr_cont("flow control ON");
                }
-               printk("\n");
-       }
-       else {
+               pr_cont("\n");
+       } else {
                netif_carrier_off(bp->dev);
-               printk(KERN_ERR PFX "%s NIC %s Link is Down\n", bp->dev->name,
-                      bnx2_xceiver_str(bp));
+               netdev_err(bp->dev, "NIC %s Link is Down\n",
+                          bnx2_xceiver_str(bp));
        }
 
        bnx2_report_fw_link(bp);
@@ -1265,7 +1272,7 @@ bnx2_init_rx_context(struct bnx2 *bp, u32 cid)
                if (lo_water >= bp->rx_ring_size)
                        lo_water = 0;
 
-               hi_water = bp->rx_ring_size / 4;
+               hi_water = min_t(int, bp->rx_ring_size / 4, lo_water + 16);
 
                if (hi_water <= lo_water)
                        lo_water = 0;
@@ -1461,6 +1468,8 @@ bnx2_enable_forced_2g5(struct bnx2 *bp)
        } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
                bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
                bmcr |= BCM5708S_BMCR_FORCE_2500;
+       } else {
+               return;
        }
 
        if (bp->autoneg & AUTONEG_SPEED) {
@@ -1495,6 +1504,8 @@ bnx2_disable_forced_2g5(struct bnx2 *bp)
        } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
                bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
                bmcr &= ~BCM5708S_BMCR_FORCE_2500;
+       } else {
+               return;
        }
 
        if (bp->autoneg & AUTONEG_SPEED)
@@ -2466,8 +2477,7 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int ack, int silent)
        /* If we timed out, inform the firmware that this is the case. */
        if ((val & BNX2_FW_MSG_ACK) != (msg_data & BNX2_DRV_MSG_SEQ)) {
                if (!silent)
-                       printk(KERN_ERR PFX "fw sync timeout, reset code = "
-                                           "%x\n", msg_data);
+                       pr_err("fw sync timeout, reset code = %x\n", msg_data);
 
                msg_data &= ~BNX2_DRV_MSG_CODE;
                msg_data |= BNX2_DRV_MSG_CODE_FW_TIMEOUT;
@@ -2583,8 +2593,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp)
 
        good_mbuf = kmalloc(512 * sizeof(u16), GFP_KERNEL);
        if (good_mbuf == NULL) {
-               printk(KERN_ERR PFX "Failed to allocate memory in "
-                                   "bnx2_alloc_bad_rbuf\n");
+               pr_err("Failed to allocate memory in %s\n", __func__);
                return -ENOMEM;
        }
 
@@ -2660,7 +2669,7 @@ bnx2_alloc_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)
        }
 
        rx_pg->page = page;
-       pci_unmap_addr_set(rx_pg, mapping, mapping);
+       dma_unmap_addr_set(rx_pg, mapping, mapping);
        rxbd->rx_bd_haddr_hi = (u64) mapping >> 32;
        rxbd->rx_bd_haddr_lo = (u64) mapping & 0xffffffff;
        return 0;
@@ -2675,7 +2684,7 @@ bnx2_free_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)
        if (!page)
                return;
 
-       pci_unmap_page(bp->pdev, pci_unmap_addr(rx_pg, mapping), PAGE_SIZE,
+       pci_unmap_page(bp->pdev, dma_unmap_addr(rx_pg, mapping), PAGE_SIZE,
                       PCI_DMA_FROMDEVICE);
 
        __free_page(page);
@@ -2707,7 +2716,8 @@ bnx2_alloc_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)
        }
 
        rx_buf->skb = skb;
-       pci_unmap_addr_set(rx_buf, mapping, mapping);
+       rx_buf->desc = (struct l2_fhdr *) skb->data;
+       dma_unmap_addr_set(rx_buf, mapping, mapping);
 
        rxbd->rx_bd_haddr_hi = (u64) mapping >> 32;
        rxbd->rx_bd_haddr_lo = (u64) mapping & 0xffffffff;
@@ -2806,13 +2816,21 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
                        }
                }
 
-               skb_dma_unmap(&bp->pdev->dev, skb, DMA_TO_DEVICE);
+               pci_unmap_single(bp->pdev, dma_unmap_addr(tx_buf, mapping),
+                       skb_headlen(skb), PCI_DMA_TODEVICE);
 
                tx_buf->skb = NULL;
                last = tx_buf->nr_frags;
 
                for (i = 0; i < last; i++) {
                        sw_cons = NEXT_TX_BD(sw_cons);
+
+                       pci_unmap_page(bp->pdev,
+                               dma_unmap_addr(
+                                       &txr->tx_buf_ring[TX_RING_IDX(sw_cons)],
+                                       mapping),
+                               skb_shinfo(skb)->frags[i].size,
+                               PCI_DMA_TODEVICE);
                }
 
                sw_cons = NEXT_TX_BD(sw_cons);
@@ -2890,8 +2908,8 @@ bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
                if (prod != cons) {
                        prod_rx_pg->page = cons_rx_pg->page;
                        cons_rx_pg->page = NULL;
-                       pci_unmap_addr_set(prod_rx_pg, mapping,
-                               pci_unmap_addr(cons_rx_pg, mapping));
+                       dma_unmap_addr_set(prod_rx_pg, mapping,
+                               dma_unmap_addr(cons_rx_pg, mapping));
 
                        prod_bd->rx_bd_haddr_hi = cons_bd->rx_bd_haddr_hi;
                        prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
@@ -2915,18 +2933,19 @@ bnx2_reuse_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
        prod_rx_buf = &rxr->rx_buf_ring[prod];
 
        pci_dma_sync_single_for_device(bp->pdev,
-               pci_unmap_addr(cons_rx_buf, mapping),
+               dma_unmap_addr(cons_rx_buf, mapping),
                BNX2_RX_OFFSET + BNX2_RX_COPY_THRESH, PCI_DMA_FROMDEVICE);
 
        rxr->rx_prod_bseq += bp->rx_buf_use_size;
 
        prod_rx_buf->skb = skb;
+       prod_rx_buf->desc = (struct l2_fhdr *) skb->data;
 
        if (cons == prod)
                return;
 
-       pci_unmap_addr_set(prod_rx_buf, mapping,
-                       pci_unmap_addr(cons_rx_buf, mapping));
+       dma_unmap_addr_set(prod_rx_buf, mapping,
+                       dma_unmap_addr(cons_rx_buf, mapping));
 
        cons_bd = &rxr->rx_desc_ring[RX_RING(cons)][RX_IDX(cons)];
        prod_bd = &rxr->rx_desc_ring[RX_RING(prod)][RX_IDX(prod)];
@@ -2999,7 +3018,7 @@ bnx2_rx_skb(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, struct sk_buff *skb,
                        /* Don't unmap yet.  If we're unable to allocate a new
                         * page, we need to recycle the page and the DMA addr.
                         */
-                       mapping_old = pci_unmap_addr(rx_pg, mapping);
+                       mapping_old = dma_unmap_addr(rx_pg, mapping);
                        if (i == pages - 1)
                                frag_len -= 4;
 
@@ -3054,6 +3073,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
        u16 hw_cons, sw_cons, sw_ring_cons, sw_prod, sw_ring_prod;
        struct l2_fhdr *rx_hdr;
        int rx_pkt = 0, pg_ring_used = 0;
+       struct pci_dev *pdev = bp->pdev;
 
        hw_cons = bnx2_get_hw_rx_cons(bnapi);
        sw_cons = rxr->rx_cons;
@@ -3066,7 +3086,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
        while (sw_cons != hw_cons) {
                unsigned int len, hdr_len;
                u32 status;
-               struct sw_bd *rx_buf;
+               struct sw_bd *rx_buf, *next_rx_buf;
                struct sk_buff *skb;
                dma_addr_t dma_addr;
                u16 vtag = 0;
@@ -3077,16 +3097,23 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 
                rx_buf = &rxr->rx_buf_ring[sw_ring_cons];
                skb = rx_buf->skb;
+               prefetchw(skb);
 
+               if (!get_dma_ops(&pdev->dev)->sync_single_for_cpu) {
+                       next_rx_buf =
+                               &rxr->rx_buf_ring[
+                                       RX_RING_IDX(NEXT_RX_BD(sw_cons))];
+                       prefetch(next_rx_buf->desc);
+               }
                rx_buf->skb = NULL;
 
-               dma_addr = pci_unmap_addr(rx_buf, mapping);
+               dma_addr = dma_unmap_addr(rx_buf, mapping);
 
                pci_dma_sync_single_for_cpu(bp->pdev, dma_addr,
                        BNX2_RX_OFFSET + BNX2_RX_COPY_THRESH,
                        PCI_DMA_FROMDEVICE);
 
-               rx_hdr = (struct l2_fhdr *) skb->data;
+               rx_hdr = rx_buf->desc;
                len = rx_hdr->l2_fhdr_pkt_len;
                status = rx_hdr->l2_fhdr_status;
 
@@ -3187,10 +3214,10 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget)
 
 #ifdef BCM_VLAN
                if (hw_vlan)
-                       vlan_hwaccel_receive_skb(skb, bp->vlgrp, vtag);
+                       vlan_gro_receive(&bnapi->napi, bp->vlgrp, vtag, skb);
                else
 #endif
-                       netif_receive_skb(skb);
+                       napi_gro_receive(&bnapi->napi, skb);
 
                rx_pkt++;
 
@@ -3528,7 +3555,6 @@ bnx2_set_rx_mode(struct net_device *dev)
        }
        else {
                /* Accept one or more multicast(s). */
-               struct dev_mc_list *mclist;
                u32 mc_filter[NUM_MC_HASH_REGISTERS];
                u32 regidx;
                u32 bit;
@@ -3536,10 +3562,8 @@ bnx2_set_rx_mode(struct net_device *dev)
 
                memset(mc_filter, 0, 4 * NUM_MC_HASH_REGISTERS);
 
-               for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-                    i++, mclist = mclist->next) {
-
-                       crc = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
+               netdev_for_each_mc_addr(ha, dev) {
+                       crc = ether_crc_le(ETH_ALEN, ha->addr);
                        bit = crc & 0xff;
                        regidx = (bit & 0xe0) >> 5;
                        bit &= 0x1f;
@@ -3554,14 +3578,14 @@ bnx2_set_rx_mode(struct net_device *dev)
                sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;
        }
 
-       if (dev->uc.count > BNX2_MAX_UNICAST_ADDRESSES) {
+       if (netdev_uc_count(dev) > BNX2_MAX_UNICAST_ADDRESSES) {
                rx_mode |= BNX2_EMAC_RX_MODE_PROMISCUOUS;
                sort_mode |= BNX2_RPM_SORT_USER0_PROM_EN |
                             BNX2_RPM_SORT_USER0_PROM_VLAN;
        } else if (!(dev->flags & IFF_PROMISC)) {
                /* Add all entries into to the match filter list */
                i = 0;
-               list_for_each_entry(ha, &dev->uc.list, list) {
+               netdev_for_each_uc_addr(ha, dev) {
                        bnx2_set_mac_addr(bp, ha->addr,
                                          i + BNX2_START_UNICAST_ADDRESS_INDEX);
                        sort_mode |= (1 <<
@@ -3620,7 +3644,11 @@ bnx2_request_firmware(struct bnx2 *bp)
 
        if (CHIP_NUM(bp) == CHIP_NUM_5709) {
                mips_fw_file = FW_MIPS_FILE_09;
-               rv2p_fw_file = FW_RV2P_FILE_09;
+               if ((CHIP_ID(bp) == CHIP_ID_5709_A0) ||
+                   (CHIP_ID(bp) == CHIP_ID_5709_A1))
+                       rv2p_fw_file = FW_RV2P_FILE_09_Ax;
+               else
+                       rv2p_fw_file = FW_RV2P_FILE_09;
        } else {
                mips_fw_file = FW_MIPS_FILE_06;
                rv2p_fw_file = FW_RV2P_FILE_06;
@@ -3628,15 +3656,13 @@ bnx2_request_firmware(struct bnx2 *bp)
 
        rc = request_firmware(&bp->mips_firmware, mips_fw_file, &bp->pdev->dev);
        if (rc) {
-               printk(KERN_ERR PFX "Can't load firmware file \"%s\"\n",
-                      mips_fw_file);
+               pr_err("Can't load firmware file \"%s\"\n", mips_fw_file);
                return rc;
        }
 
        rc = request_firmware(&bp->rv2p_firmware, rv2p_fw_file, &bp->pdev->dev);
        if (rc) {
-               printk(KERN_ERR PFX "Can't load firmware file \"%s\"\n",
-                      rv2p_fw_file);
+               pr_err("Can't load firmware file \"%s\"\n", rv2p_fw_file);
                return rc;
        }
        mips_fw = (const struct bnx2_mips_fw_file *) bp->mips_firmware->data;
@@ -3647,15 +3673,13 @@ bnx2_request_firmware(struct bnx2 *bp)
            check_mips_fw_entry(bp->mips_firmware, &mips_fw->rxp) ||
            check_mips_fw_entry(bp->mips_firmware, &mips_fw->tpat) ||
            check_mips_fw_entry(bp->mips_firmware, &mips_fw->txp)) {
-               printk(KERN_ERR PFX "Firmware file \"%s\" is invalid\n",
-                      mips_fw_file);
+               pr_err("Firmware file \"%s\" is invalid\n", mips_fw_file);
                return -EINVAL;
        }
        if (bp->rv2p_firmware->size < sizeof(*rv2p_fw) ||
            check_fw_section(bp->rv2p_firmware, &rv2p_fw->proc1.rv2p, 8, true) ||
            check_fw_section(bp->rv2p_firmware, &rv2p_fw->proc2.rv2p, 8, true)) {
-               printk(KERN_ERR PFX "Firmware file \"%s\" is invalid\n",
-                      rv2p_fw_file);
+               pr_err("Firmware file \"%s\" is invalid\n", rv2p_fw_file);
                return -EINVAL;
        }
 
@@ -4226,7 +4250,7 @@ bnx2_init_nvram(struct bnx2 *bp)
 {
        u32 val;
        int j, entry_count, rc = 0;
-       struct flash_spec *flash;
+       const struct flash_spec *flash;
 
        if (CHIP_NUM(bp) == CHIP_NUM_5709) {
                bp->flash_info = &flash_5709;
@@ -4289,7 +4313,7 @@ bnx2_init_nvram(struct bnx2 *bp)
 
        if (j == entry_count) {
                bp->flash_info = NULL;
-               printk(KERN_ALERT PFX "Unknown flash/EEPROM type.\n");
+               pr_alert("Unknown flash/EEPROM type\n");
                return -ENODEV;
        }
 
@@ -4709,7 +4733,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
 
                if (val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
                           BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) {
-                       printk(KERN_ERR PFX "Chip reset did not complete\n");
+                       pr_err("Chip reset did not complete\n");
                        return -EBUSY;
                }
        }
@@ -4717,7 +4741,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
        /* Make sure byte swapping is properly configured. */
        val = REG_RD(bp, BNX2_PCI_SWAP_DIAG0);
        if (val != 0x01020304) {
-               printk(KERN_ERR PFX "Chip not in correct endian mode\n");
+               pr_err("Chip not in correct endian mode\n");
                return -ENODEV;
        }
 
@@ -4743,8 +4767,12 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
                rc = bnx2_alloc_bad_rbuf(bp);
        }
 
-       if (bp->flags & BNX2_FLAG_USING_MSIX)
+       if (bp->flags & BNX2_FLAG_USING_MSIX) {
                bnx2_setup_msix_tbl(bp);
+               /* Prevent MSIX table reads and write from timing out */
+               REG_WR(bp, BNX2_MISC_ECO_HW_CTL,
+                       BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);
+       }
 
        return rc;
 }
@@ -4860,6 +4888,7 @@ bnx2_init_chip(struct bnx2 *bp)
        bnx2_reg_wr_ind(bp, BNX2_RBUF_CONFIG2, BNX2_RBUF_CONFIG2_VAL(mtu));
        bnx2_reg_wr_ind(bp, BNX2_RBUF_CONFIG3, BNX2_RBUF_CONFIG3_VAL(mtu));
 
+       memset(bp->bnx2_napi[0].status_blk.msi, 0, bp->status_stats_size);
        for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
                bp->bnx2_napi[i].last_status_idx = 0;
 
@@ -4898,7 +4927,7 @@ bnx2_init_chip(struct bnx2 *bp)
        REG_WR(bp, BNX2_HC_CMD_TICKS,
               (bp->cmd_ticks_int << 16) | bp->cmd_ticks);
 
-       if (CHIP_NUM(bp) == CHIP_NUM_5708)
+       if (bp->flags & BNX2_FLAG_BROKEN_STATS)
                REG_WR(bp, BNX2_HC_STATS_TICKS, 0);
        else
                REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);
@@ -4911,7 +4940,7 @@ bnx2_init_chip(struct bnx2 *bp)
                      BNX2_HC_CONFIG_COLLECT_STATS;
        }
 
-       if (bp->irq_nvecs > 1) {
+       if (bp->flags & BNX2_FLAG_USING_MSIX) {
                REG_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,
                       BNX2_HC_MSIX_BIT_VECTOR_VAL);
 
@@ -4919,7 +4948,7 @@ bnx2_init_chip(struct bnx2 *bp)
        }
 
        if (bp->flags & BNX2_FLAG_ONE_SHOT_MSI)
-               val |= BNX2_HC_CONFIG_ONE_SHOT;
+               val |= BNX2_HC_CONFIG_ONE_SHOT | BNX2_HC_CONFIG_USE_INT_PARAM;
 
        REG_WR(bp, BNX2_HC_CONFIG, val);
 
@@ -5136,8 +5165,11 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num)
 
        ring_prod = prod = rxr->rx_pg_prod;
        for (i = 0; i < bp->rx_pg_ring_size; i++) {
-               if (bnx2_alloc_rx_page(bp, rxr, ring_prod) < 0)
+               if (bnx2_alloc_rx_page(bp, rxr, ring_prod) < 0) {
+                       netdev_warn(bp->dev, "init'ed rx page ring %d with %d/%d pages only\n",
+                                   ring_num, i, bp->rx_pg_ring_size);
                        break;
+               }
                prod = NEXT_RX_BD(prod);
                ring_prod = RX_PG_RING_IDX(prod);
        }
@@ -5145,8 +5177,11 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num)
 
        ring_prod = prod = rxr->rx_prod;
        for (i = 0; i < bp->rx_ring_size; i++) {
-               if (bnx2_alloc_rx_skb(bp, rxr, ring_prod) < 0)
+               if (bnx2_alloc_rx_skb(bp, rxr, ring_prod) < 0) {
+                       netdev_warn(bp->dev, "init'ed rx ring %d with %d/%d skbs only\n",
+                                   ring_num, i, bp->rx_ring_size);
                        break;
+               }
                prod = NEXT_RX_BD(prod);
                ring_prod = RX_RING_IDX(prod);
        }
@@ -5281,17 +5316,29 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
                for (j = 0; j < TX_DESC_CNT; ) {
                        struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
                        struct sk_buff *skb = tx_buf->skb;
+                       int k, last;
 
                        if (skb == NULL) {
                                j++;
                                continue;
                        }
 
-                       skb_dma_unmap(&bp->pdev->dev, skb, DMA_TO_DEVICE);
+                       pci_unmap_single(bp->pdev,
+                                        dma_unmap_addr(tx_buf, mapping),
+                                        skb_headlen(skb),
+                                        PCI_DMA_TODEVICE);
 
                        tx_buf->skb = NULL;
 
-                       j += skb_shinfo(skb)->nr_frags + 1;
+                       last = tx_buf->nr_frags;
+                       j++;
+                       for (k = 0; k < last; k++, j++) {
+                               tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
+                               pci_unmap_page(bp->pdev,
+                                       dma_unmap_addr(tx_buf, mapping),
+                                       skb_shinfo(skb)->frags[k].size,
+                                       PCI_DMA_TODEVICE);
+                       }
                        dev_kfree_skb(skb);
                }
        }
@@ -5318,7 +5365,7 @@ bnx2_free_rx_skbs(struct bnx2 *bp)
                                continue;
 
                        pci_unmap_single(bp->pdev,
-                                        pci_unmap_addr(rx_buf, mapping),
+                                        dma_unmap_addr(rx_buf, mapping),
                                         bp->rx_buf_use_size,
                                         PCI_DMA_FROMDEVICE);
 
@@ -5670,11 +5717,12 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
        for (i = 14; i < pkt_size; i++)
                packet[i] = (unsigned char) (i & 0xff);
 
-       if (skb_dma_map(&bp->pdev->dev, skb, DMA_TO_DEVICE)) {
+       map = pci_map_single(bp->pdev, skb->data, pkt_size,
+               PCI_DMA_TODEVICE);
+       if (pci_dma_mapping_error(bp->pdev, map)) {
                dev_kfree_skb(skb);
                return -EIO;
        }
-       map = skb_shinfo(skb)->dma_head;
 
        REG_WR(bp, BNX2_HC_COMMAND,
               bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
@@ -5709,7 +5757,7 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
 
        udelay(5);
 
-       skb_dma_unmap(&bp->pdev->dev, skb, DMA_TO_DEVICE);
+       pci_unmap_single(bp->pdev, map, pkt_size, PCI_DMA_TODEVICE);
        dev_kfree_skb(skb);
 
        if (bnx2_get_hw_tx_cons(tx_napi) != txr->tx_prod)
@@ -5723,11 +5771,11 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode)
        rx_buf = &rxr->rx_buf_ring[rx_start_idx];
        rx_skb = rx_buf->skb;
 
-       rx_hdr = (struct l2_fhdr *) rx_skb->data;
+       rx_hdr = rx_buf->desc;
        skb_reserve(rx_skb, BNX2_RX_OFFSET);
 
        pci_dma_sync_single_for_cpu(bp->pdev,
-               pci_unmap_addr(rx_buf, mapping),
+               dma_unmap_addr(rx_buf, mapping),
                bp->rx_buf_size, PCI_DMA_FROMDEVICE);
 
        if (rx_hdr->l2_fhdr_status &
@@ -6023,7 +6071,7 @@ bnx2_timer(unsigned long data)
                bnx2_reg_rd_ind(bp, BNX2_FW_RX_DROP_COUNT);
 
        /* workaround occasional corrupted counters */
-       if (CHIP_NUM(bp) == CHIP_NUM_5708 && bp->stats_ticks)
+       if ((bp->flags & BNX2_FLAG_BROKEN_STATS) && bp->stats_ticks)
                REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
                                            BNX2_HC_COMMAND_STATS_NOW);
 
@@ -6094,6 +6142,10 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
        REG_WR(bp, BNX2_PCI_MSIX_TBL_OFF_BIR, BNX2_PCI_GRC_WINDOW2_BASE);
        REG_WR(bp, BNX2_PCI_MSIX_PBA_OFF_BIT, BNX2_PCI_GRC_WINDOW3_BASE);
 
+       /*  Need to flush the previous three writes to ensure MSI-X
+        *  is setup properly */
+       REG_RD(bp, BNX2_PCI_MSIX_CONTROL);
+
        for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
                msix_ent[i].entry = i;
                msix_ent[i].vector = 0;
@@ -6159,6 +6211,7 @@ bnx2_open(struct net_device *dev)
        bnx2_disable_int(bp);
 
        bnx2_setup_int_mode(bp, disable_msi);
+       bnx2_init_napi(bp);
        bnx2_napi_enable(bp);
        rc = bnx2_alloc_mem(bp);
        if (rc)
@@ -6176,6 +6229,8 @@ bnx2_open(struct net_device *dev)
 
        atomic_set(&bp->intr_sem, 0);
 
+       memset(bp->temp_stats_blk, 0, sizeof(struct statistics_block));
+
        bnx2_enable_int(bp);
 
        if (bp->flags & BNX2_FLAG_USING_MSI) {
@@ -6183,11 +6238,7 @@ bnx2_open(struct net_device *dev)
                 * If MSI test fails, go back to INTx mode
                 */
                if (bnx2_test_intr(bp) != 0) {
-                       printk(KERN_WARNING PFX "%s: No interrupt was generated"
-                              " using MSI, switching to INTx mode. Please"
-                              " report this failure to the PCI maintainer"
-                              " and include system chipset information.\n",
-                              bp->dev->name);
+                       netdev_warn(bp->dev, "No interrupt was generated using MSI, switching to INTx mode. Please report this failure to the PCI maintainer and include system chipset information.\n");
 
                        bnx2_disable_int(bp);
                        bnx2_free_irq(bp);
@@ -6207,9 +6258,9 @@ bnx2_open(struct net_device *dev)
                }
        }
        if (bp->flags & BNX2_FLAG_USING_MSI)
-               printk(KERN_INFO PFX "%s: using MSI\n", dev->name);
+               netdev_info(dev, "using MSI\n");
        else if (bp->flags & BNX2_FLAG_USING_MSIX)
-               printk(KERN_INFO PFX "%s: using MSIX\n", dev->name);
+               netdev_info(dev, "using MSIX\n");
 
        netif_tx_start_all_queues(dev);
 
@@ -6220,6 +6271,7 @@ open_err:
        bnx2_free_skbs(bp);
        bnx2_free_irq(bp);
        bnx2_free_mem(bp);
+       bnx2_del_napi(bp);
        return rc;
 }
 
@@ -6228,15 +6280,47 @@ bnx2_reset_task(struct work_struct *work)
 {
        struct bnx2 *bp = container_of(work, struct bnx2, reset_task);
 
-       if (!netif_running(bp->dev))
+       rtnl_lock();
+       if (!netif_running(bp->dev)) {
+               rtnl_unlock();
                return;
+       }
 
-       bnx2_netif_stop(bp);
+       bnx2_netif_stop(bp, true);
 
        bnx2_init_nic(bp, 1);
 
        atomic_set(&bp->intr_sem, 1);
-       bnx2_netif_start(bp);
+       bnx2_netif_start(bp, true);
+       rtnl_unlock();
+}
+
+static void
+bnx2_dump_state(struct bnx2 *bp)
+{
+       struct net_device *dev = bp->dev;
+       u32 mcp_p0, mcp_p1;
+
+       netdev_err(dev, "DEBUG: intr_sem[%x]\n", atomic_read(&bp->intr_sem));
+       netdev_err(dev, "DEBUG: EMAC_TX_STATUS[%08x] EMAC_RX_STATUS[%08x]\n",
+                  REG_RD(bp, BNX2_EMAC_TX_STATUS),
+                  REG_RD(bp, BNX2_EMAC_RX_STATUS));
+       netdev_err(dev, "DEBUG: RPM_MGMT_PKT_CTRL[%08x]\n",
+                  REG_RD(bp, BNX2_RPM_MGMT_PKT_CTRL));
+       if (CHIP_NUM(bp) == CHIP_NUM_5709) {
+               mcp_p0 = BNX2_MCP_STATE_P0;
+               mcp_p1 = BNX2_MCP_STATE_P1;
+       } else {
+               mcp_p0 = BNX2_MCP_STATE_P0_5708;
+               mcp_p1 = BNX2_MCP_STATE_P1_5708;
+       }
+       netdev_err(dev, "DEBUG: MCP_STATE_P0[%08x] MCP_STATE_P1[%08x]\n",
+                  bnx2_reg_rd_ind(bp, mcp_p0), bnx2_reg_rd_ind(bp, mcp_p1));
+       netdev_err(dev, "DEBUG: HC_STATS_INTERRUPT_STATUS[%08x]\n",
+                  REG_RD(bp, BNX2_HC_STATS_INTERRUPT_STATUS));
+       if (bp->flags & BNX2_FLAG_USING_MSIX)
+               netdev_err(dev, "DEBUG: PBA[%08x]\n",
+                          REG_RD(bp, BNX2_PCI_GRC_WINDOW3_BASE));
 }
 
 static void
@@ -6244,6 +6328,8 @@ bnx2_tx_timeout(struct net_device *dev)
 {
        struct bnx2 *bp = netdev_priv(dev);
 
+       bnx2_dump_state(bp);
+
        /* This allows the netif to be shutdown gracefully before resetting */
        schedule_work(&bp->reset_task);
 }
@@ -6255,14 +6341,19 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
 {
        struct bnx2 *bp = netdev_priv(dev);
 
-       bnx2_netif_stop(bp);
+       if (netif_running(dev))
+               bnx2_netif_stop(bp, false);
 
        bp->vlgrp = vlgrp;
+
+       if (!netif_running(dev))
+               return;
+
        bnx2_set_rx_mode(dev);
        if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN)
                bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1);
 
-       bnx2_netif_start(bp);
+       bnx2_netif_start(bp, false);
 }
 #endif
 
@@ -6270,7 +6361,7 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
  * bnx2_tx_int() runs without netif_tx_lock unless it needs to call
  * netif_wake_queue().
  */
-static int
+static netdev_tx_t
 bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct bnx2 *bp = netdev_priv(dev);
@@ -6283,7 +6374,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        struct bnx2_napi *bnapi;
        struct bnx2_tx_ring_info *txr;
        struct netdev_queue *txq;
-       struct skb_shared_info *sp;
 
        /*  Determine which tx ring we will be placed on */
        i = skb_get_queue_mapping(skb);
@@ -6294,8 +6384,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        if (unlikely(bnx2_tx_avail(bp, txr) <
            (skb_shinfo(skb)->nr_frags + 1))) {
                netif_tx_stop_queue(txq);
-               printk(KERN_ERR PFX "%s: BUG! Tx ring full when queue awake!\n",
-                       dev->name);
+               netdev_err(dev, "BUG! Tx ring full when queue awake!\n");
 
                return NETDEV_TX_BUSY;
        }
@@ -6348,16 +6437,15 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        } else
                mss = 0;
 
-       if (skb_dma_map(&bp->pdev->dev, skb, DMA_TO_DEVICE)) {
+       mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
+       if (pci_dma_mapping_error(bp->pdev, mapping)) {
                dev_kfree_skb(skb);
                return NETDEV_TX_OK;
        }
 
-       sp = skb_shinfo(skb);
-       mapping = sp->dma_head;
-
        tx_buf = &txr->tx_buf_ring[ring_prod];
        tx_buf->skb = skb;
+       dma_unmap_addr_set(tx_buf, mapping, mapping);
 
        txbd = &txr->tx_desc_ring[ring_prod];
 
@@ -6378,7 +6466,12 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
                txbd = &txr->tx_desc_ring[ring_prod];
 
                len = frag->size;
-               mapping = sp->dma_maps[i];
+               mapping = pci_map_page(bp->pdev, frag->page, frag->page_offset,
+                       len, PCI_DMA_TODEVICE);
+               if (pci_dma_mapping_error(bp->pdev, mapping))
+                       goto dma_error;
+               dma_unmap_addr_set(&txr->tx_buf_ring[ring_prod], mapping,
+                                  mapping);
 
                txbd->tx_bd_haddr_hi = (u64) mapping >> 32;
                txbd->tx_bd_haddr_lo = (u64) mapping & 0xffffffff;
@@ -6405,6 +6498,30 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        return NETDEV_TX_OK;
+dma_error:
+       /* save value of frag that failed */
+       last_frag = i;
+
+       /* start back at beginning and unmap skb */
+       prod = txr->tx_prod;
+       ring_prod = TX_RING_IDX(prod);
+       tx_buf = &txr->tx_buf_ring[ring_prod];
+       tx_buf->skb = NULL;
+       pci_unmap_single(bp->pdev, dma_unmap_addr(tx_buf, mapping),
+                        skb_headlen(skb), PCI_DMA_TODEVICE);
+
+       /* unmap remaining mapped pages */
+       for (i = 0; i < last_frag; i++) {
+               prod = NEXT_TX_BD(prod);
+               ring_prod = TX_RING_IDX(prod);
+               tx_buf = &txr->tx_buf_ring[ring_prod];
+               pci_unmap_page(bp->pdev, dma_unmap_addr(tx_buf, mapping),
+                              skb_shinfo(skb)->frags[i].size,
+                              PCI_DMA_TODEVICE);
+       }
+
+       dev_kfree_skb(skb);
+       return NETDEV_TX_OK;
 }
 
 /* Called with rtnl_lock */
@@ -6422,97 +6539,128 @@ bnx2_close(struct net_device *dev)
        bnx2_free_irq(bp);
        bnx2_free_skbs(bp);
        bnx2_free_mem(bp);
+       bnx2_del_napi(bp);
        bp->link_up = 0;
        netif_carrier_off(bp->dev);
        bnx2_set_power_state(bp, PCI_D3hot);
        return 0;
 }
 
-#define GET_NET_STATS64(ctr)                                   \
+static void
+bnx2_save_stats(struct bnx2 *bp)
+{
+       u32 *hw_stats = (u32 *) bp->stats_blk;
+       u32 *temp_stats = (u32 *) bp->temp_stats_blk;
+       int i;
+
+       /* The 1st 10 counters are 64-bit counters */
+       for (i = 0; i < 20; i += 2) {
+               u32 hi;
+               u64 lo;
+
+               hi = temp_stats[i] + hw_stats[i];
+               lo = (u64) temp_stats[i + 1] + (u64) hw_stats[i + 1];
+               if (lo > 0xffffffff)
+                       hi++;
+               temp_stats[i] = hi;
+               temp_stats[i + 1] = lo & 0xffffffff;
+       }
+
+       for ( ; i < sizeof(struct statistics_block) / 4; i++)
+               temp_stats[i] += hw_stats[i];
+}
+
+#define GET_64BIT_NET_STATS64(ctr)                             \
        (unsigned long) ((unsigned long) (ctr##_hi) << 32) +    \
        (unsigned long) (ctr##_lo)
 
-#define GET_NET_STATS32(ctr)           \
+#define GET_64BIT_NET_STATS32(ctr)                             \
        (ctr##_lo)
 
 #if (BITS_PER_LONG == 64)
-#define GET_NET_STATS  GET_NET_STATS64
+#define GET_64BIT_NET_STATS(ctr)                               \
+       GET_64BIT_NET_STATS64(bp->stats_blk->ctr) +             \
+       GET_64BIT_NET_STATS64(bp->temp_stats_blk->ctr)
 #else
-#define GET_NET_STATS  GET_NET_STATS32
+#define GET_64BIT_NET_STATS(ctr)                               \
+       GET_64BIT_NET_STATS32(bp->stats_blk->ctr) +             \
+       GET_64BIT_NET_STATS32(bp->temp_stats_blk->ctr)
 #endif
 
+#define GET_32BIT_NET_STATS(ctr)                               \
+       (unsigned long) (bp->stats_blk->ctr +                   \
+                        bp->temp_stats_blk->ctr)
+
 static struct net_device_stats *
 bnx2_get_stats(struct net_device *dev)
 {
        struct bnx2 *bp = netdev_priv(dev);
-       struct statistics_block *stats_blk = bp->stats_blk;
        struct net_device_stats *net_stats = &dev->stats;
 
        if (bp->stats_blk == NULL) {
                return net_stats;
        }
        net_stats->rx_packets =
-               GET_NET_STATS(stats_blk->stat_IfHCInUcastPkts) +
-               GET_NET_STATS(stats_blk->stat_IfHCInMulticastPkts) +
-               GET_NET_STATS(stats_blk->stat_IfHCInBroadcastPkts);
+               GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) +
+               GET_64BIT_NET_STATS(stat_IfHCInMulticastPkts) +
+               GET_64BIT_NET_STATS(stat_IfHCInBroadcastPkts);
 
        net_stats->tx_packets =
-               GET_NET_STATS(stats_blk->stat_IfHCOutUcastPkts) +
-               GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts) +
-               GET_NET_STATS(stats_blk->stat_IfHCOutBroadcastPkts);
+               GET_64BIT_NET_STATS(stat_IfHCOutUcastPkts) +
+               GET_64BIT_NET_STATS(stat_IfHCOutMulticastPkts) +
+               GET_64BIT_NET_STATS(stat_IfHCOutBroadcastPkts);
 
        net_stats->rx_bytes =
-               GET_NET_STATS(stats_blk->stat_IfHCInOctets);
+               GET_64BIT_NET_STATS(stat_IfHCInOctets);
 
        net_stats->tx_bytes =
-               GET_NET_STATS(stats_blk->stat_IfHCOutOctets);
+               GET_64BIT_NET_STATS(stat_IfHCOutOctets);
 
        net_stats->multicast =
-               GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts);
+               GET_64BIT_NET_STATS(stat_IfHCOutMulticastPkts);
 
        net_stats->collisions =
-               (unsigned long) stats_blk->stat_EtherStatsCollisions;
+               GET_32BIT_NET_STATS(stat_EtherStatsCollisions);
 
        net_stats->rx_length_errors =
-               (unsigned long) (stats_blk->stat_EtherStatsUndersizePkts +
-               stats_blk->stat_EtherStatsOverrsizePkts);
+               GET_32BIT_NET_STATS(stat_EtherStatsUndersizePkts) +
+               GET_32BIT_NET_STATS(stat_EtherStatsOverrsizePkts);
 
        net_stats->rx_over_errors =
-               (unsigned long) stats_blk->stat_IfInMBUFDiscards;
+               GET_32BIT_NET_STATS(stat_IfInFTQDiscards) +
+               GET_32BIT_NET_STATS(stat_IfInMBUFDiscards);
 
        net_stats->rx_frame_errors =
-               (unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors;
+               GET_32BIT_NET_STATS(stat_Dot3StatsAlignmentErrors);
 
        net_stats->rx_crc_errors =
-               (unsigned long) stats_blk->stat_Dot3StatsFCSErrors;
+               GET_32BIT_NET_STATS(stat_Dot3StatsFCSErrors);
 
        net_stats->rx_errors = net_stats->rx_length_errors +
                net_stats->rx_over_errors + net_stats->rx_frame_errors +
                net_stats->rx_crc_errors;
 
        net_stats->tx_aborted_errors =
-               (unsigned long) (stats_blk->stat_Dot3StatsExcessiveCollisions +
-               stats_blk->stat_Dot3StatsLateCollisions);
+               GET_32BIT_NET_STATS(stat_Dot3StatsExcessiveCollisions) +
+               GET_32BIT_NET_STATS(stat_Dot3StatsLateCollisions);
 
        if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||
            (CHIP_ID(bp) == CHIP_ID_5708_A0))
                net_stats->tx_carrier_errors = 0;
        else {
                net_stats->tx_carrier_errors =
-                       (unsigned long)
-                       stats_blk->stat_Dot3StatsCarrierSenseErrors;
+                       GET_32BIT_NET_STATS(stat_Dot3StatsCarrierSenseErrors);
        }
 
        net_stats->tx_errors =
-               (unsigned long)
-               stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors
-               +
+               GET_32BIT_NET_STATS(stat_emac_tx_stat_dot3statsinternalmactransmiterrors) +
                net_stats->tx_aborted_errors +
                net_stats->tx_carrier_errors;
 
        net_stats->rx_missed_errors =
-               (unsigned long) (stats_blk->stat_IfInMBUFDiscards +
-               stats_blk->stat_FwRxDrop);
+               GET_32BIT_NET_STATS(stat_IfInFTQDiscards) +
+               GET_32BIT_NET_STATS(stat_IfInMBUFDiscards) +
+               GET_32BIT_NET_STATS(stat_FwRxDrop);
 
        return net_stats;
 }
@@ -6606,32 +6754,15 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
        if (cmd->autoneg == AUTONEG_ENABLE) {
                autoneg |= AUTONEG_SPEED;
 
-               cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED;
-
-               /* allow advertising 1 speed */
-               if ((cmd->advertising == ADVERTISED_10baseT_Half) ||
-                       (cmd->advertising == ADVERTISED_10baseT_Full) ||
-                       (cmd->advertising == ADVERTISED_100baseT_Half) ||
-                       (cmd->advertising == ADVERTISED_100baseT_Full)) {
-
-                       if (cmd->port == PORT_FIBRE)
-                               goto err_out_unlock;
-
-                       advertising = cmd->advertising;
-
-               } else if (cmd->advertising == ADVERTISED_2500baseX_Full) {
-                       if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE) ||
-                           (cmd->port == PORT_TP))
-                               goto err_out_unlock;
-               } else if (cmd->advertising == ADVERTISED_1000baseT_Full)
-                       advertising = cmd->advertising;
-               else if (cmd->advertising == ADVERTISED_1000baseT_Half)
-                       goto err_out_unlock;
-               else {
-                       if (cmd->port == PORT_FIBRE)
-                               advertising = ETHTOOL_ALL_FIBRE_SPEED;
-                       else
+               advertising = cmd->advertising;
+               if (cmd->port == PORT_TP) {
+                       advertising &= ETHTOOL_ALL_COPPER_SPEED;
+                       if (!advertising)
                                advertising = ETHTOOL_ALL_COPPER_SPEED;
+               } else {
+                       advertising &= ETHTOOL_ALL_FIBRE_SPEED;
+                       if (!advertising)
+                               advertising = ETHTOOL_ALL_FIBRE_SPEED;
                }
                advertising |= ADVERTISED_Autoneg;
        }
@@ -6934,7 +7065,7 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
                0xff;
 
        bp->stats_ticks = coal->stats_block_coalesce_usecs;
-       if (CHIP_NUM(bp) == CHIP_NUM_5708) {
+       if (bp->flags & BNX2_FLAG_BROKEN_STATS) {
                if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC)
                        bp->stats_ticks = USEC_PER_SEC;
        }
@@ -6943,9 +7074,9 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
        bp->stats_ticks &= BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
 
        if (netif_running(bp->dev)) {
-               bnx2_netif_stop(bp);
+               bnx2_netif_stop(bp, true);
                bnx2_init_nic(bp, 0);
-               bnx2_netif_start(bp);
+               bnx2_netif_start(bp, true);
        }
 
        return 0;
@@ -6972,7 +7103,10 @@ static int
 bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
 {
        if (netif_running(bp->dev)) {
-               bnx2_netif_stop(bp);
+               /* Reset will erase chipset stats; save them */
+               bnx2_save_stats(bp);
+
+               bnx2_netif_stop(bp, true);
                bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
                bnx2_free_skbs(bp);
                bnx2_free_mem(bp);
@@ -6985,10 +7119,22 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
                int rc;
 
                rc = bnx2_alloc_mem(bp);
-               if (rc)
+               if (!rc)
+                       rc = bnx2_init_nic(bp, 0);
+
+               if (rc) {
+                       bnx2_napi_enable(bp);
+                       dev_close(bp->dev);
                        return rc;
-               bnx2_init_nic(bp, 0);
-               bnx2_netif_start(bp);
+               }
+#ifdef BCM_CNIC
+               mutex_lock(&bp->cnic_lock);
+               /* Let cnic know about the new status block. */
+               if (bp->cnic_eth_dev.drv_state & CNIC_DRV_STATE_REGD)
+                       bnx2_setup_cnic_irq_info(bp);
+               mutex_unlock(&bp->cnic_lock);
+#endif
+               bnx2_netif_start(bp, true);
        }
        return 0;
 }
@@ -7078,11 +7224,9 @@ bnx2_set_tso(struct net_device *dev, u32 data)
        return 0;
 }
 
-#define BNX2_NUM_STATS 46
-
 static struct {
        char string[ETH_GSTRING_LEN];
-} bnx2_stats_str_arr[BNX2_NUM_STATS] = {
+} bnx2_stats_str_arr[] = {
        { "rx_bytes" },
        { "rx_error_bytes" },
        { "tx_bytes" },
@@ -7127,10 +7271,14 @@ static struct {
        { "tx_xoff_frames" },
        { "rx_mac_ctrl_frames" },
        { "rx_filtered_packets" },
+       { "rx_ftq_discards" },
        { "rx_discards" },
        { "rx_fw_discards" },
 };
 
+#define BNX2_NUM_STATS (sizeof(bnx2_stats_str_arr)/\
+                       sizeof(bnx2_stats_str_arr[0]))
+
 #define STATS_OFFSET32(offset_name) (offsetof(struct statistics_block, offset_name) / 4)
 
 static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = {
@@ -7178,6 +7326,7 @@ static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = {
     STATS_OFFSET32(stat_OutXoffSent),
     STATS_OFFSET32(stat_MacControlFramesReceived),
     STATS_OFFSET32(stat_IfInFramesL2FilterDiscards),
+    STATS_OFFSET32(stat_IfInFTQDiscards),
     STATS_OFFSET32(stat_IfInMBUFDiscards),
     STATS_OFFSET32(stat_FwRxDrop),
 };
@@ -7190,7 +7339,7 @@ static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = {
        4,0,4,4,4,4,4,4,4,4,
        4,4,4,4,4,4,4,4,4,4,
        4,4,4,4,4,4,4,4,4,4,
-       4,4,4,4,4,4,
+       4,4,4,4,4,4,4,
 };
 
 static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = {
@@ -7198,7 +7347,7 @@ static u8 bnx2_5708_stats_len_arr[BNX2_NUM_STATS] = {
        4,4,4,4,4,4,4,4,4,4,
        4,4,4,4,4,4,4,4,4,4,
        4,4,4,4,4,4,4,4,4,4,
-       4,4,4,4,4,4,
+       4,4,4,4,4,4,4,
 };
 
 #define BNX2_NUM_TESTS 6
@@ -7238,7 +7387,7 @@ bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
        if (etest->flags & ETH_TEST_FL_OFFLINE) {
                int i;
 
-               bnx2_netif_stop(bp);
+               bnx2_netif_stop(bp, true);
                bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_DIAG);
                bnx2_free_skbs(bp);
 
@@ -7257,7 +7406,7 @@ bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
                        bnx2_shutdown_chip(bp);
                else {
                        bnx2_init_nic(bp, 1);
-                       bnx2_netif_start(bp);
+                       bnx2_netif_start(bp, true);
                }
 
                /* wait for link up */
@@ -7308,6 +7457,7 @@ bnx2_get_ethtool_stats(struct net_device *dev,
        struct bnx2 *bp = netdev_priv(dev);
        int i;
        u32 *hw_stats = (u32 *) bp->stats_blk;
+       u32 *temp_stats = (u32 *) bp->temp_stats_blk;
        u8 *stats_len_arr = NULL;
 
        if (hw_stats == NULL) {
@@ -7324,21 +7474,26 @@ bnx2_get_ethtool_stats(struct net_device *dev,
                stats_len_arr = bnx2_5708_stats_len_arr;
 
        for (i = 0; i < BNX2_NUM_STATS; i++) {
+               unsigned long offset;
+
                if (stats_len_arr[i] == 0) {
                        /* skip this counter */
                        buf[i] = 0;
                        continue;
                }
+
+               offset = bnx2_stats_offset_arr[i];
                if (stats_len_arr[i] == 4) {
                        /* 4-byte counter */
-                       buf[i] = (u64)
-                               *(hw_stats + bnx2_stats_offset_arr[i]);
+                       buf[i] = (u64) *(hw_stats + offset) +
+                                *(temp_stats + offset);
                        continue;
                }
                /* 8-byte counter */
-               buf[i] = (((u64) *(hw_stats +
-                                       bnx2_stats_offset_arr[i])) << 32) +
-                               *(hw_stats + bnx2_stats_offset_arr[i] + 1);
+               buf[i] = (((u64) *(hw_stats + offset)) << 32) +
+                        *(hw_stats + offset + 1) +
+                        (((u64) *(temp_stats + offset)) << 32) +
+                        *(temp_stats + offset + 1);
        }
 }
 
@@ -7456,9 +7611,6 @@ bnx2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        }
 
        case SIOCSMIIREG:
-               if (!capable(CAP_NET_ADMIN))
-                       return -EPERM;
-
                if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
                        return -EOPNOTSUPP;
 
@@ -7509,7 +7661,7 @@ bnx2_change_mtu(struct net_device *dev, int new_mtu)
        return (bnx2_change_ring_size(bp, bp->rx_ring_size, bp->tx_ring_size));
 }
 
-#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
+#ifdef CONFIG_NET_POLL_CONTROLLER
 static void
 poll_bnx2(struct net_device *dev)
 {
@@ -7517,9 +7669,11 @@ poll_bnx2(struct net_device *dev)
        int i;
 
        for (i = 0; i < bp->irq_nvecs; i++) {
-               disable_irq(bp->irq_tbl[i].vector);
-               bnx2_interrupt(bp->irq_tbl[i].vector, &bp->bnx2_napi[i]);
-               enable_irq(bp->irq_tbl[i].vector);
+               struct bnx2_irq *irq = &bp->irq_tbl[i];
+
+               disable_irq(irq->vector);
+               irq->handler(irq->vector, &bp->bnx2_napi[i]);
+               enable_irq(irq->vector);
        }
 }
 #endif
@@ -7614,6 +7768,74 @@ bnx2_get_pci_speed(struct bnx2 *bp)
 
 }
 
+static void __devinit
+bnx2_read_vpd_fw_ver(struct bnx2 *bp)
+{
+       int rc, i, j;
+       u8 *data;
+       unsigned int block_end, rosize, len;
+
+#define BNX2_VPD_NVRAM_OFFSET  0x300
+#define BNX2_VPD_LEN           128
+#define BNX2_MAX_VER_SLEN      30
+
+       data = kmalloc(256, GFP_KERNEL);
+       if (!data)
+               return;
+
+       rc = bnx2_nvram_read(bp, BNX2_VPD_NVRAM_OFFSET, data + BNX2_VPD_LEN,
+                            BNX2_VPD_LEN);
+       if (rc)
+               goto vpd_done;
+
+       for (i = 0; i < BNX2_VPD_LEN; i += 4) {
+               data[i] = data[i + BNX2_VPD_LEN + 3];
+               data[i + 1] = data[i + BNX2_VPD_LEN + 2];
+               data[i + 2] = data[i + BNX2_VPD_LEN + 1];
+               data[i + 3] = data[i + BNX2_VPD_LEN];
+       }
+
+       i = pci_vpd_find_tag(data, 0, BNX2_VPD_LEN, PCI_VPD_LRDT_RO_DATA);
+       if (i < 0)
+               goto vpd_done;
+
+       rosize = pci_vpd_lrdt_size(&data[i]);
+       i += PCI_VPD_LRDT_TAG_SIZE;
+       block_end = i + rosize;
+
+       if (block_end > BNX2_VPD_LEN)
+               goto vpd_done;
+
+       j = pci_vpd_find_info_keyword(data, i, rosize,
+                                     PCI_VPD_RO_KEYWORD_MFR_ID);
+       if (j < 0)
+               goto vpd_done;
+
+       len = pci_vpd_info_field_size(&data[j]);
+
+       j += PCI_VPD_INFO_FLD_HDR_SIZE;
+       if (j + len > block_end || len != 4 ||
+           memcmp(&data[j], "1028", 4))
+               goto vpd_done;
+
+       j = pci_vpd_find_info_keyword(data, i, rosize,
+                                     PCI_VPD_RO_KEYWORD_VENDOR0);
+       if (j < 0)
+               goto vpd_done;
+
+       len = pci_vpd_info_field_size(&data[j]);
+
+       j += PCI_VPD_INFO_FLD_HDR_SIZE;
+       if (j + len > block_end || len > BNX2_MAX_VER_SLEN)
+               goto vpd_done;
+
+       memcpy(bp->fw_version, &data[j], len);
+       bp->fw_version[len] = ' ';
+
+vpd_done:
+       kfree(data);
+}
+
 static int __devinit
 bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 {
@@ -7629,23 +7851,31 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        bp->flags = 0;
        bp->phy_flags = 0;
 
+       bp->temp_stats_blk =
+               kzalloc(sizeof(struct statistics_block), GFP_KERNEL);
+
+       if (bp->temp_stats_blk == NULL) {
+               rc = -ENOMEM;
+               goto err_out;
+       }
+
        /* enable device (incl. PCI PM wakeup), and bus-mastering */
        rc = pci_enable_device(pdev);
        if (rc) {
-               dev_err(&pdev->dev, "Cannot enable PCI device, aborting.\n");
+               dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
                goto err_out;
        }
 
        if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
                dev_err(&pdev->dev,
-                       "Cannot find PCI device base address, aborting.\n");
+                       "Cannot find PCI device base address, aborting\n");
                rc = -ENODEV;
                goto err_out_disable;
        }
 
        rc = pci_request_regions(pdev, DRV_MODULE_NAME);
        if (rc) {
-               dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
+               dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
                goto err_out_disable;
        }
 
@@ -7655,7 +7885,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
        if (bp->pm_cap == 0) {
                dev_err(&pdev->dev,
-                       "Cannot find power management capability, aborting.\n");
+                       "Cannot find power management capability, aborting\n");
                rc = -EIO;
                goto err_out_release;
        }
@@ -7678,7 +7908,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        bp->regview = ioremap_nocache(dev->base_addr, mem_len);
 
        if (!bp->regview) {
-               dev_err(&pdev->dev, "Cannot map register space, aborting.\n");
+               dev_err(&pdev->dev, "Cannot map register space, aborting\n");
                rc = -ENOMEM;
                goto err_out_release;
        }
@@ -7698,7 +7928,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
        if (CHIP_NUM(bp) == CHIP_NUM_5709) {
                if (pci_find_capability(pdev, PCI_CAP_ID_EXP) == 0) {
                        dev_err(&pdev->dev,
-                               "Cannot find PCIE capability, aborting.\n");
+                               "Cannot find PCIE capability, aborting\n");
                        rc = -EIO;
                        goto err_out_unmap;
                }
@@ -7709,10 +7939,11 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
                bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
                if (bp->pcix_cap == 0) {
                        dev_err(&pdev->dev,
-                               "Cannot find PCIX capability, aborting.\n");
+                               "Cannot find PCIX capability, aborting\n");
                        rc = -EIO;
                        goto err_out_unmap;
                }
+               bp->flags |= BNX2_FLAG_BROKEN_STATS;
        }
 
        if (CHIP_NUM(bp) == CHIP_NUM_5709 && CHIP_REV(bp) != CHIP_REV_Ax) {
@@ -7737,11 +7968,11 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
                rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
                if (rc) {
                        dev_err(&pdev->dev,
-                               "pci_set_consistent_dma_mask failed, aborting.\n");
+                               "pci_set_consistent_dma_mask failed, aborting\n");
                        goto err_out_unmap;
                }
        } else if ((rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
-               dev_err(&pdev->dev, "System does not support DMA, aborting.\n");
+               dev_err(&pdev->dev, "System does not support DMA, aborting\n");
                goto err_out_unmap;
        }
 
@@ -7758,7 +7989,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
                !(bp->flags & BNX2_FLAG_PCIX)) {
 
                dev_err(&pdev->dev,
-                       "5706 A1 can only be used in a PCIX bus, aborting.\n");
+                       "5706 A1 can only be used in a PCIX bus, aborting\n");
                goto err_out_unmap;
        }
 
@@ -7781,15 +8012,23 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 
        if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) !=
            BNX2_DEV_INFO_SIGNATURE_MAGIC) {
-               dev_err(&pdev->dev, "Firmware not running, aborting.\n");
+               dev_err(&pdev->dev, "Firmware not running, aborting\n");
                rc = -ENODEV;
                goto err_out_unmap;
        }
 
+       bnx2_read_vpd_fw_ver(bp);
+
+       j = strlen(bp->fw_version);
        reg = bnx2_shmem_rd(bp, BNX2_DEV_INFO_BC_REV);
-       for (i = 0, j = 0; i < 3; i++) {
+       for (i = 0; i < 3 && j < 24; i++) {
                u8 num, k, skip0;
 
+               if (i == 0) {
+                       bp->fw_version[j++] = 'b';
+                       bp->fw_version[j++] = 'c';
+                       bp->fw_version[j++] = ' ';
+               }
                num = (u8) (reg >> (24 - (i * 8)));
                for (k = 100, skip0 = 1; k >= 1; num %= k, k /= 10) {
                        if (num >= k || !skip0 || k == 1) {
@@ -7820,8 +8059,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
            reg != BNX2_CONDITION_MFW_RUN_NONE) {
                u32 addr = bnx2_shmem_rd(bp, BNX2_MFW_VER_PTR);
 
-               bp->fw_version[j++] = ' ';
-               for (i = 0; i < 3; i++) {
+               if (j < 32)
+                       bp->fw_version[j++] = ' ';
+               for (i = 0; i < 3 && j < 28; i++) {
                        reg = bnx2_reg_rd_ind(bp, addr + i * 4);
                        reg = swab32(reg);
                        memcpy(&bp->fw_version[j], &reg, 4);
@@ -7844,13 +8084,13 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
 
        bp->rx_csum = 1;
 
-       bp->tx_quick_cons_trip_int = 20;
+       bp->tx_quick_cons_trip_int = 2;
        bp->tx_quick_cons_trip = 20;
-       bp->tx_ticks_int = 80;
+       bp->tx_ticks_int = 18;
        bp->tx_ticks = 80;
 
-       bp->rx_quick_cons_trip_int = 6;
-       bp->rx_quick_cons_trip = 6;
+       bp->rx_quick_cons_trip_int = 2;
+       bp->rx_quick_cons_trip = 12;
        bp->rx_ticks_int = 18;
        bp->rx_ticks = 18;
 
@@ -7990,12 +8230,21 @@ bnx2_bus_string(struct bnx2 *bp, char *str)
        return str;
 }
 
-static void __devinit
+static void
+bnx2_del_napi(struct bnx2 *bp)
+{
+       int i;
+
+       for (i = 0; i < bp->irq_nvecs; i++)
+               netif_napi_del(&bp->bnx2_napi[i].napi);
+}
+
+static void
 bnx2_init_napi(struct bnx2 *bp)
 {
        int i;
 
-       for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
+       for (i = 0; i < bp->irq_nvecs; i++) {
                struct bnx2_napi *bnapi = &bp->bnx2_napi[i];
                int (*poll)(struct napi_struct *, int);
 
@@ -8023,11 +8272,18 @@ static const struct net_device_ops bnx2_netdev_ops = {
 #ifdef BCM_VLAN
        .ndo_vlan_rx_register   = bnx2_vlan_rx_register,
 #endif
-#if defined(HAVE_POLL_CONTROLLER) || defined(CONFIG_NET_POLL_CONTROLLER)
+#ifdef CONFIG_NET_POLL_CONTROLLER
        .ndo_poll_controller    = poll_bnx2,
 #endif
 };
 
+static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
+{
+#ifdef BCM_VLAN
+       dev->vlan_features |= flags;
+#endif
+}
+
 static int __devinit
 bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
@@ -8038,7 +8294,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        char str[40];
 
        if (version_printed++ == 0)
-               printk(KERN_INFO "%s", version);
+               pr_info("%s", version);
 
        /* dev zeroed in init_etherdev */
        dev = alloc_etherdev_mq(sizeof(*bp), TX_MAX_RINGS);
@@ -8057,7 +8313,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->ethtool_ops = &bnx2_ethtool_ops;
 
        bp = netdev_priv(dev);
-       bnx2_init_napi(bp);
 
        pci_set_drvdata(pdev, dev);
 
@@ -8068,31 +8323,33 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        memcpy(dev->dev_addr, bp->mac_addr, 6);
        memcpy(dev->perm_addr, bp->mac_addr, 6);
 
-       dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
-       if (CHIP_NUM(bp) == CHIP_NUM_5709)
+       dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_GRO;
+       vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG);
+       if (CHIP_NUM(bp) == CHIP_NUM_5709) {
                dev->features |= NETIF_F_IPV6_CSUM;
-
+               vlan_features_add(dev, NETIF_F_IPV6_CSUM);
+       }
 #ifdef BCM_VLAN
        dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
 #endif
        dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN;
-       if (CHIP_NUM(bp) == CHIP_NUM_5709)
+       vlan_features_add(dev, NETIF_F_TSO | NETIF_F_TSO_ECN);
+       if (CHIP_NUM(bp) == CHIP_NUM_5709) {
                dev->features |= NETIF_F_TSO6;
-
+               vlan_features_add(dev, NETIF_F_TSO6);
+       }
        if ((rc = register_netdev(dev))) {
                dev_err(&pdev->dev, "Cannot register net device\n");
                goto error;
        }
 
-       printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
-               "IRQ %d, node addr %pM\n",
-               dev->name,
-               board_info[ent->driver_data].name,
-               ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
-               ((CHIP_ID(bp) & 0x0ff0) >> 4),
-               bnx2_bus_string(bp, str),
-               dev->base_addr,
-               bp->pdev->irq, dev->dev_addr);
+       netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, node addr %pM\n",
+                   board_info[ent->driver_data].name,
+                   ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
+                   ((CHIP_ID(bp) & 0x0ff0) >> 4),
+                   bnx2_bus_string(bp, str),
+                   dev->base_addr,
+                   bp->pdev->irq, dev->dev_addr);
 
        return 0;
 
@@ -8129,6 +8386,8 @@ bnx2_remove_one(struct pci_dev *pdev)
        if (bp->regview)
                iounmap(bp->regview);
 
+       kfree(bp->temp_stats_blk);
+
        free_netdev(dev);
        pci_release_regions(pdev);
        pci_disable_device(pdev);
@@ -8150,7 +8409,7 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
                return 0;
 
        flush_scheduled_work();
-       bnx2_netif_stop(bp);
+       bnx2_netif_stop(bp, true);
        netif_device_detach(dev);
        del_timer_sync(&bp->timer);
        bnx2_shutdown_chip(bp);
@@ -8172,7 +8431,7 @@ bnx2_resume(struct pci_dev *pdev)
        bnx2_set_power_state(bp, PCI_D0);
        netif_device_attach(dev);
        bnx2_init_nic(bp, 1);
-       bnx2_netif_start(bp);
+       bnx2_netif_start(bp, true);
        return 0;
 }
 
@@ -8193,8 +8452,13 @@ static pci_ers_result_t bnx2_io_error_detected(struct pci_dev *pdev,
        rtnl_lock();
        netif_device_detach(dev);
 
+       if (state == pci_channel_io_perm_failure) {
+               rtnl_unlock();
+               return PCI_ERS_RESULT_DISCONNECT;
+       }
+
        if (netif_running(dev)) {
-               bnx2_netif_stop(bp);
+               bnx2_netif_stop(bp, true);
                del_timer_sync(&bp->timer);
                bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_RESET);
        }
@@ -8220,12 +8484,13 @@ static pci_ers_result_t bnx2_io_slot_reset(struct pci_dev *pdev)
        rtnl_lock();
        if (pci_enable_device(pdev)) {
                dev_err(&pdev->dev,
-                       "Cannot re-enable PCI device after reset.\n");
+                       "Cannot re-enable PCI device after reset\n");
                rtnl_unlock();
                return PCI_ERS_RESULT_DISCONNECT;
        }
        pci_set_master(pdev);
        pci_restore_state(pdev);
+       pci_save_state(pdev);
 
        if (netif_running(dev)) {
                bnx2_set_power_state(bp, PCI_D0);
@@ -8250,7 +8515,7 @@ static void bnx2_io_resume(struct pci_dev *pdev)
 
        rtnl_lock();
        if (netif_running(dev))
-               bnx2_netif_start(bp);
+               bnx2_netif_start(bp, true);
 
        netif_device_attach(dev);
        rtnl_unlock();