aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/tulip_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip/tulip_core.c')
-rw-r--r--drivers/net/tulip/tulip_core.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index e1a5f03a49c..cce2ada0795 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -997,7 +997,7 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
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 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1000 for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
1001 i++, mclist = mclist->next) { 1001 i++, mclist = mclist->next) {
1002 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 1002 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
1003 1003
@@ -1026,7 +1026,7 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
1026 1026
1027 /* We have <= 14 addresses so we can use the wonderful 1027 /* We have <= 14 addresses so we can use the wonderful
1028 16 address perfect filtering of the Tulip. */ 1028 16 address perfect filtering of the Tulip. */
1029 for (i = 0, mclist = dev->mc_list; i < dev->mc_count; 1029 for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
1030 i++, mclist = mclist->next) { 1030 i++, mclist = mclist->next) {
1031 eaddrs = (u16 *)mclist->dmi_addr; 1031 eaddrs = (u16 *)mclist->dmi_addr;
1032 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 1032 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
@@ -1057,7 +1057,8 @@ static void set_rx_mode(struct net_device *dev)
1057 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ 1057 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
1058 tp->csr6 |= AcceptAllMulticast | AcceptAllPhys; 1058 tp->csr6 |= AcceptAllMulticast | AcceptAllPhys;
1059 csr6 |= AcceptAllMulticast | AcceptAllPhys; 1059 csr6 |= AcceptAllMulticast | AcceptAllPhys;
1060 } else if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { 1060 } else if ((netdev_mc_count(dev) > 1000) ||
1061 (dev->flags & IFF_ALLMULTI)) {
1061 /* Too many to filter well -- accept all multicasts. */ 1062 /* Too many to filter well -- accept all multicasts. */
1062 tp->csr6 |= AcceptAllMulticast; 1063 tp->csr6 |= AcceptAllMulticast;
1063 csr6 |= AcceptAllMulticast; 1064 csr6 |= AcceptAllMulticast;
@@ -1066,14 +1067,16 @@ static void set_rx_mode(struct net_device *dev)
1066 /* Should verify correctness on big-endian/__powerpc__ */ 1067 /* Should verify correctness on big-endian/__powerpc__ */
1067 struct dev_mc_list *mclist; 1068 struct dev_mc_list *mclist;
1068 int i; 1069 int i;
1069 if (dev->mc_count > 64) { /* Arbitrary non-effective limit. */ 1070 if (netdev_mc_count(dev) > 64) {
1071 /* Arbitrary non-effective limit. */
1070 tp->csr6 |= AcceptAllMulticast; 1072 tp->csr6 |= AcceptAllMulticast;
1071 csr6 |= AcceptAllMulticast; 1073 csr6 |= AcceptAllMulticast;
1072 } else { 1074 } else {
1073 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */ 1075 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */
1074 int filterbit; 1076 int filterbit;
1075 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 1077 for (i = 0, mclist = dev->mc_list;
1076 i++, mclist = mclist->next) { 1078 mclist && i < netdev_mc_count(dev);
1079 i++, mclist = mclist->next) {
1077 if (tp->flags & COMET_MAC_ADDR) 1080 if (tp->flags & COMET_MAC_ADDR)
1078 filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr); 1081 filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
1079 else 1082 else
@@ -1107,7 +1110,8 @@ static void set_rx_mode(struct net_device *dev)
1107 1110
1108 /* Note that only the low-address shortword of setup_frame is valid! 1111 /* Note that only the low-address shortword of setup_frame is valid!
1109 The values are doubled for big-endian architectures. */ 1112 The values are doubled for big-endian architectures. */
1110 if (dev->mc_count > 14) { /* Must use a multicast hash table. */ 1113 if (netdev_mc_count(dev) > 14) {
1114 /* Must use a multicast hash table. */
1111 build_setup_frame_hash(tp->setup_frame, dev); 1115 build_setup_frame_hash(tp->setup_frame, dev);
1112 tx_flags = 0x08400000 | 192; 1116 tx_flags = 0x08400000 | 192;
1113 } else { 1117 } else {