ixgbe: Fix RSC completion delay causing Rx interrupts to stop
[safe/jmp/linux-2.6] / drivers / net / pci-skeleton.c
index fffc49b..8c1f698 100644 (file)
@@ -119,7 +119,7 @@ KERN_INFO "  Support available from http://foo.com/bar/baz.html\n";
 
 #ifdef NETDRV_DEBUG
 /* note: prints function name for you */
-#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
 #else
 #  define DPRINTK(fmt, args...)
 #endif
@@ -130,7 +130,7 @@ KERN_INFO "  Support available from http://foo.com/bar/baz.html\n";
 #  define assert(expr) \
         if(!(expr)) {                                  \
         printk( "Assertion failed! %s,%s,%s,line=%d\n",        \
-        #expr,__FILE__,__FUNCTION__,__LINE__);         \
+        #expr,__FILE__,__func__,__LINE__);             \
         }
 #endif
 
@@ -728,6 +728,17 @@ err_out:
        return rc;
 }
 
+static const struct net_device_ops netdrv_netdev_ops = {
+       .ndo_open               = netdrv_open,
+       .ndo_stop               = netdrv_close,
+       .ndo_start_xmit         = netdrv_start_xmit,
+       .ndo_set_multicast_list = netdrv_set_rx_mode,
+       .ndo_do_ioctl           = netdrv_ioctl,
+       .ndo_tx_timeout         = netdrv_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+};
 
 static int __devinit netdrv_init_one (struct pci_dev *pdev,
                                       const struct pci_device_id *ent)
@@ -737,7 +748,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
        int i, addr_len, option;
        void *ioaddr = NULL;
        static int board_idx = -1;
-       DECLARE_MAC_BUF(mac);
 
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
@@ -770,19 +780,13 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
                ((u16 *) (dev->dev_addr))[i] =
                    le16_to_cpu (read_eeprom (ioaddr, i + 7, addr_len));
 
-       /* The Rtl8139-specific entries in the device structure. */
-       dev->open = netdrv_open;
-       dev->hard_start_xmit = netdrv_start_xmit;
-       dev->stop = netdrv_close;
-       dev->set_multicast_list = netdrv_set_rx_mode;
-       dev->do_ioctl = netdrv_ioctl;
-       dev->tx_timeout = netdrv_tx_timeout;
+       dev->netdev_ops = &netdrv_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        dev->irq = pdev->irq;
        dev->base_addr = (unsigned long) ioaddr;
 
-       /* dev->priv/tp zeroed and aligned in alloc_etherdev */
+       /* netdev_priv()/tp zeroed and aligned in alloc_etherdev */
        tp = netdev_priv(dev);
 
        /* note: tp->chipset set in netdrv_init_board */
@@ -797,11 +801,11 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
 
        tp->phys[0] = 32;
 
-       printk (KERN_INFO "%s: %s at 0x%lx, %sIRQ %d\n",
+       printk (KERN_INFO "%s: %s at 0x%lx, %pM IRQ %d\n",
                dev->name,
                board_info[ent->driver_data].name,
                dev->base_addr,
-               print_mac(mac, dev->dev_addr),
+               dev->dev_addr,
                dev->irq);
 
        printk (KERN_DEBUG "%s:  Identified 8139 chip type '%s'\n",
@@ -1566,7 +1570,6 @@ static void netdrv_rx_interrupt (struct net_device *dev,
 
                        skb->protocol = eth_type_trans (skb, dev);
                        netif_rx (skb);
-                       dev->last_rx = jiffies;
                        dev->stats.rx_bytes += pkt_size;
                        dev->stats.rx_packets++;
                } else {
@@ -1739,7 +1742,6 @@ static int netdrv_close (struct net_device *dev)
 
        spin_unlock_irqrestore (&tp->lock, flags);
 
-       synchronize_irq (dev->irq);
        free_irq (dev->irq, dev);
 
        netdrv_tx_clear (dev);