Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256001
b: refs/heads/master
c: 3170ff5
h: refs/heads/master
i:
  255999: 8b6a99d
v: v3
  • Loading branch information
Tobias Klauser authored and David S. Miller committed Jul 1, 2011
1 parent ae86bbe commit 98c9d89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bda7ed47937bd9ba8c10631ca884f7fefb162f4d
refs/heads/master: 3170ff54c26004ea627022af695d0c8709d29b04
21 changes: 8 additions & 13 deletions trunk/drivers/net/depca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,6 @@ static void SetMulticastFilter(struct net_device *dev)
{
struct depca_private *lp = netdev_priv(dev);
struct netdev_hw_addr *ha;
char *addrs;
int i, j, bit, byte;
u16 hashcode;
u32 crc;
Expand All @@ -1285,19 +1284,15 @@ static void SetMulticastFilter(struct net_device *dev)
}
/* Add multicast addresses */
netdev_for_each_mc_addr(ha, dev) {
addrs = ha->addr;
if ((*addrs & 0x01) == 1) { /* multicast address? */
crc = ether_crc(ETH_ALEN, addrs);
hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */
for (j = 0; j < 5; j++) { /* ... in reverse order. */
hashcode = (hashcode << 1) | ((crc >>= 1) & 1);
}


byte = hashcode >> 3; /* bit[3-5] -> byte in filter */
bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */
lp->init_block.mcast_table[byte] |= bit;
crc = ether_crc(ETH_ALEN, ha->addr);
hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */
for (j = 0; j < 5; j++) { /* ... in reverse order. */
hashcode = (hashcode << 1) | ((crc >>= 1) & 1);
}

byte = hashcode >> 3; /* bit[3-5] -> byte in filter */
bit = 1 << (hashcode & 0x07); /* bit[0-2] -> bit in byte */
lp->init_block.mcast_table[byte] |= bit;
}
}
}
Expand Down

0 comments on commit 98c9d89

Please sign in to comment.