[PATCH] zd1211rw: monitor all packets
[safe/jmp/linux-2.6] / drivers / net / e100.c
index 03bf164..e25f5ec 100644 (file)
 
 #define DRV_NAME               "e100"
 #define DRV_EXT                        "-NAPI"
-#define DRV_VERSION            "3.5.17-k2"DRV_EXT
+#define DRV_VERSION            "3.5.23-k4"DRV_EXT
 #define DRV_DESCRIPTION                "Intel(R) PRO/100 Network Driver"
 #define DRV_COPYRIGHT          "Copyright(c) 1999-2006 Intel Corporation"
 #define PFX                    DRV_NAME ": "
@@ -174,10 +174,13 @@ MODULE_VERSION(DRV_VERSION);
 
 static int debug = 3;
 static int eeprom_bad_csum_allow = 0;
+static int use_io = 0;
 module_param(debug, int, 0);
 module_param(eeprom_bad_csum_allow, int, 0);
+module_param(use_io, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
+MODULE_PARM_DESC(use_io, "Force use of i/o access mode");
 #define DPRINTK(nlevel, klevel, fmt, args...) \
        (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
        printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
@@ -536,6 +539,7 @@ struct nic {
        struct csr __iomem *csr;
        enum scb_cmd_lo cuc_cmd;
        unsigned int cbs_avail;
+       struct napi_struct napi;
        struct cb *cbs;
        struct cb *cb_to_use;
        struct cb *cb_to_send;
@@ -580,7 +584,6 @@ struct nic {
        u32 rx_tco_frames;
        u32 rx_over_length_errors;
 
-       u8 rev_id;
        u16 leds;
        u16 eeprom_wc;
        u16 eeprom[256];
@@ -591,7 +594,7 @@ static inline void e100_write_flush(struct nic *nic)
 {
        /* Flush previous PCI writes through intermediate bridges
         * by doing a benign read */
-       (void)readb(&nic->csr->scb.status);
+       (void)ioread8(&nic->csr->scb.status);
 }
 
 static void e100_enable_irq(struct nic *nic)
@@ -599,7 +602,7 @@ static void e100_enable_irq(struct nic *nic)
        unsigned long flags;
 
        spin_lock_irqsave(&nic->cmd_lock, flags);
-       writeb(irq_mask_none, &nic->csr->scb.cmd_hi);
+       iowrite8(irq_mask_none, &nic->csr->scb.cmd_hi);
        e100_write_flush(nic);
        spin_unlock_irqrestore(&nic->cmd_lock, flags);
 }
@@ -609,7 +612,7 @@ static void e100_disable_irq(struct nic *nic)
        unsigned long flags;
 
        spin_lock_irqsave(&nic->cmd_lock, flags);
-       writeb(irq_mask_all, &nic->csr->scb.cmd_hi);
+       iowrite8(irq_mask_all, &nic->csr->scb.cmd_hi);
        e100_write_flush(nic);
        spin_unlock_irqrestore(&nic->cmd_lock, flags);
 }
@@ -618,11 +621,11 @@ static void e100_hw_reset(struct nic *nic)
 {
        /* Put CU and RU into idle with a selective reset to get
         * device off of PCI bus */
-       writel(selective_reset, &nic->csr->port);
+       iowrite32(selective_reset, &nic->csr->port);
        e100_write_flush(nic); udelay(20);
 
        /* Now fully reset device */
-       writel(software_reset, &nic->csr->port);
+       iowrite32(software_reset, &nic->csr->port);
        e100_write_flush(nic); udelay(20);
 
        /* Mask off our interrupt line - it's unmasked after reset */
@@ -639,7 +642,7 @@ static int e100_self_test(struct nic *nic)
        nic->mem->selftest.signature = 0;
        nic->mem->selftest.result = 0xFFFFFFFF;
 
-       writel(selftest | dma_addr, &nic->csr->port);
+       iowrite32(selftest | dma_addr, &nic->csr->port);
        e100_write_flush(nic);
        /* Wait 10 msec for self-test to complete */
        msleep(10);
@@ -677,23 +680,23 @@ static void e100_eeprom_write(struct nic *nic, u16 addr_len, u16 addr, u16 data)
        for(j = 0; j < 3; j++) {
 
                /* Chip select */
-               writeb(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
+               iowrite8(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
                e100_write_flush(nic); udelay(4);
 
                for(i = 31; i >= 0; i--) {
                        ctrl = (cmd_addr_data[j] & (1 << i)) ?
                                eecs | eedi : eecs;
-                       writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
+                       iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo);
                        e100_write_flush(nic); udelay(4);
 
-                       writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
+                       iowrite8(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
                        e100_write_flush(nic); udelay(4);
                }
                /* Wait 10 msec for cmd to complete */
                msleep(10);
 
                /* Chip deselect */
-               writeb(0, &nic->csr->eeprom_ctrl_lo);
+               iowrite8(0, &nic->csr->eeprom_ctrl_lo);
                e100_write_flush(nic); udelay(4);
        }
 };
@@ -709,21 +712,21 @@ static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
        cmd_addr_data = ((op_read << *addr_len) | addr) << 16;
 
        /* Chip select */
-       writeb(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
+       iowrite8(eecs | eesk, &nic->csr->eeprom_ctrl_lo);
        e100_write_flush(nic); udelay(4);
 
        /* Bit-bang to read word from eeprom */
        for(i = 31; i >= 0; i--) {
                ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs;
-               writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
+               iowrite8(ctrl, &nic->csr->eeprom_ctrl_lo);
                e100_write_flush(nic); udelay(4);
 
-               writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
+               iowrite8(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
                e100_write_flush(nic); udelay(4);
 
                /* Eeprom drives a dummy zero to EEDO after receiving
                 * complete address.  Use this to adjust addr_len. */
-               ctrl = readb(&nic->csr->eeprom_ctrl_lo);
+               ctrl = ioread8(&nic->csr->eeprom_ctrl_lo);
                if(!(ctrl & eedo) && i > 16) {
                        *addr_len -= (i - 16);
                        i = 17;
@@ -733,7 +736,7 @@ static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
        }
 
        /* Chip deselect */
-       writeb(0, &nic->csr->eeprom_ctrl_lo);
+       iowrite8(0, &nic->csr->eeprom_ctrl_lo);
        e100_write_flush(nic); udelay(4);
 
        return le16_to_cpu(data);
@@ -804,7 +807,7 @@ static int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr)
 
        /* Previous command is accepted when SCB clears */
        for(i = 0; i < E100_WAIT_SCB_TIMEOUT; i++) {
-               if(likely(!readb(&nic->csr->scb.cmd_lo)))
+               if(likely(!ioread8(&nic->csr->scb.cmd_lo)))
                        break;
                cpu_relax();
                if(unlikely(i > E100_WAIT_SCB_FAST))
@@ -816,8 +819,8 @@ static int e100_exec_cmd(struct nic *nic, u8 cmd, dma_addr_t dma_addr)
        }
 
        if(unlikely(cmd != cuc_resume))
-               writel(dma_addr, &nic->csr->scb.gen_ptr);
-       writeb(cmd, &nic->csr->scb.cmd_lo);
+               iowrite32(dma_addr, &nic->csr->scb.gen_ptr);
+       iowrite8(cmd, &nic->csr->scb.cmd_lo);
 
 err_unlock:
        spin_unlock_irqrestore(&nic->cmd_lock, flags);
@@ -895,7 +898,7 @@ static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
         */
        spin_lock_irqsave(&nic->mdio_lock, flags);
        for (i = 100; i; --i) {
-               if (readl(&nic->csr->mdi_ctrl) & mdi_ready)
+               if (ioread32(&nic->csr->mdi_ctrl) & mdi_ready)
                        break;
                udelay(20);
        }
@@ -905,11 +908,11 @@ static u16 mdio_ctrl(struct nic *nic, u32 addr, u32 dir, u32 reg, u16 data)
                spin_unlock_irqrestore(&nic->mdio_lock, flags);
                return 0;               /* No way to indicate timeout error */
        }
-       writel((reg << 16) | (addr << 21) | dir | data, &nic->csr->mdi_ctrl);
+       iowrite32((reg << 16) | (addr << 21) | dir | data, &nic->csr->mdi_ctrl);
 
        for (i = 0; i < 100; i++) {
                udelay(20);
-               if ((data_out = readl(&nic->csr->mdi_ctrl)) & mdi_ready)
+               if ((data_out = ioread32(&nic->csr->mdi_ctrl)) & mdi_ready)
                        break;
        }
        spin_unlock_irqrestore(&nic->mdio_lock, flags);
@@ -934,9 +937,8 @@ static void e100_get_defaults(struct nic *nic)
        struct param_range rfds = { .min = 16, .max = 256, .count = 256 };
        struct param_range cbs  = { .min = 64, .max = 256, .count = 128 };
 
-       pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id);
        /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */
-       nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->rev_id;
+       nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision;
        if(nic->mac == mac_unknown)
                nic->mac = mac_82557_D100_A;
 
@@ -1021,10 +1023,16 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
                config->mwi_enable = 0x1;       /* 1=enable, 0=disable */
                config->standard_tcb = 0x0;     /* 1=standard, 0=extended */
                config->rx_long_ok = 0x1;       /* 1=VLANs ok, 0=standard */
-               if(nic->mac >= mac_82559_D101M)
+               if (nic->mac >= mac_82559_D101M) {
                        config->tno_intr = 0x1;         /* TCO stats enable */
-               else
+                       /* Enable TCO in extended config */
+                       if (nic->mac >= mac_82551_10) {
+                               config->byte_count = 0x20; /* extended bytes */
+                               config->rx_d102_mode = 0x1; /* GMRC for TCO */
+                       }
+               } else {
                        config->standard_stat_counter = 0x0;
+               }
        }
 
        DPRINTK(HW, DEBUG, "[00-07]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
@@ -1270,7 +1278,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb
        if (nic->flags & ich)
                goto noloaducode;
 
-       /* Search for ucode match against h/w rev_id */
+       /* Search for ucode match against h/w revision */
        for (opts = ucode_opts; opts->mac; opts++) {
                int i;
                u32 *ucode = opts->ucode;
@@ -1318,7 +1326,7 @@ static inline int e100_exec_cb_wait(struct nic *nic, struct sk_buff *skb,
        }
 
        /* ack any interupts, something could have been set */
-       writeb(~0, &nic->csr->scb.stat_ack);
+       iowrite8(~0, &nic->csr->scb.stat_ack);
 
        /* if the command failed, or is not OK, notify and return */
        if (!counter || !(cb->status & cpu_to_le16(cb_ok))) {
@@ -1580,7 +1588,7 @@ static void e100_watchdog(unsigned long data)
         * accidentally, due to hardware that shares a register between the
         * interrupt mask bit and the SW Interrupt generation bit */
        spin_lock_irq(&nic->cmd_lock);
-       writeb(readb(&nic->csr->scb.cmd_hi) | irq_sw_gen,&nic->csr->scb.cmd_hi);
+       iowrite8(ioread8(&nic->csr->scb.cmd_hi) | irq_sw_gen,&nic->csr->scb.cmd_hi);
        e100_write_flush(nic);
        spin_unlock_irq(&nic->cmd_lock);
 
@@ -1769,7 +1777,7 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
 
        /* Align, init, and map the RFD. */
        skb_reserve(rx->skb, NET_IP_ALIGN);
-       memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
+       skb_copy_to_linear_data(rx->skb, &nic->blank_rfd, sizeof(struct rfd));
        rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
                RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL);
 
@@ -1930,9 +1938,8 @@ static int e100_rx_alloc_list(struct nic *nic)
        nic->rx_to_use = nic->rx_to_clean = NULL;
        nic->ru_running = RU_UNINITIALIZED;
 
-       if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
+       if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
                return -ENOMEM;
-       memset(nic->rxs, 0, sizeof(struct rx) * count);
 
        for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
                rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
@@ -1953,7 +1960,7 @@ static irqreturn_t e100_intr(int irq, void *dev_id)
 {
        struct net_device *netdev = dev_id;
        struct nic *nic = netdev_priv(netdev);
-       u8 stat_ack = readb(&nic->csr->scb.stat_ack);
+       u8 stat_ack = ioread8(&nic->csr->scb.stat_ack);
 
        DPRINTK(INTR, DEBUG, "stat_ack = 0x%02X\n", stat_ack);
 
@@ -1962,41 +1969,37 @@ static irqreturn_t e100_intr(int irq, void *dev_id)
                return IRQ_NONE;
 
        /* Ack interrupt(s) */
-       writeb(stat_ack, &nic->csr->scb.stat_ack);
+       iowrite8(stat_ack, &nic->csr->scb.stat_ack);
 
        /* We hit Receive No Resource (RNR); restart RU after cleaning */
        if(stat_ack & stat_ack_rnr)
                nic->ru_running = RU_SUSPENDED;
 
-       if(likely(netif_rx_schedule_prep(netdev))) {
+       if(likely(netif_rx_schedule_prep(netdev, &nic->napi))) {
                e100_disable_irq(nic);
-               __netif_rx_schedule(netdev);
+               __netif_rx_schedule(netdev, &nic->napi);
        }
 
        return IRQ_HANDLED;
 }
 
-static int e100_poll(struct net_device *netdev, int *budget)
+static int e100_poll(struct napi_struct *napi, int budget)
 {
-       struct nic *nic = netdev_priv(netdev);
-       unsigned int work_to_do = min(netdev->quota, *budget);
-       unsigned int work_done = 0;
+       struct nic *nic = container_of(napi, struct nic, napi);
+       struct net_device *netdev = nic->netdev;
+       int work_done = 0;
        int tx_cleaned;
 
-       e100_rx_clean(nic, &work_done, work_to_do);
+       e100_rx_clean(nic, &work_done, budget);
        tx_cleaned = e100_tx_clean(nic);
 
        /* If no Rx and Tx cleanup work was done, exit polling mode. */
        if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
-               netif_rx_complete(netdev);
+               netif_rx_complete(netdev, napi);
                e100_enable_irq(nic);
-               return 0;
        }
 
-       *budget -= work_done;
-       netdev->quota -= work_done;
-
-       return 1;
+       return work_done;
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2065,7 +2068,7 @@ static int e100_up(struct nic *nic)
                nic->netdev->name, nic->netdev)))
                goto err_no_irq;
        netif_wake_queue(nic->netdev);
-       netif_poll_enable(nic->netdev);
+       napi_enable(&nic->napi);
        /* enable ints _after_ enabling poll, preventing a race between
         * disable ints+schedule */
        e100_enable_irq(nic);
@@ -2083,7 +2086,7 @@ err_rx_clean_list:
 static void e100_down(struct nic *nic)
 {
        /* wait here for poll to complete */
-       netif_poll_disable(nic->netdev);
+       napi_disable(&nic->napi);
        netif_stop_queue(nic->netdev);
        e100_hw_reset(nic);
        free_irq(nic->pdev->irq, nic->netdev);
@@ -2108,7 +2111,7 @@ static void e100_tx_timeout_task(struct work_struct *work)
        struct net_device *netdev = nic->netdev;
 
        DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n",
-               readb(&nic->csr->scb.status));
+               ioread8(&nic->csr->scb.status));
        e100_down(netdev_priv(netdev));
        e100_up(netdev_priv(netdev));
 }
@@ -2230,10 +2233,10 @@ static void e100_get_regs(struct net_device *netdev,
        u32 *buff = p;
        int i;
 
-       regs->version = (1 << 24) | nic->rev_id;
-       buff[0] = readb(&nic->csr->scb.cmd_hi) << 24 |
-               readb(&nic->csr->scb.cmd_lo) << 16 |
-               readw(&nic->csr->scb.status);
+       regs->version = (1 << 24) | nic->pdev->revision;
+       buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 |
+               ioread8(&nic->csr->scb.cmd_lo) << 16 |
+               ioread16(&nic->csr->scb.status);
        for(i = E100_PHY_REGS; i >= 0; i--)
                buff[1 + E100_PHY_REGS - i] =
                        mdio_read(netdev, nic->mii.phy_id, i);
@@ -2500,7 +2503,6 @@ static const struct ethtool_ops e100_ethtool_ops = {
        .phys_id                = e100_phys_id,
        .get_stats_count        = e100_get_stats_count,
        .get_ethtool_stats      = e100_get_ethtool_stats,
-       .get_perm_addr          = ethtool_op_get_perm_addr,
 };
 
 static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
@@ -2567,14 +2569,13 @@ static int __devinit e100_probe(struct pci_dev *pdev,
        SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops);
        netdev->tx_timeout = e100_tx_timeout;
        netdev->watchdog_timeo = E100_WATCHDOG_PERIOD;
-       netdev->poll = e100_poll;
-       netdev->weight = E100_NAPI_WEIGHT;
 #ifdef CONFIG_NET_POLL_CONTROLLER
        netdev->poll_controller = e100_netpoll;
 #endif
        strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);
 
        nic = netdev_priv(netdev);
+       netif_napi_add(netdev, &nic->napi, e100_poll, E100_NAPI_WEIGHT);
        nic->netdev = netdev;
        nic->pdev = pdev;
        nic->msg_enable = (1 << debug) - 1;
@@ -2605,7 +2606,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
        SET_MODULE_OWNER(netdev);
        SET_NETDEV_DEV(netdev, &pdev->dev);
 
-       nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
+       if (use_io)
+               DPRINTK(PROBE, INFO, "using i/o access mode\n");
+
+       nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr));
        if(!nic->csr) {
                DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
                err = -ENOMEM;
@@ -2652,11 +2656,16 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 
        memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN);
        memcpy(netdev->perm_addr, nic->eeprom, ETH_ALEN);
-       if(!is_valid_ether_addr(netdev->perm_addr)) {
-               DPRINTK(PROBE, ERR, "Invalid MAC address from "
-                       "EEPROM, aborting.\n");
-               err = -EAGAIN;
-               goto err_out_free;
+       if (!is_valid_ether_addr(netdev->perm_addr)) {
+               if (!eeprom_bad_csum_allow) {
+                       DPRINTK(PROBE, ERR, "Invalid MAC address from "
+                               "EEPROM, aborting.\n");
+                       err = -EAGAIN;
+                       goto err_out_free;
+               } else {
+                       DPRINTK(PROBE, ERR, "Invalid MAC address from EEPROM, "
+                               "you MUST configure one.\n");
+               }
        }
 
        /* Wol magic packet can be enabled from eeprom */
@@ -2677,7 +2686,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 
        DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, "
                "MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
-               (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
+               (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), pdev->irq,
                netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
                netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
 
@@ -2686,7 +2695,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 err_out_free:
        e100_free(nic);
 err_out_iounmap:
-       iounmap(nic->csr);
+       pci_iounmap(pdev, nic->csr);
 err_out_free_res:
        pci_release_regions(pdev);
 err_out_disable_pdev:
@@ -2719,12 +2728,11 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-#ifdef CONFIG_E100_NAPI
        if (netif_running(netdev))
-               netif_poll_disable(nic->netdev);
-#endif
+               napi_disable(&nic->napi);
        del_timer_sync(&nic->watchdog);
        netif_carrier_off(nic->netdev);
+       netif_device_detach(netdev);
 
        pci_save_state(pdev);
 
@@ -2737,6 +2745,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
        }
 
        pci_disable_device(pdev);
+       free_irq(pdev->irq, netdev);
        pci_set_power_state(pdev, PCI_D3hot);
 
        return 0;
@@ -2760,16 +2769,13 @@ static int e100_resume(struct pci_dev *pdev)
 }
 #endif /* CONFIG_PM */
 
-
 static void e100_shutdown(struct pci_dev *pdev)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-#ifdef CONFIG_E100_NAPI
        if (netif_running(netdev))
-               netif_poll_disable(nic->netdev);
-#endif
+               napi_disable(&nic->napi);
        del_timer_sync(&nic->watchdog);
        netif_carrier_off(nic->netdev);
 
@@ -2794,12 +2800,13 @@ static void e100_shutdown(struct pci_dev *pdev)
 static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
+       struct nic *nic = netdev_priv(netdev);
 
        /* Similar to calling e100_down(), but avoids adpater I/O. */
        netdev->stop(netdev);
 
        /* Detach; put netif into state similar to hotplug unplug. */
-       netif_poll_enable(netdev);
+       napi_enable(&nic->napi);
        netif_device_detach(netdev);
        pci_disable_device(pdev);