diff options
Diffstat (limited to 'drivers/net/tulip/tulip_core.c')
-rw-r--r-- | drivers/net/tulip/tulip_core.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 7f544ef2f5f..c4b7cd726b6 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -990,15 +990,15 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) | |||
990 | { | 990 | { |
991 | struct tulip_private *tp = netdev_priv(dev); | 991 | struct tulip_private *tp = netdev_priv(dev); |
992 | u16 hash_table[32]; | 992 | u16 hash_table[32]; |
993 | struct dev_mc_list *mclist; | 993 | struct netdev_hw_addr *ha; |
994 | int i; | 994 | int i; |
995 | u16 *eaddrs; | 995 | u16 *eaddrs; |
996 | 996 | ||
997 | memset(hash_table, 0, sizeof(hash_table)); | 997 | memset(hash_table, 0, sizeof(hash_table)); |
998 | set_bit_le(255, hash_table); /* Broadcast entry */ | 998 | set_bit_le(255, hash_table); /* Broadcast entry */ |
999 | /* This should work on big-endian machines as well. */ | 999 | /* This should work on big-endian machines as well. */ |
1000 | netdev_for_each_mc_addr(mclist, dev) { | 1000 | netdev_for_each_mc_addr(ha, dev) { |
1001 | int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; | 1001 | int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff; |
1002 | 1002 | ||
1003 | set_bit_le(index, hash_table); | 1003 | set_bit_le(index, hash_table); |
1004 | } | 1004 | } |
@@ -1018,13 +1018,13 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) | |||
1018 | static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) | 1018 | static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) |
1019 | { | 1019 | { |
1020 | struct tulip_private *tp = netdev_priv(dev); | 1020 | struct tulip_private *tp = netdev_priv(dev); |
1021 | struct dev_mc_list *mclist; | 1021 | struct netdev_hw_addr *ha; |
1022 | u16 *eaddrs; | 1022 | u16 *eaddrs; |
1023 | 1023 | ||
1024 | /* We have <= 14 addresses so we can use the wonderful | 1024 | /* We have <= 14 addresses so we can use the wonderful |
1025 | 16 address perfect filtering of the Tulip. */ | 1025 | 16 address perfect filtering of the Tulip. */ |
1026 | netdev_for_each_mc_addr(mclist, dev) { | 1026 | netdev_for_each_mc_addr(ha, dev) { |
1027 | eaddrs = (u16 *)mclist->dmi_addr; | 1027 | eaddrs = (u16 *) ha->addr; |
1028 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; | 1028 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; |
1029 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; | 1029 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; |
1030 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; | 1030 | *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; |
@@ -1061,7 +1061,7 @@ static void set_rx_mode(struct net_device *dev) | |||
1061 | } else if (tp->flags & MC_HASH_ONLY) { | 1061 | } else if (tp->flags & MC_HASH_ONLY) { |
1062 | /* Some work-alikes have only a 64-entry hash filter table. */ | 1062 | /* Some work-alikes have only a 64-entry hash filter table. */ |
1063 | /* Should verify correctness on big-endian/__powerpc__ */ | 1063 | /* Should verify correctness on big-endian/__powerpc__ */ |
1064 | struct dev_mc_list *mclist; | 1064 | struct netdev_hw_addr *ha; |
1065 | if (netdev_mc_count(dev) > 64) { | 1065 | if (netdev_mc_count(dev) > 64) { |
1066 | /* Arbitrary non-effective limit. */ | 1066 | /* Arbitrary non-effective limit. */ |
1067 | tp->csr6 |= AcceptAllMulticast; | 1067 | tp->csr6 |= AcceptAllMulticast; |
@@ -1069,18 +1069,21 @@ static void set_rx_mode(struct net_device *dev) | |||
1069 | } else { | 1069 | } else { |
1070 | u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */ | 1070 | u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */ |
1071 | int filterbit; | 1071 | int filterbit; |
1072 | netdev_for_each_mc_addr(mclist, dev) { | 1072 | netdev_for_each_mc_addr(ha, dev) { |
1073 | if (tp->flags & COMET_MAC_ADDR) | 1073 | if (tp->flags & COMET_MAC_ADDR) |
1074 | filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr); | 1074 | filterbit = ether_crc_le(ETH_ALEN, |
1075 | ha->addr); | ||
1075 | else | 1076 | else |
1076 | filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; | 1077 | filterbit = ether_crc(ETH_ALEN, |
1078 | ha->addr) >> 26; | ||
1077 | filterbit &= 0x3f; | 1079 | filterbit &= 0x3f; |
1078 | mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); | 1080 | mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); |
1079 | if (tulip_debug > 2) | 1081 | if (tulip_debug > 2) |
1080 | dev_info(&dev->dev, | 1082 | dev_info(&dev->dev, |
1081 | "Added filter for %pM %08x bit %d\n", | 1083 | "Added filter for %pM %08x bit %d\n", |
1082 | mclist->dmi_addr, | 1084 | ha->addr, |
1083 | ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); | 1085 | ether_crc(ETH_ALEN, ha->addr), |
1086 | filterbit); | ||
1084 | } | 1087 | } |
1085 | if (mc_filter[0] == tp->mc_filter[0] && | 1088 | if (mc_filter[0] == tp->mc_filter[0] && |
1086 | mc_filter[1] == tp->mc_filter[1]) | 1089 | mc_filter[1] == tp->mc_filter[1]) |