e1000: remove e1000_clean_tx_irq call from e1000_netpoll
[pandora-kernel.git] / drivers / net / e1000 / e1000_main.c
index cf39473..311ca26 100644 (file)
@@ -73,14 +73,6 @@ static struct pci_device_id e1000_pci_tbl[] = {
        INTEL_E1000_ETHERNET_DEVICE(0x1026),
        INTEL_E1000_ETHERNET_DEVICE(0x1027),
        INTEL_E1000_ETHERNET_DEVICE(0x1028),
-       INTEL_E1000_ETHERNET_DEVICE(0x1049),
-       INTEL_E1000_ETHERNET_DEVICE(0x104A),
-       INTEL_E1000_ETHERNET_DEVICE(0x104B),
-       INTEL_E1000_ETHERNET_DEVICE(0x104C),
-       INTEL_E1000_ETHERNET_DEVICE(0x104D),
-       INTEL_E1000_ETHERNET_DEVICE(0x105E),
-       INTEL_E1000_ETHERNET_DEVICE(0x105F),
-       INTEL_E1000_ETHERNET_DEVICE(0x1060),
        INTEL_E1000_ETHERNET_DEVICE(0x1075),
        INTEL_E1000_ETHERNET_DEVICE(0x1076),
        INTEL_E1000_ETHERNET_DEVICE(0x1077),
@@ -89,28 +81,9 @@ static struct pci_device_id e1000_pci_tbl[] = {
        INTEL_E1000_ETHERNET_DEVICE(0x107A),
        INTEL_E1000_ETHERNET_DEVICE(0x107B),
        INTEL_E1000_ETHERNET_DEVICE(0x107C),
-       INTEL_E1000_ETHERNET_DEVICE(0x107D),
-       INTEL_E1000_ETHERNET_DEVICE(0x107E),
-       INTEL_E1000_ETHERNET_DEVICE(0x107F),
        INTEL_E1000_ETHERNET_DEVICE(0x108A),
-       INTEL_E1000_ETHERNET_DEVICE(0x108B),
-       INTEL_E1000_ETHERNET_DEVICE(0x108C),
-       INTEL_E1000_ETHERNET_DEVICE(0x1096),
-       INTEL_E1000_ETHERNET_DEVICE(0x1098),
        INTEL_E1000_ETHERNET_DEVICE(0x1099),
-       INTEL_E1000_ETHERNET_DEVICE(0x109A),
-       INTEL_E1000_ETHERNET_DEVICE(0x10A4),
-       INTEL_E1000_ETHERNET_DEVICE(0x10A5),
        INTEL_E1000_ETHERNET_DEVICE(0x10B5),
-       INTEL_E1000_ETHERNET_DEVICE(0x10B9),
-       INTEL_E1000_ETHERNET_DEVICE(0x10BA),
-       INTEL_E1000_ETHERNET_DEVICE(0x10BB),
-       INTEL_E1000_ETHERNET_DEVICE(0x10BC),
-       INTEL_E1000_ETHERNET_DEVICE(0x10C4),
-       INTEL_E1000_ETHERNET_DEVICE(0x10C5),
-       INTEL_E1000_ETHERNET_DEVICE(0x10D5),
-       INTEL_E1000_ETHERNET_DEVICE(0x10D9),
-       INTEL_E1000_ETHERNET_DEVICE(0x10DA),
        /* required last entry */
        {0,}
 };
@@ -121,7 +94,7 @@ int e1000_up(struct e1000_adapter *adapter);
 void e1000_down(struct e1000_adapter *adapter);
 void e1000_reinit_locked(struct e1000_adapter *adapter);
 void e1000_reset(struct e1000_adapter *adapter);
-int e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx);
+int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx);
 int e1000_setup_all_tx_resources(struct e1000_adapter *adapter);
 int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
 void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
@@ -153,7 +126,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
                                 struct e1000_tx_ring *tx_ring);
 static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
                                 struct e1000_rx_ring *rx_ring);
-static void e1000_set_multi(struct net_device *netdev);
+static void e1000_set_rx_mode(struct net_device *netdev);
 static void e1000_update_phy_info(unsigned long data);
 static void e1000_watchdog(unsigned long data);
 static void e1000_82547_tx_fifo_stall(unsigned long data);
@@ -163,21 +136,21 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
 static int e1000_set_mac(struct net_device *netdev, void *p);
 static irqreturn_t e1000_intr(int irq, void *data);
 static irqreturn_t e1000_intr_msi(int irq, void *data);
-static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter,
-                                    struct e1000_tx_ring *tx_ring);
+static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
+                              struct e1000_tx_ring *tx_ring);
 #ifdef CONFIG_E1000_NAPI
 static int e1000_clean(struct napi_struct *napi, int budget);
-static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter,
-                                    struct e1000_rx_ring *rx_ring,
-                                    int *work_done, int work_to_do);
-static boolean_t e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
-                                       struct e1000_rx_ring *rx_ring,
-                                       int *work_done, int work_to_do);
+static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+                              struct e1000_rx_ring *rx_ring,
+                              int *work_done, int work_to_do);
+static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+                                 struct e1000_rx_ring *rx_ring,
+                                 int *work_done, int work_to_do);
 #else
-static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter,
-                                    struct e1000_rx_ring *rx_ring);
-static boolean_t e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
-                                       struct e1000_rx_ring *rx_ring);
+static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
+                              struct e1000_rx_ring *rx_ring);
+static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
+                                 struct e1000_rx_ring *rx_ring);
 #endif
 static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
                                    struct e1000_rx_ring *rx_ring,
@@ -197,8 +170,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter,
                                        struct sk_buff *skb);
 
 static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
-static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
-static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
+static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
+static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
 static void e1000_restore_vlan(struct e1000_adapter *adapter);
 
 static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
@@ -299,14 +272,14 @@ module_exit(e1000_exit_module);
 static int e1000_request_irq(struct e1000_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
-       void (*handler) = &e1000_intr;
+       irq_handler_t handler = e1000_intr;
        int irq_flags = IRQF_SHARED;
        int err;
 
        if (adapter->hw.mac_type >= e1000_82571) {
                adapter->have_msi = !pci_enable_msi(adapter->pdev);
                if (adapter->have_msi) {
-                       handler = &e1000_intr_msi;
+                       handler = e1000_intr_msi;
                        irq_flags = 0;
                }
        }
@@ -341,7 +314,6 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
 static void
 e1000_irq_disable(struct e1000_adapter *adapter)
 {
-       atomic_inc(&adapter->irq_sem);
        E1000_WRITE_REG(&adapter->hw, IMC, ~0);
        E1000_WRITE_FLUSH(&adapter->hw);
        synchronize_irq(adapter->pdev->irq);
@@ -355,18 +327,16 @@ e1000_irq_disable(struct e1000_adapter *adapter)
 static void
 e1000_irq_enable(struct e1000_adapter *adapter)
 {
-       if (likely(atomic_dec_and_test(&adapter->irq_sem))) {
-               E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
-               E1000_WRITE_FLUSH(&adapter->hw);
-       }
+       E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK);
+       E1000_WRITE_FLUSH(&adapter->hw);
 }
 
 static void
 e1000_update_mng_vlan(struct e1000_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
-       uint16_t vid = adapter->hw.mng_cookie.vlan_id;
-       uint16_t old_vid = adapter->mng_vlan_id;
+       u16 vid = adapter->hw.mng_cookie.vlan_id;
+       u16 old_vid = adapter->mng_vlan_id;
        if (adapter->vlgrp) {
                if (!vlan_group_get_device(adapter->vlgrp, vid)) {
                        if (adapter->hw.mng_cookie.status &
@@ -376,7 +346,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
                        } else
                                adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
 
-                       if ((old_vid != (uint16_t)E1000_MNG_VLAN_NONE) &&
+                       if ((old_vid != (u16)E1000_MNG_VLAN_NONE) &&
                                        (vid != old_vid) &&
                            !vlan_group_get_device(adapter->vlgrp, old_vid))
                                e1000_vlan_rx_kill_vid(netdev, old_vid);
@@ -399,8 +369,8 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter)
 static void
 e1000_release_hw_control(struct e1000_adapter *adapter)
 {
-       uint32_t ctrl_ext;
-       uint32_t swsm;
+       u32 ctrl_ext;
+       u32 swsm;
 
        /* Let firmware taken over control of h/w */
        switch (adapter->hw.mac_type) {
@@ -436,8 +406,8 @@ e1000_release_hw_control(struct e1000_adapter *adapter)
 static void
 e1000_get_hw_control(struct e1000_adapter *adapter)
 {
-       uint32_t ctrl_ext;
-       uint32_t swsm;
+       u32 ctrl_ext;
+       u32 swsm;
 
        /* Let firmware know the driver has taken over */
        switch (adapter->hw.mac_type) {
@@ -463,7 +433,7 @@ static void
 e1000_init_manageability(struct e1000_adapter *adapter)
 {
        if (adapter->en_mng_pt) {
-               uint32_t manc = E1000_READ_REG(&adapter->hw, MANC);
+               u32 manc = E1000_READ_REG(&adapter->hw, MANC);
 
                /* disable hardware interception of ARP */
                manc &= ~(E1000_MANC_ARP_EN);
@@ -472,7 +442,7 @@ e1000_init_manageability(struct e1000_adapter *adapter)
                /* this will probably generate destination unreachable messages
                 * from the host OS, but the packets will be handled on SMBUS */
                if (adapter->hw.has_manc2h) {
-                       uint32_t manc2h = E1000_READ_REG(&adapter->hw, MANC2H);
+                       u32 manc2h = E1000_READ_REG(&adapter->hw, MANC2H);
 
                        manc |= E1000_MANC_EN_MNG2HOST;
 #define E1000_MNG2HOST_PORT_623 (1 << 5)
@@ -490,7 +460,7 @@ static void
 e1000_release_manageability(struct e1000_adapter *adapter)
 {
        if (adapter->en_mng_pt) {
-               uint32_t manc = E1000_READ_REG(&adapter->hw, MANC);
+               u32 manc = E1000_READ_REG(&adapter->hw, MANC);
 
                /* re-enable hardware interception of ARP */
                manc |= E1000_MANC_ARP_EN;
@@ -514,7 +484,7 @@ static void e1000_configure(struct e1000_adapter *adapter)
        struct net_device *netdev = adapter->netdev;
        int i;
 
-       e1000_set_multi(netdev);
+       e1000_set_rx_mode(netdev);
 
        e1000_restore_vlan(adapter);
        e1000_init_manageability(adapter);
@@ -563,7 +533,7 @@ int e1000_up(struct e1000_adapter *adapter)
 
 void e1000_power_up_phy(struct e1000_adapter *adapter)
 {
-       uint16_t mii_reg = 0;
+       u16 mii_reg = 0;
 
        /* Just clear the power down bit to wake the phy back up */
        if (adapter->hw.media_type == e1000_media_type_copper) {
@@ -578,13 +548,13 @@ void e1000_power_up_phy(struct e1000_adapter *adapter)
 static void e1000_power_down_phy(struct e1000_adapter *adapter)
 {
        /* Power down the PHY so no link is implied when interface is down *
-        * The PHY cannot be powered down if any of the following is TRUE *
+        * The PHY cannot be powered down if any of the following is true *
         * (a) WoL is enabled
         * (b) AMT is active
         * (c) SoL/IDER session is active */
        if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 &&
           adapter->hw.media_type == e1000_media_type_copper) {
-               uint16_t mii_reg = 0;
+               u16 mii_reg = 0;
 
                switch (adapter->hw.mac_type) {
                case e1000_82540:
@@ -664,9 +634,9 @@ e1000_reinit_locked(struct e1000_adapter *adapter)
 void
 e1000_reset(struct e1000_adapter *adapter)
 {
-       uint32_t pba = 0, tx_space, min_tx_space, min_rx_space;
-       uint16_t fc_high_water_mark = E1000_FC_HIGH_DIFF;
-       boolean_t legacy_pba_adjust = FALSE;
+       u32 pba = 0, tx_space, min_tx_space, min_rx_space;
+       u16 fc_high_water_mark = E1000_FC_HIGH_DIFF;
+       bool legacy_pba_adjust = false;
 
        /* Repartition Pba for greater than 9k mtu
         * To take effect CTRL.RST is required.
@@ -680,7 +650,7 @@ e1000_reset(struct e1000_adapter *adapter)
        case e1000_82540:
        case e1000_82541:
        case e1000_82541_rev_2:
-               legacy_pba_adjust = TRUE;
+               legacy_pba_adjust = true;
                pba = E1000_PBA_48K;
                break;
        case e1000_82545:
@@ -691,7 +661,7 @@ e1000_reset(struct e1000_adapter *adapter)
                break;
        case e1000_82547:
        case e1000_82547_rev_2:
-               legacy_pba_adjust = TRUE;
+               legacy_pba_adjust = true;
                pba = E1000_PBA_30K;
                break;
        case e1000_82571:
@@ -709,7 +679,7 @@ e1000_reset(struct e1000_adapter *adapter)
                break;
        }
 
-       if (legacy_pba_adjust == TRUE) {
+       if (legacy_pba_adjust) {
                if (adapter->netdev->mtu > E1000_RXBUFFER_8192)
                        pba -= 8; /* allocate more FIFO for Tx */
 
@@ -812,7 +782,7 @@ e1000_reset(struct e1000_adapter *adapter)
            adapter->hw.mac_type <= e1000_82547_rev_2 &&
            adapter->hw.autoneg == 1 &&
            adapter->hw.autoneg_advertised == ADVERTISE_1000_FULL) {
-               uint32_t ctrl = E1000_READ_REG(&adapter->hw, CTRL);
+               u32 ctrl = E1000_READ_REG(&adapter->hw, CTRL);
                /* clear phy power management bit if we are in gig only mode,
                 * which if enabled will attempt negotiation to 100Mb, which
                 * can cause a loss of link at power off or driver unload */
@@ -829,7 +799,7 @@ e1000_reset(struct e1000_adapter *adapter)
        if (!adapter->smart_power_down &&
            (adapter->hw.mac_type == e1000_82571 ||
             adapter->hw.mac_type == e1000_82572)) {
-               uint16_t phy_data = 0;
+               u16 phy_data = 0;
                /* speed up time to link by disabling smart power down, ignore
                 * the return value of this function because there is nothing
                 * different we would do if it failed */
@@ -843,6 +813,64 @@ e1000_reset(struct e1000_adapter *adapter)
        e1000_release_manageability(adapter);
 }
 
+/**
+ *  Dump the eeprom for users having checksum issues
+ **/
+static void e1000_dump_eeprom(struct e1000_adapter *adapter)
+{
+       struct net_device *netdev = adapter->netdev;
+       struct ethtool_eeprom eeprom;
+       const struct ethtool_ops *ops = netdev->ethtool_ops;
+       u8 *data;
+       int i;
+       u16 csum_old, csum_new = 0;
+
+       eeprom.len = ops->get_eeprom_len(netdev);
+       eeprom.offset = 0;
+
+       data = kmalloc(eeprom.len, GFP_KERNEL);
+       if (!data) {
+               printk(KERN_ERR "Unable to allocate memory to dump EEPROM"
+                      " data\n");
+               return;
+       }
+
+       ops->get_eeprom(netdev, &eeprom, data);
+
+       csum_old = (data[EEPROM_CHECKSUM_REG * 2]) +
+                  (data[EEPROM_CHECKSUM_REG * 2 + 1] << 8);
+       for (i = 0; i < EEPROM_CHECKSUM_REG * 2; i += 2)
+               csum_new += data[i] + (data[i + 1] << 8);
+       csum_new = EEPROM_SUM - csum_new;
+
+       printk(KERN_ERR "/*********************/\n");
+       printk(KERN_ERR "Current EEPROM Checksum : 0x%04x\n", csum_old);
+       printk(KERN_ERR "Calculated              : 0x%04x\n", csum_new);
+
+       printk(KERN_ERR "Offset    Values\n");
+       printk(KERN_ERR "========  ======\n");
+       print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1, data, 128, 0);
+
+       printk(KERN_ERR "Include this output when contacting your support "
+              "provider.\n");
+       printk(KERN_ERR "This is not a software error! Something bad "
+              "happened to your hardware or\n");
+       printk(KERN_ERR "EEPROM image. Ignoring this "
+              "problem could result in further problems,\n");
+       printk(KERN_ERR "possibly loss of data, corruption or system hangs!\n");
+       printk(KERN_ERR "The MAC Address will be reset to 00:00:00:00:00:00, "
+              "which is invalid\n");
+       printk(KERN_ERR "and requires you to set the proper MAC "
+              "address manually before continuing\n");
+       printk(KERN_ERR "to enable this network device.\n");
+       printk(KERN_ERR "Please inspect the EEPROM dump and report the issue "
+              "to your hardware vendor\n");
+       printk(KERN_ERR "or Intel Customer Support: linux-nics@intel.com\n");
+       printk(KERN_ERR "/*********************/\n");
+
+       kfree(data);
+}
+
 /**
  * e1000_probe - Device Initialization Routine
  * @pdev: PCI device information struct
@@ -861,14 +889,12 @@ e1000_probe(struct pci_dev *pdev,
 {
        struct net_device *netdev;
        struct e1000_adapter *adapter;
-       unsigned long mmio_start, mmio_len;
-       unsigned long flash_start, flash_len;
 
        static int cards_found = 0;
        static int global_quad_port_a = 0; /* global ksp3 port a indication */
        int i, err, pci_using_dac;
-       uint16_t eeprom_data = 0;
-       uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
+       u16 eeprom_data = 0;
+       u16 eeprom_apme_mask = E1000_EEPROM_APME;
        DECLARE_MAC_BUF(mac);
 
        if ((err = pci_enable_device(pdev)))
@@ -905,11 +931,9 @@ e1000_probe(struct pci_dev *pdev,
        adapter->hw.back = adapter;
        adapter->msg_enable = (1 << debug) - 1;
 
-       mmio_start = pci_resource_start(pdev, BAR_0);
-       mmio_len = pci_resource_len(pdev, BAR_0);
-
        err = -EIO;
-       adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
+       adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, BAR_0),
+                                     pci_resource_len(pdev, BAR_0));
        if (!adapter->hw.hw_addr)
                goto err_ioremap;
 
@@ -926,7 +950,7 @@ e1000_probe(struct pci_dev *pdev,
        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_rx_mode = &e1000_set_rx_mode;
        netdev->set_mac_address = &e1000_set_mac;
        netdev->change_mtu = &e1000_change_mtu;
        netdev->do_ioctl = &e1000_ioctl;
@@ -944,10 +968,6 @@ e1000_probe(struct pci_dev *pdev,
 #endif
        strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
 
-       netdev->mem_start = mmio_start;
-       netdev->mem_end = mmio_start + mmio_len;
-       netdev->base_addr = adapter->hw.io_base;
-
        adapter->bd_number = cards_found;
 
        /* setup the private structure */
@@ -960,9 +980,9 @@ e1000_probe(struct pci_dev *pdev,
         * because it depends on mac_type */
        if ((adapter->hw.mac_type == e1000_ich8lan) &&
           (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
-               flash_start = pci_resource_start(pdev, 1);
-               flash_len = pci_resource_len(pdev, 1);
-               adapter->hw.flash_address = ioremap(flash_start, flash_len);
+               adapter->hw.flash_address =
+                       ioremap(pci_resource_start(pdev, 1),
+                               pci_resource_len(pdev, 1));
                if (!adapter->hw.flash_address)
                        goto err_flashmap;
        }
@@ -994,7 +1014,6 @@ e1000_probe(struct pci_dev *pdev,
        adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
 
        /* initialize eeprom parameters */
-
        if (e1000_init_eeprom_params(&adapter->hw)) {
                E1000_ERR("EEPROM initialization failed\n");
                goto err_eeprom;
@@ -1006,23 +1025,29 @@ e1000_probe(struct pci_dev *pdev,
        e1000_reset_hw(&adapter->hw);
 
        /* make sure the EEPROM is good */
-
        if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
                DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
-               goto err_eeprom;
+               e1000_dump_eeprom(adapter);
+               /*
+                * set MAC address to all zeroes to invalidate and temporary
+                * disable this device for the user. This blocks regular
+                * traffic while still permitting ethtool ioctls from reaching
+                * the hardware as well as allowing the user to run the
+                * interface after manually setting a hw addr using
+                * `ip set address`
+                */
+               memset(adapter->hw.mac_addr, 0, netdev->addr_len);
+       } else {
+               /* copy the MAC address out of the EEPROM */
+               if (e1000_read_mac_addr(&adapter->hw))
+                       DPRINTK(PROBE, ERR, "EEPROM Read Error\n");
        }
-
-       /* copy the MAC address out of the EEPROM */
-
-       if (e1000_read_mac_addr(&adapter->hw))
-               DPRINTK(PROBE, ERR, "EEPROM Read Error\n");
+       /* don't block initalization here due to bad MAC address */
        memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
        memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len);
 
-       if (!is_valid_ether_addr(netdev->perm_addr)) {
+       if (!is_valid_ether_addr(netdev->perm_addr))
                DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
-               goto err_eeprom;
-       }
 
        e1000_get_bus_info(&adapter->hw);
 
@@ -1133,6 +1158,14 @@ e1000_probe(struct pci_dev *pdev,
 
        printk("%s\n", print_mac(mac, netdev->dev_addr));
 
+       if (adapter->hw.bus_type == e1000_bus_type_pci_express) {
+               DPRINTK(PROBE, WARNING, "This device (id %04x:%04x) will no "
+                       "longer be supported by this driver in the future.\n",
+                       pdev->vendor, pdev->device);
+               DPRINTK(PROBE, WARNING, "please use the \"e1000e\" "
+                       "driver instead.\n");
+       }
+
        /* reset the hardware with the new settings */
        e1000_reset(adapter);
 
@@ -1296,15 +1329,15 @@ e1000_sw_init(struct e1000_adapter *adapter)
 
        e1000_set_media_type(hw);
 
-       hw->wait_autoneg_complete = FALSE;
-       hw->tbi_compatibility_en = TRUE;
-       hw->adaptive_ifs = TRUE;
+       hw->wait_autoneg_complete = false;
+       hw->tbi_compatibility_en = true;
+       hw->adaptive_ifs = true;
 
        /* Copper options */
 
        if (hw->media_type == e1000_media_type_copper) {
                hw->mdix = AUTO_ALL_MODES;
-               hw->disable_polarity_correction = FALSE;
+               hw->disable_polarity_correction = false;
                hw->master_slave = E1000_MASTER_SLAVE;
        }
 
@@ -1326,7 +1359,6 @@ e1000_sw_init(struct e1000_adapter *adapter)
 #endif
 
        /* Explicitly disable IRQ since the NIC can be in any state. */
-       atomic_set(&adapter->irq_sem, 0);
        e1000_irq_disable(adapter);
 
        spin_lock_init(&adapter->stats_lock);
@@ -1506,7 +1538,7 @@ e1000_close(struct net_device *netdev)
  * @start: address of beginning of memory
  * @len: length of memory
  **/
-static boolean_t
+static bool
 e1000_check_64k_bound(struct e1000_adapter *adapter,
                      void *start, unsigned long len)
 {
@@ -1517,10 +1549,10 @@ e1000_check_64k_bound(struct e1000_adapter *adapter,
         * write location to cross 64k boundary due to errata 23 */
        if (adapter->hw.mac_type == e1000_82545 ||
            adapter->hw.mac_type == e1000_82546) {
-               return ((begin ^ (end - 1)) >> 16) != 0 ? FALSE : TRUE;
+               return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
        }
 
-       return TRUE;
+       return true;
 }
 
 /**
@@ -1637,10 +1669,10 @@ e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
 static void
 e1000_configure_tx(struct e1000_adapter *adapter)
 {
-       uint64_t tdba;
+       u64 tdba;
        struct e1000_hw *hw = &adapter->hw;
-       uint32_t tdlen, tctl, tipg, tarc;
-       uint32_t ipgr1, ipgr2;
+       u32 tdlen, tctl, tipg, tarc;
+       u32 ipgr1, ipgr2;
 
        /* Setup the HW Tx Head and Tail descriptor pointers */
 
@@ -1882,10 +1914,10 @@ e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
 static void
 e1000_setup_rctl(struct e1000_adapter *adapter)
 {
-       uint32_t rctl, rfctl;
-       uint32_t psrctl = 0;
+       u32 rctl, rfctl;
+       u32 psrctl = 0;
 #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
-       uint32_t pages = 0;
+       u32 pages = 0;
 #endif
 
        rctl = E1000_READ_REG(&adapter->hw, RCTL);
@@ -2000,9 +2032,9 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
 static void
 e1000_configure_rx(struct e1000_adapter *adapter)
 {
-       uint64_t rdba;
+       u64 rdba;
        struct e1000_hw *hw = &adapter->hw;
-       uint32_t rdlen, rctl, rxcsum, ctrl_ext;
+       u32 rdlen, rctl, rxcsum, ctrl_ext;
 
        if (adapter->rx_ps_pages) {
                /* this is a 32 byte descriptor */
@@ -2063,7 +2095,7 @@ e1000_configure_rx(struct e1000_adapter *adapter)
        /* Enable 82543 Receive Checksum Offload for TCP and UDP */
        if (hw->mac_type >= e1000_82543) {
                rxcsum = E1000_READ_REG(hw, RXCSUM);
-               if (adapter->rx_csum == TRUE) {
+               if (adapter->rx_csum) {
                        rxcsum |= E1000_RXCSUM_TUOFL;
 
                        /* Enable 82571 IPv4 payload checksum for UDP fragments
@@ -2322,7 +2354,7 @@ static void
 e1000_enter_82542_rst(struct e1000_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
-       uint32_t rctl;
+       u32 rctl;
 
        e1000_pci_clear_mwi(&adapter->hw);
 
@@ -2340,7 +2372,7 @@ static void
 e1000_leave_82542_rst(struct e1000_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
-       uint32_t rctl;
+       u32 rctl;
 
        rctl = E1000_READ_REG(&adapter->hw, RCTL);
        rctl &= ~E1000_RCTL_RST;
@@ -2409,23 +2441,24 @@ e1000_set_mac(struct net_device *netdev, void *p)
 }
 
 /**
- * e1000_set_multi - Multicast and Promiscuous mode set
+ * e1000_set_rx_mode - Secondary Unicast, Multicast and Promiscuous mode set
  * @netdev: network interface device structure
  *
- * The set_multi entry point is called whenever the multicast address
- * list or the network interface flags are updated.  This routine is
- * responsible for configuring the hardware for proper multicast,
+ * The set_rx_mode entry point is called whenever the unicast or multicast
+ * address lists or the network interface flags are updated. This routine is
+ * responsible for configuring the hardware for proper unicast, multicast,
  * promiscuous mode, and all-multi behavior.
  **/
 
 static void
-e1000_set_multi(struct net_device *netdev)
+e1000_set_rx_mode(struct net_device *netdev)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_hw *hw = &adapter->hw;
-       struct dev_mc_list *mc_ptr;
-       uint32_t rctl;
-       uint32_t hash_value;
+       struct dev_addr_list *uc_ptr;
+       struct dev_addr_list *mc_ptr;
+       u32 rctl;
+       u32 hash_value;
        int i, rar_entries = E1000_RAR_ENTRIES;
        int mta_reg_count = (hw->mac_type == e1000_ich8lan) ?
                                E1000_NUM_MTA_REGISTERS_ICH8LAN :
@@ -2446,9 +2479,16 @@ e1000_set_multi(struct net_device *netdev)
                rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
        } else if (netdev->flags & IFF_ALLMULTI) {
                rctl |= E1000_RCTL_MPE;
-               rctl &= ~E1000_RCTL_UPE;
        } else {
-               rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
+               rctl &= ~E1000_RCTL_MPE;
+       }
+
+       uc_ptr = NULL;
+       if (netdev->uc_count > rar_entries - 1) {
+               rctl |= E1000_RCTL_UPE;
+       } else if (!(netdev->flags & IFF_PROMISC)) {
+               rctl &= ~E1000_RCTL_UPE;
+               uc_ptr = netdev->uc_list;
        }
 
        E1000_WRITE_REG(hw, RCTL, rctl);
@@ -2458,7 +2498,10 @@ e1000_set_multi(struct net_device *netdev)
        if (hw->mac_type == e1000_82542_rev2_0)
                e1000_enter_82542_rst(adapter);
 
-       /* load the first 14 multicast address into the exact filters 1-14
+       /* load the first 14 addresses into the exact filters 1-14. Unicast
+        * addresses take precedence to avoid disabling unicast filtering
+        * when possible.
+        *
         * RAR 0 is used for the station MAC adddress
         * if there are not 14 addresses, go ahead and clear the filters
         * -- with 82571 controllers only 0-13 entries are filled here
@@ -2466,8 +2509,11 @@ e1000_set_multi(struct net_device *netdev)
        mc_ptr = netdev->mc_list;
 
        for (i = 1; i < rar_entries; i++) {
-               if (mc_ptr) {
-                       e1000_rar_set(hw, mc_ptr->dmi_addr, i);
+               if (uc_ptr) {
+                       e1000_rar_set(hw, uc_ptr->da_addr, i);
+                       uc_ptr = uc_ptr->next;
+               } else if (mc_ptr) {
+                       e1000_rar_set(hw, mc_ptr->da_addr, i);
                        mc_ptr = mc_ptr->next;
                } else {
                        E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
@@ -2476,6 +2522,7 @@ e1000_set_multi(struct net_device *netdev)
                        E1000_WRITE_FLUSH(hw);
                }
        }
+       WARN_ON(uc_ptr != NULL);
 
        /* clear the old settings from the multicast hash table */
 
@@ -2487,7 +2534,7 @@ e1000_set_multi(struct net_device *netdev)
        /* load any remaining addresses into the hash table */
 
        for (; mc_ptr; mc_ptr = mc_ptr->next) {
-               hash_value = e1000_hash_mc_addr(hw, mc_ptr->dmi_addr);
+               hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
                e1000_mta_set(hw, hash_value);
        }
 
@@ -2515,7 +2562,7 @@ e1000_82547_tx_fifo_stall(unsigned long data)
 {
        struct e1000_adapter *adapter = (struct e1000_adapter *) data;
        struct net_device *netdev = adapter->netdev;
-       uint32_t tctl;
+       u32 tctl;
 
        if (atomic_read(&adapter->tx_fifo_stall)) {
                if ((E1000_READ_REG(&adapter->hw, TDT) ==
@@ -2557,8 +2604,8 @@ e1000_watchdog(unsigned long data)
        struct e1000_adapter *adapter = (struct e1000_adapter *) data;
        struct net_device *netdev = adapter->netdev;
        struct e1000_tx_ring *txdr = adapter->tx_ring;
-       uint32_t link, tctl;
-       int32_t ret_val;
+       u32 link, tctl;
+       s32 ret_val;
 
        ret_val = e1000_check_for_link(&adapter->hw);
        if ((ret_val == E1000_ERR_PHY) &&
@@ -2583,8 +2630,8 @@ e1000_watchdog(unsigned long data)
 
        if (link) {
                if (!netif_carrier_ok(netdev)) {
-                       uint32_t ctrl;
-                       boolean_t txb2b = 1;
+                       u32 ctrl;
+                       bool txb2b = true;
                        e1000_get_speed_and_duplex(&adapter->hw,
                                                   &adapter->link_speed,
                                                   &adapter->link_duplex);
@@ -2606,12 +2653,12 @@ e1000_watchdog(unsigned long data)
                        adapter->tx_timeout_factor = 1;
                        switch (adapter->link_speed) {
                        case SPEED_10:
-                               txb2b = 0;
+                               txb2b = false;
                                netdev->tx_queue_len = 10;
                                adapter->tx_timeout_factor = 8;
                                break;
                        case SPEED_100:
-                               txb2b = 0;
+                               txb2b = false;
                                netdev->tx_queue_len = 100;
                                /* maybe add some timeout factor ? */
                                break;
@@ -2619,8 +2666,8 @@ e1000_watchdog(unsigned long data)
 
                        if ((adapter->hw.mac_type == e1000_82571 ||
                             adapter->hw.mac_type == e1000_82572) &&
-                           txb2b == 0) {
-                               uint32_t tarc0;
+                           !txb2b) {
+                               u32 tarc0;
                                tarc0 = E1000_READ_REG(&adapter->hw, TARC0);
                                tarc0 &= ~(1 << 21);
                                E1000_WRITE_REG(&adapter->hw, TARC0, tarc0);
@@ -2662,7 +2709,7 @@ e1000_watchdog(unsigned long data)
                        /* make sure the receive unit is started */
                        if (adapter->hw.rx_needs_kicking) {
                                struct e1000_hw *hw = &adapter->hw;
-                               uint32_t rctl = E1000_READ_REG(hw, RCTL);
+                               u32 rctl = E1000_READ_REG(hw, RCTL);
                                E1000_WRITE_REG(hw, RCTL, rctl | E1000_RCTL_EN);
                        }
                }
@@ -2717,7 +2764,7 @@ e1000_watchdog(unsigned long data)
        E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_RXDMT0);
 
        /* Force detection of hung controller every watchdog period */
-       adapter->detect_tx_hung = TRUE;
+       adapter->detect_tx_hung = true;
 
        /* With 82571 controllers, LAA may be overwritten due to controller
         * reset from the other port. Set the appropriate LAA in RAR[0] */
@@ -2752,7 +2799,7 @@ enum latency_range {
  * @bytes: the number of bytes during this measurement interval
  **/
 static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
-                                   uint16_t itr_setting,
+                                   u16 itr_setting,
                                    int packets,
                                    int bytes)
 {
@@ -2804,8 +2851,8 @@ update_itr_done:
 static void e1000_set_itr(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
-       uint16_t current_itr;
-       uint32_t new_itr = adapter->itr;
+       u16 current_itr;
+       u32 new_itr = adapter->itr;
 
        if (unlikely(hw->mac_type < e1000_82540))
                return;
@@ -2879,9 +2926,9 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
        struct e1000_context_desc *context_desc;
        struct e1000_buffer *buffer_info;
        unsigned int i;
-       uint32_t cmd_length = 0;
-       uint16_t ipcse = 0, tucse, mss;
-       uint8_t ipcss, ipcso, tucss, tucso, hdr_len;
+       u32 cmd_length = 0;
+       u16 ipcse = 0, tucse, mss;
+       u8 ipcss, ipcso, tucss, tucso, hdr_len;
        int err;
 
        if (skb_is_gso(skb)) {
@@ -2940,19 +2987,19 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
                if (++i == tx_ring->count) i = 0;
                tx_ring->next_to_use = i;
 
-               return TRUE;
+               return true;
        }
-       return FALSE;
+       return false;
 }
 
-static boolean_t
+static bool
 e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
               struct sk_buff *skb)
 {
        struct e1000_context_desc *context_desc;
        struct e1000_buffer *buffer_info;
        unsigned int i;
-       uint8_t css;
+       u8 css;
 
        if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
                css = skb_transport_offset(skb);
@@ -2975,10 +3022,10 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
                if (unlikely(++i == tx_ring->count)) i = 0;
                tx_ring->next_to_use = i;
 
-               return TRUE;
+               return true;
        }
 
-       return FALSE;
+       return false;
 }
 
 #define E1000_MAX_TXD_PWR      12
@@ -3097,7 +3144,7 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
 {
        struct e1000_tx_desc *tx_desc = NULL;
        struct e1000_buffer *buffer_info;
-       uint32_t txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS;
+       u32 txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS;
        unsigned int i;
 
        if (likely(tx_flags & E1000_TX_FLAGS_TSO)) {
@@ -3161,8 +3208,8 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
 static int
 e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb)
 {
-       uint32_t fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
-       uint32_t skb_fifo_len = skb->len + E1000_FIFO_HDR;
+       u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head;
+       u32 skb_fifo_len = skb->len + E1000_FIFO_HDR;
 
        skb_fifo_len = ALIGN(skb_fifo_len, E1000_FIFO_HDR);
 
@@ -3189,7 +3236,7 @@ static int
 e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
 {
        struct e1000_hw *hw =  &adapter->hw;
-       uint16_t length, offset;
+       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 &
@@ -3200,17 +3247,17 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
                struct ethhdr *eth = (struct ethhdr *) skb->data;
                if ((htons(ETH_P_IP) == eth->h_proto)) {
                        const struct iphdr *ip =
-                               (struct iphdr *)((uint8_t *)skb->data+14);
+                               (struct iphdr *)((u8 *)skb->data+14);
                        if (IPPROTO_UDP == ip->protocol) {
                                struct udphdr *udp =
-                                       (struct udphdr *)((uint8_t *)ip +
+                                       (struct udphdr *)((u8 *)ip +
                                                (ip->ihl << 2));
                                if (ntohs(udp->dest) == 67) {
-                                       offset = (uint8_t *)udp + 8 - skb->data;
+                                       offset = (u8 *)udp + 8 - skb->data;
                                        length = skb->len - offset;
 
                                        return e1000_mng_write_dhcp_info(hw,
-                                                       (uint8_t *)udp + 8,
+                                                       (u8 *)udp + 8,
                                                        length);
                                }
                        }
@@ -3290,7 +3337,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
         * overrun the FIFO, adjust the max buffer len if mss
         * drops. */
        if (mss) {
-               uint8_t hdr_len;
+               u8 hdr_len;
                max_per_txd = min(mss << 2, max_per_txd);
                max_txd_pwr = fls(max_per_txd) - 1;
 
@@ -3477,7 +3524,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
        int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
-       uint16_t eeprom_data = 0;
+       u16 eeprom_data = 0;
 
        if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
            (max_frame > MAX_JUMBO_FRAME_SIZE)) {
@@ -3572,7 +3619,7 @@ e1000_update_stats(struct e1000_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
        unsigned long flags;
-       uint16_t phy_tmp;
+       u16 phy_tmp;
 
 #define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
 
@@ -3679,10 +3726,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
        }
 
        /* Fill out the OS statistics structure */
-       adapter->net_stats.rx_packets = adapter->stats.gprc;
-       adapter->net_stats.tx_packets = adapter->stats.gptc;
-       adapter->net_stats.rx_bytes = adapter->stats.gorcl;
-       adapter->net_stats.tx_bytes = adapter->stats.gotcl;
        adapter->net_stats.multicast = adapter->stats.mprc;
        adapter->net_stats.collisions = adapter->stats.colc;
 
@@ -3753,13 +3796,10 @@ e1000_intr_msi(int irq, void *data)
 #ifndef CONFIG_E1000_NAPI
        int i;
 #endif
-       uint32_t icr = E1000_READ_REG(hw, ICR);
+       u32 icr = E1000_READ_REG(hw, ICR);
+
+       /* in NAPI mode read ICR disables interrupts using IAM */
 
-#ifdef CONFIG_E1000_NAPI
-       /* read ICR disables interrupts using IAM, so keep up with our
-        * enable/disable accounting */
-       atomic_inc(&adapter->irq_sem);
-#endif
        if (icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
                hw->get_link_status = 1;
                /* 80003ES2LAN workaround-- For packet buffer work-around on
@@ -3768,7 +3808,7 @@ e1000_intr_msi(int irq, void *data)
                if (netif_carrier_ok(netdev) &&
                    (adapter->hw.mac_type == e1000_80003es2lan)) {
                        /* disable receives */
-                       uint32_t rctl = E1000_READ_REG(hw, RCTL);
+                       u32 rctl = E1000_READ_REG(hw, RCTL);
                        E1000_WRITE_REG(hw, RCTL, rctl & ~E1000_RCTL_EN);
                }
                /* guard against interrupt when we're going down */
@@ -3815,7 +3855,7 @@ e1000_intr(int irq, void *data)
        struct net_device *netdev = data;
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_hw *hw = &adapter->hw;
-       uint32_t rctl, icr = E1000_READ_REG(hw, ICR);
+       u32 rctl, icr = E1000_READ_REG(hw, ICR);
 #ifndef CONFIG_E1000_NAPI
        int i;
 #endif
@@ -3829,12 +3869,8 @@ e1000_intr(int irq, void *data)
                     !(icr & E1000_ICR_INT_ASSERTED)))
                return IRQ_NONE;
 
-       /* Interrupt Auto-Mask...upon reading ICR,
-        * interrupts are masked.  No need for the
-        * IMC write, but it does mean we should
-        * account for it ASAP. */
-       if (likely(hw->mac_type >= e1000_82571))
-               atomic_inc(&adapter->irq_sem);
+       /* Interrupt Auto-Mask...upon reading ICR, interrupts are masked.  No
+        * need for the IMC write */
 #endif
 
        if (unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) {
@@ -3858,7 +3894,6 @@ e1000_intr(int irq, void *data)
 #ifdef CONFIG_E1000_NAPI
        if (unlikely(hw->mac_type < e1000_82571)) {
                /* disable interrupts, without the synchronize_irq bit */
-               atomic_inc(&adapter->irq_sem);
                E1000_WRITE_REG(hw, IMC, ~0);
                E1000_WRITE_FLUSH(hw);
        }
@@ -3883,10 +3918,8 @@ e1000_intr(int irq, void *data)
         * in dead lock. Writing IMC forces 82547 into
         * de-assertion state.
         */
-       if (hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2) {
-               atomic_inc(&adapter->irq_sem);
+       if (hw->mac_type == e1000_82547 || hw->mac_type == e1000_82547_rev_2)
                E1000_WRITE_REG(hw, IMC, ~0);
-       }
 
        adapter->total_tx_bytes = 0;
        adapter->total_rx_bytes = 0;
@@ -3924,27 +3957,24 @@ e1000_clean(struct napi_struct *napi, int budget)
        /* Must NOT use netdev_priv macro here. */
        adapter = poll_dev->priv;
 
-       /* Keep link state information with original netdev */
-       if (!netif_carrier_ok(poll_dev))
-               goto quit_polling;
-
        /* e1000_clean is called per-cpu.  This lock protects
         * tx_ring[0] from being cleaned by multiple cpus
         * simultaneously.  A failure obtaining the lock means
         * tx_ring[0] is currently being cleaned anyway. */
        if (spin_trylock(&adapter->tx_queue_lock)) {
                tx_cleaned = e1000_clean_tx_irq(adapter,
-                                               &adapter->tx_ring[0]);
+                                               &adapter->tx_ring[0]);
                spin_unlock(&adapter->tx_queue_lock);
        }
 
        adapter->clean_rx(adapter, &adapter->rx_ring[0],
                          &work_done, budget);
 
-       /* If no Tx and not enough Rx work done, exit the polling mode */
-       if ((!tx_cleaned && (work_done < budget)) ||
-          !netif_running(poll_dev)) {
-quit_polling:
+       if (tx_cleaned)
+               work_done = budget;
+
+       /* If budget not fully consumed, exit the polling mode */
+       if (work_done < budget) {
                if (likely(adapter->itr_setting & 3))
                        e1000_set_itr(adapter);
                netif_rx_complete(poll_dev, napi);
@@ -3960,7 +3990,7 @@ quit_polling:
  * @adapter: board private structure
  **/
 
-static boolean_t
+static bool
 e1000_clean_tx_irq(struct e1000_adapter *adapter,
                    struct e1000_tx_ring *tx_ring)
 {
@@ -3971,7 +4001,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
 #ifdef CONFIG_E1000_NAPI
        unsigned int count = 0;
 #endif
-       boolean_t cleaned = FALSE;
+       bool cleaned = false;
        unsigned int total_tx_bytes=0, total_tx_packets=0;
 
        i = tx_ring->next_to_clean;
@@ -3979,7 +4009,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
        eop_desc = E1000_TX_DESC(*tx_ring, eop);
 
        while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
-               for (cleaned = FALSE; !cleaned; ) {
+               for (cleaned = false; !cleaned; ) {
                        tx_desc = E1000_TX_DESC(*tx_ring, i);
                        buffer_info = &tx_ring->buffer_info[i];
                        cleaned = (i == eop);
@@ -4027,7 +4057,7 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
        if (adapter->detect_tx_hung) {
                /* Detect a transmit hang in hardware, this serializes the
                 * check with the clearing of time_stamp and movement of i */
-               adapter->detect_tx_hung = FALSE;
+               adapter->detect_tx_hung = false;
                if (tx_ring->buffer_info[eop].dma &&
                    time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
                               (adapter->tx_timeout_factor * HZ))
@@ -4061,6 +4091,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
        }
        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;
 }
 
@@ -4074,11 +4106,11 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter,
 
 static void
 e1000_rx_checksum(struct e1000_adapter *adapter,
-                 uint32_t status_err, uint32_t csum,
+                 u32 status_err, u32 csum,
                  struct sk_buff *skb)
 {
-       uint16_t status = (uint16_t)status_err;
-       uint8_t errors = (uint8_t)(status_err >> 24);
+       u16 status = (u16)status_err;
+       u8 errors = (u8)(status_err >> 24);
        skb->ip_summed = CHECKSUM_NONE;
 
        /* 82543 or newer only */
@@ -4108,8 +4140,8 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
                /* Hardware complements the payload checksum, so we undo it
                 * and then put the value in host order for further stack use.
                 */
-               csum = ntohl(csum ^ 0xFFFF);
-               skb->csum = csum;
+               __sum16 sum = (__force __sum16)htons(csum);
+               skb->csum = csum_unfold(~sum);
                skb->ip_summed = CHECKSUM_COMPLETE;
        }
        adapter->hw_csum_good++;
@@ -4120,7 +4152,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
  * @adapter: board private structure
  **/
 
-static boolean_t
+static bool
 #ifdef CONFIG_E1000_NAPI
 e1000_clean_rx_irq(struct e1000_adapter *adapter,
                    struct e1000_rx_ring *rx_ring,
@@ -4135,11 +4167,11 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
        struct e1000_rx_desc *rx_desc, *next_rxd;
        struct e1000_buffer *buffer_info, *next_buffer;
        unsigned long flags;
-       uint32_t length;
-       uint8_t last_byte;
+       u32 length;
+       u8 last_byte;
        unsigned int i;
        int cleaned_count = 0;
-       boolean_t cleaned = FALSE;
+       bool cleaned = false;
        unsigned int total_rx_bytes=0, total_rx_packets=0;
 
        i = rx_ring->next_to_clean;
@@ -4167,7 +4199,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
 
                next_buffer = &rx_ring->buffer_info[i];
 
-               cleaned = TRUE;
+               cleaned = true;
                cleaned_count++;
                pci_unmap_single(pdev,
                                 buffer_info->dma,
@@ -4236,8 +4268,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
 
                /* Receive Checksum Offload */
                e1000_rx_checksum(adapter,
-                                 (uint32_t)(status) |
-                                 ((uint32_t)(rx_desc->errors) << 24),
+                                 (u32)(status) |
+                                 ((u32)(rx_desc->errors) << 24),
                                  le16_to_cpu(rx_desc->csum), skb);
 
                skb->protocol = eth_type_trans(skb, netdev);
@@ -4283,6 +4315,8 @@ next_desc:
 
        adapter->total_rx_packets += total_rx_packets;
        adapter->total_rx_bytes += total_rx_bytes;
+       adapter->net_stats.rx_bytes += total_rx_bytes;
+       adapter->net_stats.rx_packets += total_rx_packets;
        return cleaned;
 }
 
@@ -4291,7 +4325,7 @@ next_desc:
  * @adapter: board private structure
  **/
 
-static boolean_t
+static bool
 #ifdef CONFIG_E1000_NAPI
 e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                       struct e1000_rx_ring *rx_ring,
@@ -4309,9 +4343,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
        struct e1000_ps_page_dma *ps_page_dma;
        struct sk_buff *skb;
        unsigned int i, j;
-       uint32_t length, staterr;
+       u32 length, staterr;
        int cleaned_count = 0;
-       boolean_t cleaned = FALSE;
+       bool cleaned = false;
        unsigned int total_rx_bytes=0, total_rx_packets=0;
 
        i = rx_ring->next_to_clean;
@@ -4338,7 +4372,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
 
                next_buffer = &rx_ring->buffer_info[i];
 
-               cleaned = TRUE;
+               cleaned = true;
                cleaned_count++;
                pci_unmap_single(pdev, buffer_info->dma,
                                 buffer_info->length,
@@ -4470,6 +4504,8 @@ next_desc:
 
        adapter->total_rx_packets += total_rx_packets;
        adapter->total_rx_bytes += total_rx_bytes;
+       adapter->net_stats.rx_bytes += total_rx_bytes;
+       adapter->net_stats.rx_packets += total_rx_packets;
        return cleaned;
 }
 
@@ -4633,7 +4669,7 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
                                rx_desc->read.buffer_addr[j+1] =
                                     cpu_to_le64(ps_page_dma->ps_page_dma[j]);
                        } else
-                               rx_desc->read.buffer_addr[j+1] = ~0;
+                               rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0);
                }
 
                skb = netdev_alloc_skb(netdev,
@@ -4690,8 +4726,8 @@ no_buffers:
 static void
 e1000_smartspeed(struct e1000_adapter *adapter)
 {
-       uint16_t phy_status;
-       uint16_t phy_ctrl;
+       u16 phy_status;
+       u16 phy_ctrl;
 
        if ((adapter->hw.phy_type != e1000_phy_igp) || !adapter->hw.autoneg ||
           !(adapter->hw.autoneg_advertised & ADVERTISE_1000_FULL))
@@ -4770,8 +4806,8 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct mii_ioctl_data *data = if_mii(ifr);
        int retval;
-       uint16_t mii_reg;
-       uint16_t spddplx;
+       u16 mii_reg;
+       u16 spddplx;
        unsigned long flags;
 
        if (adapter->hw.media_type != e1000_media_type_copper)
@@ -4876,22 +4912,6 @@ e1000_pci_clear_mwi(struct e1000_hw *hw)
        pci_clear_mwi(adapter->pdev);
 }
 
-void
-e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
-{
-       struct e1000_adapter *adapter = hw->back;
-
-       pci_read_config_word(adapter->pdev, reg, value);
-}
-
-void
-e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
-{
-       struct e1000_adapter *adapter = hw->back;
-
-       pci_write_config_word(adapter->pdev, reg, *value);
-}
-
 int
 e1000_pcix_get_mmrbc(struct e1000_hw *hw)
 {
@@ -4906,11 +4926,11 @@ e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
        pcix_set_mmrbc(adapter->pdev, mmrbc);
 }
 
-int32_t
-e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
+s32
+e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
     struct e1000_adapter *adapter = hw->back;
-    uint16_t cap_offset;
+    u16 cap_offset;
 
     cap_offset = pci_find_capability(adapter->pdev, PCI_CAP_ID_EXP);
     if (!cap_offset)
@@ -4922,7 +4942,7 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
 }
 
 void
-e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value)
+e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value)
 {
        outl(value, port);
 }
@@ -4931,9 +4951,10 @@ static void
 e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
-       uint32_t ctrl, rctl;
+       u32 ctrl, rctl;
 
-       e1000_irq_disable(adapter);
+       if (!test_bit(__E1000_DOWN, &adapter->flags))
+               e1000_irq_disable(adapter);
        adapter->vlgrp = grp;
 
        if (grp) {
@@ -4962,7 +4983,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
                        rctl &= ~E1000_RCTL_VFE;
                        E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
                        if (adapter->mng_vlan_id !=
-                           (uint16_t)E1000_MNG_VLAN_NONE) {
+                           (u16)E1000_MNG_VLAN_NONE) {
                                e1000_vlan_rx_kill_vid(netdev,
                                                       adapter->mng_vlan_id);
                                adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
@@ -4970,14 +4991,15 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
                }
        }
 
-       e1000_irq_enable(adapter);
+       if (!test_bit(__E1000_DOWN, &adapter->flags))
+               e1000_irq_enable(adapter);
 }
 
 static void
-e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
+e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
-       uint32_t vfta, index;
+       u32 vfta, index;
 
        if ((adapter->hw.mng_cookie.status &
             E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
@@ -4991,14 +5013,16 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid)
 }
 
 static void
-e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
+e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
-       uint32_t vfta, index;
+       u32 vfta, index;
 
-       e1000_irq_disable(adapter);
+       if (!test_bit(__E1000_DOWN, &adapter->flags))
+               e1000_irq_disable(adapter);
        vlan_group_set_device(adapter->vlgrp, vid, NULL);
-       e1000_irq_enable(adapter);
+       if (!test_bit(__E1000_DOWN, &adapter->flags))
+               e1000_irq_enable(adapter);
 
        if ((adapter->hw.mng_cookie.status &
             E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
@@ -5021,7 +5045,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter)
        e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
 
        if (adapter->vlgrp) {
-               uint16_t vid;
+               u16 vid;
                for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
                        if (!vlan_group_get_device(adapter->vlgrp, vid))
                                continue;
@@ -5031,7 +5055,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter)
 }
 
 int
-e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
+e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
 {
        adapter->hw.autoneg = 0;
 
@@ -5072,8 +5096,8 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct e1000_adapter *adapter = netdev_priv(netdev);
-       uint32_t ctrl, ctrl_ext, rctl, status;
-       uint32_t wufc = adapter->wol;
+       u32 ctrl, ctrl_ext, rctl, status;
+       u32 wufc = adapter->wol;
 #ifdef CONFIG_PM
        int retval = 0;
 #endif
@@ -5097,7 +5121,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 
        if (wufc) {
                e1000_setup_rctl(adapter);
-               e1000_set_multi(netdev);
+               e1000_set_rx_mode(netdev);
 
                /* turn on all-multi mode if wake on multicast is enabled */
                if (wufc & E1000_WUFC_MC) {
@@ -5170,7 +5194,7 @@ e1000_resume(struct pci_dev *pdev)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct e1000_adapter *adapter = netdev_priv(netdev);
-       uint32_t err;
+       u32 err;
 
        pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
@@ -5227,7 +5251,6 @@ e1000_netpoll(struct net_device *netdev)
 
        disable_irq(adapter->pdev->irq);
        e1000_intr(adapter->pdev->irq, netdev);
-       e1000_clean_tx_irq(adapter, adapter->tx_ring);
 #ifndef CONFIG_E1000_NAPI
        adapter->clean_rx(adapter, adapter->rx_ring);
 #endif