aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/de2104x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip/de2104x.c')
-rw-r--r--drivers/net/tulip/de2104x.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index a4cff23dcdf9..cb429723b2c8 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -677,18 +677,17 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
677 memset(hash_table, 0, sizeof(hash_table)); 677 memset(hash_table, 0, sizeof(hash_table));
678 set_bit_le(255, hash_table); /* Broadcast entry */ 678 set_bit_le(255, hash_table); /* Broadcast entry */
679 /* This should work on big-endian machines as well. */ 679 /* This should work on big-endian machines as well. */
680 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev); 680 netdev_for_each_mc_addr(mclist, dev) {
681 i++, mclist = mclist->next) {
682 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 681 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
683 682
684 set_bit_le(index, hash_table); 683 set_bit_le(index, hash_table);
684 }
685 685
686 for (i = 0; i < 32; i++) { 686 for (i = 0; i < 32; i++) {
687 *setup_frm++ = hash_table[i]; 687 *setup_frm++ = hash_table[i];
688 *setup_frm++ = hash_table[i]; 688 *setup_frm++ = hash_table[i];
689 }
690 setup_frm = &de->setup_frame[13*6];
691 } 689 }
690 setup_frm = &de->setup_frame[13*6];
692 691
693 /* Fill the final entry with our physical address. */ 692 /* Fill the final entry with our physical address. */
694 eaddrs = (u16 *)dev->dev_addr; 693 eaddrs = (u16 *)dev->dev_addr;
@@ -701,20 +700,18 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
701{ 700{
702 struct de_private *de = netdev_priv(dev); 701 struct de_private *de = netdev_priv(dev);
703 struct dev_mc_list *mclist; 702 struct dev_mc_list *mclist;
704 int i;
705 u16 *eaddrs; 703 u16 *eaddrs;
706 704
707 /* We have <= 14 addresses so we can use the wonderful 705 /* We have <= 14 addresses so we can use the wonderful
708 16 address perfect filtering of the Tulip. */ 706 16 address perfect filtering of the Tulip. */
709 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev); 707 netdev_for_each_mc_addr(mclist, dev) {
710 i++, mclist = mclist->next) {
711 eaddrs = (u16 *)mclist->dmi_addr; 708 eaddrs = (u16 *)mclist->dmi_addr;
712 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 709 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
713 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
714 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
715 } 712 }
716 /* Fill the unused entries with the broadcast address. */ 713 /* Fill the unused entries with the broadcast address. */
717 memset(setup_frm, 0xff, (15-i)*12); 714 memset(setup_frm, 0xff, (15 - netdev_mc_count(dev)) * 12);
718 setup_frm = &de->setup_frame[15*6]; 715 setup_frm = &de->setup_frame[15*6];
719 716
720 /* Fill the final entry with our physical address. */ 717 /* Fill the final entry with our physical address. */