aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de2104x.c12
-rw-r--r--drivers/net/tulip/de4x5.c10
-rw-r--r--drivers/net/tulip/dmfe.c12
-rw-r--r--drivers/net/tulip/tulip_core.c27
-rw-r--r--drivers/net/tulip/uli526x.c6
-rw-r--r--drivers/net/tulip/winbond-840.c12
6 files changed, 42 insertions, 37 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index cb429723b2c8..a68b91764627 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -670,15 +670,15 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
670{ 670{
671 struct de_private *de = netdev_priv(dev); 671 struct de_private *de = netdev_priv(dev);
672 u16 hash_table[32]; 672 u16 hash_table[32];
673 struct dev_mc_list *mclist; 673 struct netdev_hw_addr *ha;
674 int i; 674 int i;
675 u16 *eaddrs; 675 u16 *eaddrs;
676 676
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 netdev_for_each_mc_addr(mclist, dev) { 680 netdev_for_each_mc_addr(ha, dev) {
681 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 681 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
682 682
683 set_bit_le(index, hash_table); 683 set_bit_le(index, hash_table);
684 } 684 }
@@ -699,13 +699,13 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
699static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) 699static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
700{ 700{
701 struct de_private *de = netdev_priv(dev); 701 struct de_private *de = netdev_priv(dev);
702 struct dev_mc_list *mclist; 702 struct netdev_hw_addr *ha;
703 u16 *eaddrs; 703 u16 *eaddrs;
704 704
705 /* We have <= 14 addresses so we can use the wonderful 705 /* We have <= 14 addresses so we can use the wonderful
706 16 address perfect filtering of the Tulip. */ 706 16 address perfect filtering of the Tulip. */
707 netdev_for_each_mc_addr(mclist, dev) { 707 netdev_for_each_mc_addr(ha, dev) {
708 eaddrs = (u16 *)mclist->dmi_addr; 708 eaddrs = (u16 *) ha->addr;
709 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 709 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 55ade8949a68..cac4bcc83187 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1951,7 +1951,7 @@ static void
1951SetMulticastFilter(struct net_device *dev) 1951SetMulticastFilter(struct net_device *dev)
1952{ 1952{
1953 struct de4x5_private *lp = netdev_priv(dev); 1953 struct de4x5_private *lp = netdev_priv(dev);
1954 struct dev_mc_list *dmi; 1954 struct netdev_hw_addr *ha;
1955 u_long iobase = dev->base_addr; 1955 u_long iobase = dev->base_addr;
1956 int i, bit, byte; 1956 int i, bit, byte;
1957 u16 hashcode; 1957 u16 hashcode;
@@ -1966,8 +1966,8 @@ SetMulticastFilter(struct net_device *dev)
1966 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) { 1966 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) {
1967 omr |= OMR_PM; /* Pass all multicasts */ 1967 omr |= OMR_PM; /* Pass all multicasts */
1968 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */ 1968 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */
1969 netdev_for_each_mc_addr(dmi, dev) { 1969 netdev_for_each_mc_addr(ha, dev) {
1970 addrs = dmi->dmi_addr; 1970 addrs = ha->addr;
1971 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1971 if ((*addrs & 0x01) == 1) { /* multicast address? */
1972 crc = ether_crc_le(ETH_ALEN, addrs); 1972 crc = ether_crc_le(ETH_ALEN, addrs);
1973 hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */ 1973 hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */
@@ -1983,8 +1983,8 @@ SetMulticastFilter(struct net_device *dev)
1983 } 1983 }
1984 } 1984 }
1985 } else { /* Perfect filtering */ 1985 } else { /* Perfect filtering */
1986 netdev_for_each_mc_addr(dmi, dev) { 1986 netdev_for_each_mc_addr(ha, dev) {
1987 addrs = dmi->dmi_addr; 1987 addrs = ha->addr;
1988 for (i=0; i<ETH_ALEN; i++) { 1988 for (i=0; i<ETH_ALEN; i++) {
1989 *(pa + (i&1)) = *addrs++; 1989 *(pa + (i&1)) = *addrs++;
1990 if (i & 0x01) pa += 4; 1990 if (i & 0x01) pa += 4;
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 95b38d803e9b..a039c8ab98b2 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1454,7 +1454,7 @@ static void update_cr6(u32 cr6_data, unsigned long ioaddr)
1454 1454
1455static void dm9132_id_table(struct DEVICE *dev) 1455static void dm9132_id_table(struct DEVICE *dev)
1456{ 1456{
1457 struct dev_mc_list *mcptr; 1457 struct netdev_hw_addr *ha;
1458 u16 * addrptr; 1458 u16 * addrptr;
1459 unsigned long ioaddr = dev->base_addr+0xc0; /* ID Table */ 1459 unsigned long ioaddr = dev->base_addr+0xc0; /* ID Table */
1460 u32 hash_val; 1460 u32 hash_val;
@@ -1478,8 +1478,8 @@ static void dm9132_id_table(struct DEVICE *dev)
1478 hash_table[3] = 0x8000; 1478 hash_table[3] = 0x8000;
1479 1479
1480 /* the multicast address in Hash Table : 64 bits */ 1480 /* the multicast address in Hash Table : 64 bits */
1481 netdev_for_each_mc_addr(mcptr, dev) { 1481 netdev_for_each_mc_addr(ha, dev) {
1482 hash_val = cal_CRC((char *) mcptr->dmi_addr, 6, 0) & 0x3f; 1482 hash_val = cal_CRC((char *) ha->addr, 6, 0) & 0x3f;
1483 hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16); 1483 hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
1484 } 1484 }
1485 1485
@@ -1497,7 +1497,7 @@ static void dm9132_id_table(struct DEVICE *dev)
1497static void send_filter_frame(struct DEVICE *dev) 1497static void send_filter_frame(struct DEVICE *dev)
1498{ 1498{
1499 struct dmfe_board_info *db = netdev_priv(dev); 1499 struct dmfe_board_info *db = netdev_priv(dev);
1500 struct dev_mc_list *mcptr; 1500 struct netdev_hw_addr *ha;
1501 struct tx_desc *txptr; 1501 struct tx_desc *txptr;
1502 u16 * addrptr; 1502 u16 * addrptr;
1503 u32 * suptr; 1503 u32 * suptr;
@@ -1520,8 +1520,8 @@ static void send_filter_frame(struct DEVICE *dev)
1520 *suptr++ = 0xffff; 1520 *suptr++ = 0xffff;
1521 1521
1522 /* fit the multicast address */ 1522 /* fit the multicast address */
1523 netdev_for_each_mc_addr(mcptr, dev) { 1523 netdev_for_each_mc_addr(ha, dev) {
1524 addrptr = (u16 *) mcptr->dmi_addr; 1524 addrptr = (u16 *) ha->addr;
1525 *suptr++ = addrptr[0]; 1525 *suptr++ = addrptr[0];
1526 *suptr++ = addrptr[1]; 1526 *suptr++ = addrptr[1];
1527 *suptr++ = addrptr[2]; 1527 *suptr++ = addrptr[2];
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 7f544ef2f5fc..c4b7cd726b69 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)
1018static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) 1018static 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])
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 0ab05af237e5..b79d908fe34e 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -1392,7 +1392,7 @@ static void update_cr6(u32 cr6_data, unsigned long ioaddr)
1392static void send_filter_frame(struct net_device *dev, int mc_cnt) 1392static void send_filter_frame(struct net_device *dev, int mc_cnt)
1393{ 1393{
1394 struct uli526x_board_info *db = netdev_priv(dev); 1394 struct uli526x_board_info *db = netdev_priv(dev);
1395 struct dev_mc_list *mcptr; 1395 struct netdev_hw_addr *ha;
1396 struct tx_desc *txptr; 1396 struct tx_desc *txptr;
1397 u16 * addrptr; 1397 u16 * addrptr;
1398 u32 * suptr; 1398 u32 * suptr;
@@ -1415,8 +1415,8 @@ static void send_filter_frame(struct net_device *dev, int mc_cnt)
1415 *suptr++ = 0xffff << FLT_SHIFT; 1415 *suptr++ = 0xffff << FLT_SHIFT;
1416 1416
1417 /* fit the multicast address */ 1417 /* fit the multicast address */
1418 netdev_for_each_mc_addr(mcptr, dev) { 1418 netdev_for_each_mc_addr(ha, dev) {
1419 addrptr = (u16 *) mcptr->dmi_addr; 1419 addrptr = (u16 *) ha->addr;
1420 *suptr++ = addrptr[0] << FLT_SHIFT; 1420 *suptr++ = addrptr[0] << FLT_SHIFT;
1421 *suptr++ = addrptr[1] << FLT_SHIFT; 1421 *suptr++ = addrptr[1] << FLT_SHIFT;
1422 *suptr++ = addrptr[2] << FLT_SHIFT; 1422 *suptr++ = addrptr[2] << FLT_SHIFT;
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 304f43866c44..3e3822c98a0d 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -1367,13 +1367,15 @@ static u32 __set_rx_mode(struct net_device *dev)
1367 memset(mc_filter, 0xff, sizeof(mc_filter)); 1367 memset(mc_filter, 0xff, sizeof(mc_filter));
1368 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1368 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1369 } else { 1369 } else {
1370 struct dev_mc_list *mclist; 1370 struct netdev_hw_addr *ha;
1371 1371
1372 memset(mc_filter, 0, sizeof(mc_filter)); 1372 memset(mc_filter, 0, sizeof(mc_filter));
1373 netdev_for_each_mc_addr(mclist, dev) { 1373 netdev_for_each_mc_addr(ha, dev) {
1374 int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; 1374 int filbit;
1375 filterbit &= 0x3f; 1375
1376 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1376 filbit = (ether_crc(ETH_ALEN, ha->addr) >> 26) ^ 0x3F;
1377 filbit &= 0x3f;
1378 mc_filter[filbit >> 5] |= 1 << (filbit & 31);
1377 } 1379 }
1378 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1380 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1379 } 1381 }