Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[safe/jmp/linux-2.6] / drivers / net / acenic.c
index 5b396ff..97a3dfd 100644 (file)
@@ -67,6 +67,7 @@
 #include <linux/highmem.h>
 #include <linux/sockios.h>
 #include <linux/firmware.h>
+#include <linux/slab.h>
 
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 #include <linux/if_vlan.h>
 #define PCI_DEVICE_ID_SGI_ACENIC       0x0009
 #endif
 
-static struct pci_device_id acenic_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(acenic_pci_tbl) = {
        { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE,
          PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, },
        { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_COPPER,
@@ -437,7 +438,7 @@ MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descript
 MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
 
 
-static char version[] __devinitdata =
+static const char version[] __devinitconst =
   "acenic.c: v0.92 08/05/2002  Jes Sorensen, linux-acenic@SunSITE.dk\n"
   "                            http://home.cern.ch/~jes/gige/acenic.html\n";
 
@@ -460,6 +461,7 @@ static const struct net_device_ops ace_netdev_ops = {
        .ndo_get_stats          = ace_get_stats,
        .ndo_start_xmit         = ace_start_xmit,
        .ndo_set_multicast_list = ace_set_multicast_list,
+       .ndo_validate_addr      = eth_validate_addr,
        .ndo_set_mac_address    = ace_set_mac_addr,
        .ndo_change_mtu         = ace_change_mtu,
 #if ACENIC_DO_VLAN
@@ -1160,9 +1162,9 @@ static int __devinit ace_init(struct net_device *dev)
        /*
         * Configure DMA attributes.
         */
-       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
+       if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
                ap->pci_using_dac = 1;
-       } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+       } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
                ap->pci_using_dac = 0;
        } else {
                ecode = -ENODEV;
@@ -1208,7 +1210,8 @@ static int __devinit ace_init(struct net_device *dev)
        memset(ap->info, 0, sizeof(struct ace_info));
        memset(ap->skb, 0, sizeof(struct ace_skb));
 
-       if (ace_load_firmware(dev))
+       ecode = ace_load_firmware(dev);
+       if (ecode)
                goto init_error;
 
        ap->fw_running = 0;
@@ -2463,7 +2466,8 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr,
 }
 
 
-static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t ace_start_xmit(struct sk_buff *skb,
+                                 struct net_device *dev)
 {
        struct ace_private *ap = netdev_priv(dev);
        struct ace_regs __iomem *regs = ap->regs;
@@ -2572,7 +2576,6 @@ restart:
                        netif_wake_queue(dev);
        }
 
-       dev->trans_start = jiffies;
        return NETDEV_TX_OK;
 
 overflow:
@@ -2843,7 +2846,7 @@ static void ace_set_multicast_list(struct net_device *dev)
         * set the entire multicast list at a time and keeping track of
         * it here is going to be messy.
         */
-       if ((dev->mc_count) && !(ap->mcast_all)) {
+       if (!netdev_mc_empty(dev) && !ap->mcast_all) {
                cmd.evt = C_SET_MULTICAST_MODE;
                cmd.code = C_C_MCAST_ENABLE;
                cmd.idx = 0;