drivers/usb/net/kaweth.c: add device "Allied Telesyn AT-USB10 USB Ethernet Adapter"
[safe/jmp/linux-2.6] / drivers / net / sungem.c
index 61640b9..e6880f1 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/ioport.h>
 #include <linux/in.h>
 #include <linux/sched.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -58,6 +57,7 @@
 #include <linux/bitops.h>
 #include <linux/mutex.h>
 #include <linux/mm.h>
+#include <linux/gfp.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -107,7 +107,7 @@ MODULE_LICENSE("GPL");
 #define GEM_MODULE_NAME        "gem"
 #define PFX GEM_MODULE_NAME ": "
 
-static struct pci_device_id gem_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(gem_pci_tbl) = {
        { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_GEM,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
 
@@ -782,7 +782,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
                        break;
 
                /* When writing back RX descriptor, GEM writes status
-                * then buffer address, possibly in seperate transactions.
+                * then buffer address, possibly in separate transactions.
                 * If we don't wait for the chip to write both, we could
                 * post a new buffer to this descriptor then have GEM spam
                 * on the buffer address.  We sync on the RX completion
@@ -1034,10 +1034,8 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
                        (csum_stuff_off << 21));
        }
 
-       local_irq_save(flags);
-       if (!spin_trylock(&gp->tx_lock)) {
+       if (!spin_trylock_irqsave(&gp->tx_lock, flags)) {
                /* Tell upper layer to requeue */
-               local_irq_restore(flags);
                return NETDEV_TX_LOCKED;
        }
        /* We raced with gem_do_stop() */
@@ -1839,7 +1837,7 @@ static u32 gem_setup_multicast(struct gem *gp)
        int i;
 
        if ((gp->dev->flags & IFF_ALLMULTI) ||
-           (gp->dev->mc_count > 256)) {
+           (netdev_mc_count(gp->dev) > 256)) {
                for (i=0; i<16; i++)
                        writel(0xffff, gp->regs + MAC_HASH0 + (i << 2));
                rxcfg |= MAC_RXCFG_HFE;
@@ -1848,17 +1846,13 @@ static u32 gem_setup_multicast(struct gem *gp)
        } else {
                u16 hash_table[16];
                u32 crc;
-               struct dev_mc_list *dmi = gp->dev->mc_list;
+               struct dev_mc_list *dmi;
                int i;
 
-               for (i = 0; i < 16; i++)
-                       hash_table[i] = 0;
-
-               for (i = 0; i < gp->dev->mc_count; i++) {
+               memset(hash_table, 0, sizeof(hash_table));
+               netdev_for_each_mc_addr(dmi, gp->dev) {
                        char *addrs = dmi->dmi_addr;
 
-                       dmi = dmi->next;
-
                        if (!(*addrs & 1))
                                continue;