diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/arm/at91_ether.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/arm/at91_ether.c')
-rw-r--r-- | drivers/net/arm/at91_ether.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index c8bc60a7040c..aed5b5479b50 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/ethtool.h> | 27 | #include <linux/ethtool.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/clk.h> | 29 | #include <linux/clk.h> |
30 | #include <linux/gfp.h> | ||
30 | 31 | ||
31 | #include <asm/io.h> | 32 | #include <asm/io.h> |
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
@@ -558,14 +559,11 @@ static void at91ether_sethashtable(struct net_device *dev) | |||
558 | { | 559 | { |
559 | struct dev_mc_list *curr; | 560 | struct dev_mc_list *curr; |
560 | unsigned long mc_filter[2]; | 561 | unsigned long mc_filter[2]; |
561 | unsigned int i, bitnr; | 562 | unsigned int bitnr; |
562 | 563 | ||
563 | mc_filter[0] = mc_filter[1] = 0; | 564 | mc_filter[0] = mc_filter[1] = 0; |
564 | 565 | ||
565 | curr = dev->mc_list; | 566 | netdev_for_each_mc_addr(curr, dev) { |
566 | for (i = 0; i < dev->mc_count; i++, curr = curr->next) { | ||
567 | if (!curr) break; /* unexpected end of list */ | ||
568 | |||
569 | bitnr = hash_get_index(curr->dmi_addr); | 567 | bitnr = hash_get_index(curr->dmi_addr); |
570 | mc_filter[bitnr >> 5] |= 1 << (bitnr & 31); | 568 | mc_filter[bitnr >> 5] |= 1 << (bitnr & 31); |
571 | } | 569 | } |
@@ -592,7 +590,7 @@ static void at91ether_set_multicast_list(struct net_device *dev) | |||
592 | at91_emac_write(AT91_EMAC_HSH, -1); | 590 | at91_emac_write(AT91_EMAC_HSH, -1); |
593 | at91_emac_write(AT91_EMAC_HSL, -1); | 591 | at91_emac_write(AT91_EMAC_HSL, -1); |
594 | cfg |= AT91_EMAC_MTI; | 592 | cfg |= AT91_EMAC_MTI; |
595 | } else if (dev->mc_count > 0) { /* Enable specific multicasts */ | 593 | } else if (!netdev_mc_empty(dev)) { /* Enable specific multicasts */ |
596 | at91ether_sethashtable(dev); | 594 | at91ether_sethashtable(dev); |
597 | cfg |= AT91_EMAC_MTI; | 595 | cfg |= AT91_EMAC_MTI; |
598 | } else if (dev->flags & (~IFF_ALLMULTI)) { /* Disable all multicast mode */ | 596 | } else if (dev->flags & (~IFF_ALLMULTI)) { /* Disable all multicast mode */ |