aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sungem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r--drivers/net/sungem.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 61640b99b705..e6880f1c4e8c 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -39,7 +39,6 @@
39#include <linux/ioport.h> 39#include <linux/ioport.h>
40#include <linux/in.h> 40#include <linux/in.h>
41#include <linux/sched.h> 41#include <linux/sched.h>
42#include <linux/slab.h>
43#include <linux/string.h> 42#include <linux/string.h>
44#include <linux/delay.h> 43#include <linux/delay.h>
45#include <linux/init.h> 44#include <linux/init.h>
@@ -58,6 +57,7 @@
58#include <linux/bitops.h> 57#include <linux/bitops.h>
59#include <linux/mutex.h> 58#include <linux/mutex.h>
60#include <linux/mm.h> 59#include <linux/mm.h>
60#include <linux/gfp.h>
61 61
62#include <asm/system.h> 62#include <asm/system.h>
63#include <asm/io.h> 63#include <asm/io.h>
@@ -107,7 +107,7 @@ MODULE_LICENSE("GPL");
107#define GEM_MODULE_NAME "gem" 107#define GEM_MODULE_NAME "gem"
108#define PFX GEM_MODULE_NAME ": " 108#define PFX GEM_MODULE_NAME ": "
109 109
110static struct pci_device_id gem_pci_tbl[] = { 110static DEFINE_PCI_DEVICE_TABLE(gem_pci_tbl) = {
111 { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_GEM, 111 { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_GEM,
112 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, 112 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
113 113
@@ -782,7 +782,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
782 break; 782 break;
783 783
784 /* When writing back RX descriptor, GEM writes status 784 /* When writing back RX descriptor, GEM writes status
785 * then buffer address, possibly in seperate transactions. 785 * then buffer address, possibly in separate transactions.
786 * If we don't wait for the chip to write both, we could 786 * If we don't wait for the chip to write both, we could
787 * post a new buffer to this descriptor then have GEM spam 787 * post a new buffer to this descriptor then have GEM spam
788 * on the buffer address. We sync on the RX completion 788 * 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,
1034 (csum_stuff_off << 21)); 1034 (csum_stuff_off << 21));
1035 } 1035 }
1036 1036
1037 local_irq_save(flags); 1037 if (!spin_trylock_irqsave(&gp->tx_lock, flags)) {
1038 if (!spin_trylock(&gp->tx_lock)) {
1039 /* Tell upper layer to requeue */ 1038 /* Tell upper layer to requeue */
1040 local_irq_restore(flags);
1041 return NETDEV_TX_LOCKED; 1039 return NETDEV_TX_LOCKED;
1042 } 1040 }
1043 /* We raced with gem_do_stop() */ 1041 /* We raced with gem_do_stop() */
@@ -1839,7 +1837,7 @@ static u32 gem_setup_multicast(struct gem *gp)
1839 int i; 1837 int i;
1840 1838
1841 if ((gp->dev->flags & IFF_ALLMULTI) || 1839 if ((gp->dev->flags & IFF_ALLMULTI) ||
1842 (gp->dev->mc_count > 256)) { 1840 (netdev_mc_count(gp->dev) > 256)) {
1843 for (i=0; i<16; i++) 1841 for (i=0; i<16; i++)
1844 writel(0xffff, gp->regs + MAC_HASH0 + (i << 2)); 1842 writel(0xffff, gp->regs + MAC_HASH0 + (i << 2));
1845 rxcfg |= MAC_RXCFG_HFE; 1843 rxcfg |= MAC_RXCFG_HFE;
@@ -1848,17 +1846,13 @@ static u32 gem_setup_multicast(struct gem *gp)
1848 } else { 1846 } else {
1849 u16 hash_table[16]; 1847 u16 hash_table[16];
1850 u32 crc; 1848 u32 crc;
1851 struct dev_mc_list *dmi = gp->dev->mc_list; 1849 struct dev_mc_list *dmi;
1852 int i; 1850 int i;
1853 1851
1854 for (i = 0; i < 16; i++) 1852 memset(hash_table, 0, sizeof(hash_table));
1855 hash_table[i] = 0; 1853 netdev_for_each_mc_addr(dmi, gp->dev) {
1856
1857 for (i = 0; i < gp->dev->mc_count; i++) {
1858 char *addrs = dmi->dmi_addr; 1854 char *addrs = dmi->dmi_addr;
1859 1855
1860 dmi = dmi->next;
1861
1862 if (!(*addrs & 1)) 1856 if (!(*addrs & 1))
1863 continue; 1857 continue;
1864 1858