qlcnic: cleanup dma mask setting
[safe/jmp/linux-2.6] / drivers / net / 3c59x.c
index 32031ea..d75803e 100644 (file)
@@ -77,7 +77,6 @@ static int vortex_debug = 1;
 #include <linux/errno.h>
 #include <linux/in.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/mii.h>
@@ -90,6 +89,7 @@ static int vortex_debug = 1;
 #include <linux/eisa.h>
 #include <linux/bitops.h>
 #include <linux/jiffies.h>
+#include <linux/gfp.h>
 #include <asm/irq.h>                   /* For nr_irqs only. */
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -375,7 +375,7 @@ static struct vortex_chip_info {
 };
 
 
-static struct pci_device_id vortex_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(vortex_pci_tbl) = {
        { 0x10B7, 0x5900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C590 },
        { 0x10B7, 0x5920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C592 },
        { 0x10B7, 0x5970, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C597 },
@@ -837,7 +837,7 @@ static int vortex_resume(struct device *dev)
        return 0;
 }
 
-static struct dev_pm_ops vortex_pm_ops = {
+static const struct dev_pm_ops vortex_pm_ops = {
        .suspend = vortex_suspend,
        .resume = vortex_resume,
        .freeze = vortex_suspend,
@@ -1855,7 +1855,6 @@ leave_media_alone:
        mod_timer(&vp->timer, RUN_AT(next_tick));
        if (vp->deferred)
                iowrite16(FakeIntr, ioaddr + EL3_CMD);
-       return;
 }
 
 static void vortex_tx_timeout(struct net_device *dev)
@@ -1917,7 +1916,7 @@ static void vortex_tx_timeout(struct net_device *dev)
 
        /* Issue Tx Enable */
        iowrite16(TxEnable, ioaddr + EL3_CMD);
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
 
        /* Switch to register set 7 for normal use. */
        EL3WINDOW(7);
@@ -1942,8 +1941,8 @@ vortex_error(struct net_device *dev, int status)
        if (status & TxComplete) {                      /* Really "TxError" for us. */
                tx_status = ioread8(ioaddr + TxStatus);
                /* Presumably a tx-timeout. We must merely re-enable. */
-               if (vortex_debug > 2
-                       || (tx_status != 0x88 && vortex_debug > 0)) {
+               if (vortex_debug > 2 ||
+                   (tx_status != 0x88 && vortex_debug > 0)) {
                        pr_err("%s: Transmit error, Tx status register %2.2x.\n",
                                   dev->name, tx_status);
                        if (tx_status == 0x82) {
@@ -2063,7 +2062,6 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
                }
        }
 
-       dev->trans_start = jiffies;
 
        /* Clear the Tx status stack. */
        {
@@ -2129,8 +2127,8 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
                int i;
 
                vp->tx_ring[entry].frag[0].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data,
-                                                                               skb->len-skb->data_len, PCI_DMA_TODEVICE));
-               vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb->len-skb->data_len);
+                                                                               skb_headlen(skb), PCI_DMA_TODEVICE));
+               vp->tx_ring[entry].frag[0].length = cpu_to_le32(skb_headlen(skb));
 
                for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
                        skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
@@ -2174,7 +2172,6 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
        iowrite16(DownUnstall, ioaddr + EL3_CMD);
        spin_unlock_irqrestore(&vp->lock, flags);
-       dev->trans_start = jiffies;
        return NETDEV_TX_OK;
 }
 
@@ -2800,7 +2797,6 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
        }
 
        EL3WINDOW(old_window >> 13);
-       return;
 }
 
 static int vortex_nway_reset(struct net_device *dev)
@@ -2970,7 +2966,7 @@ static void set_rx_mode(struct net_device *dev)
                if (vortex_debug > 3)
                        pr_notice("%s: Setting promiscuous mode.\n", dev->name);
                new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm;
-       } else  if ((dev->mc_list)  ||  (dev->flags & IFF_ALLMULTI)) {
+       } else  if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) {
                new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast;
        } else
                new_mode = SetRxFilter | RxStation | RxBroadcast;
@@ -3122,7 +3118,6 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
                iowrite16(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
                mdio_delay();
        }
-       return;
 }
 
 /* ACPI: Advanced Configuration and Power Interface. */