tulip: convert to use netdev_for_each_mc_addr
also bug in de2104x.c was corrected: for (i = 0; i < 32; i++) loop should be outside mc_list iteration. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5508590c19
commit
4302b67e04
@@ -1951,9 +1951,9 @@ static void
|
||||
SetMulticastFilter(struct net_device *dev)
|
||||
{
|
||||
struct de4x5_private *lp = netdev_priv(dev);
|
||||
struct dev_mc_list *dmi=dev->mc_list;
|
||||
struct dev_mc_list *dmi;
|
||||
u_long iobase = dev->base_addr;
|
||||
int i, j, bit, byte;
|
||||
int i, bit, byte;
|
||||
u16 hashcode;
|
||||
u32 omr, crc;
|
||||
char *pa;
|
||||
@@ -1966,9 +1966,8 @@ SetMulticastFilter(struct net_device *dev)
|
||||
if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) {
|
||||
omr |= OMR_PM; /* Pass all multicasts */
|
||||
} else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */
|
||||
for (i = 0; i < netdev_mc_count(dev) ;i++) {
|
||||
addrs=dmi->dmi_addr;
|
||||
dmi=dmi->next;
|
||||
netdev_for_each_mc_addr(dmi, dev) {
|
||||
addrs = dmi->dmi_addr;
|
||||
if ((*addrs & 0x01) == 1) { /* multicast address? */
|
||||
crc = ether_crc_le(ETH_ALEN, addrs);
|
||||
hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */
|
||||
@@ -1984,9 +1983,8 @@ SetMulticastFilter(struct net_device *dev)
|
||||
}
|
||||
}
|
||||
} else { /* Perfect filtering */
|
||||
for (j=0; j<netdev_mc_count(dev); j++) {
|
||||
addrs=dmi->dmi_addr;
|
||||
dmi=dmi->next;
|
||||
netdev_for_each_mc_addr(dmi, dev) {
|
||||
addrs = dmi->dmi_addr;
|
||||
for (i=0; i<ETH_ALEN; i++) {
|
||||
*(pa + (i&1)) = *addrs++;
|
||||
if (i & 0x01) pa += 4;
|
||||
|
Reference in New Issue
Block a user