diff options
Diffstat (limited to 'drivers/net/sunhme.c')
-rw-r--r-- | drivers/net/sunhme.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 6762f1c6ec8a..b17dbb11bd67 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -1516,24 +1516,20 @@ static int happy_meal_init(struct happy_meal *hp) | |||
1516 | 1516 | ||
1517 | HMD(("htable, ")); | 1517 | HMD(("htable, ")); |
1518 | if ((hp->dev->flags & IFF_ALLMULTI) || | 1518 | if ((hp->dev->flags & IFF_ALLMULTI) || |
1519 | (hp->dev->mc_count > 64)) { | 1519 | (netdev_mc_count(hp->dev) > 64)) { |
1520 | hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); | 1520 | hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); |
1521 | hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); | 1521 | hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); |
1522 | hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); | 1522 | hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); |
1523 | hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff); | 1523 | hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff); |
1524 | } else if ((hp->dev->flags & IFF_PROMISC) == 0) { | 1524 | } else if ((hp->dev->flags & IFF_PROMISC) == 0) { |
1525 | u16 hash_table[4]; | 1525 | u16 hash_table[4]; |
1526 | struct dev_mc_list *dmi = hp->dev->mc_list; | 1526 | struct dev_mc_list *dmi; |
1527 | char *addrs; | 1527 | char *addrs; |
1528 | int i; | ||
1529 | u32 crc; | 1528 | u32 crc; |
1530 | 1529 | ||
1531 | for (i = 0; i < 4; i++) | 1530 | memset(hash_table, 0, sizeof(hash_table)); |
1532 | hash_table[i] = 0; | 1531 | netdev_for_each_mc_addr(dmi, hp->dev) { |
1533 | |||
1534 | for (i = 0; i < hp->dev->mc_count; i++) { | ||
1535 | addrs = dmi->dmi_addr; | 1532 | addrs = dmi->dmi_addr; |
1536 | dmi = dmi->next; | ||
1537 | 1533 | ||
1538 | if (!(*addrs & 1)) | 1534 | if (!(*addrs & 1)) |
1539 | continue; | 1535 | continue; |
@@ -2366,14 +2362,13 @@ static void happy_meal_set_multicast(struct net_device *dev) | |||
2366 | { | 2362 | { |
2367 | struct happy_meal *hp = netdev_priv(dev); | 2363 | struct happy_meal *hp = netdev_priv(dev); |
2368 | void __iomem *bregs = hp->bigmacregs; | 2364 | void __iomem *bregs = hp->bigmacregs; |
2369 | struct dev_mc_list *dmi = dev->mc_list; | 2365 | struct dev_mc_list *dmi; |
2370 | char *addrs; | 2366 | char *addrs; |
2371 | int i; | ||
2372 | u32 crc; | 2367 | u32 crc; |
2373 | 2368 | ||
2374 | spin_lock_irq(&hp->happy_lock); | 2369 | spin_lock_irq(&hp->happy_lock); |
2375 | 2370 | ||
2376 | if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) { | 2371 | if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) { |
2377 | hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); | 2372 | hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); |
2378 | hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); | 2373 | hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); |
2379 | hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); | 2374 | hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); |
@@ -2384,12 +2379,9 @@ static void happy_meal_set_multicast(struct net_device *dev) | |||
2384 | } else { | 2379 | } else { |
2385 | u16 hash_table[4]; | 2380 | u16 hash_table[4]; |
2386 | 2381 | ||
2387 | for (i = 0; i < 4; i++) | 2382 | memset(hash_table, 0, sizeof(hash_table)); |
2388 | hash_table[i] = 0; | 2383 | netdev_for_each_mc_addr(dmi, dev) { |
2389 | |||
2390 | for (i = 0; i < dev->mc_count; i++) { | ||
2391 | addrs = dmi->dmi_addr; | 2384 | addrs = dmi->dmi_addr; |
2392 | dmi = dmi->next; | ||
2393 | 2385 | ||
2394 | if (!(*addrs & 1)) | 2386 | if (!(*addrs & 1)) |
2395 | continue; | 2387 | continue; |
@@ -3211,7 +3203,7 @@ static void __devexit happy_meal_pci_remove(struct pci_dev *pdev) | |||
3211 | dev_set_drvdata(&pdev->dev, NULL); | 3203 | dev_set_drvdata(&pdev->dev, NULL); |
3212 | } | 3204 | } |
3213 | 3205 | ||
3214 | static struct pci_device_id happymeal_pci_ids[] = { | 3206 | static DEFINE_PCI_DEVICE_TABLE(happymeal_pci_ids) = { |
3215 | { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) }, | 3207 | { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) }, |
3216 | { } /* Terminating entry */ | 3208 | { } /* Terminating entry */ |
3217 | }; | 3209 | }; |