]> git.baikalelectronics.ru Git - kernel.git/commit
r6040: fix multicast operations
authorShawn Lin <shawn@dmp.com.tw>
Wed, 23 Feb 2011 04:32:34 +0000 (04:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Feb 2011 22:23:30 +0000 (14:23 -0800)
commit324c9507d946205f36e2ff65809e8b3ca1e7c910
treee883e62b7938538f0d9130d97f68f16ccbc024e9
parentd48498e63593de9e6eb6014de79ad50fd6c69b50
r6040: fix multicast operations

The original code does not work well when the number of mulitcast
address to handle is greater than MCAST_MAX. It only enable promiscous
mode instead of multicast hash table mode, so the hash table function
will not be activated and all multicast frames will be recieved in this
condition.

This patch fixes the following issues with the r6040 NIC operating in
multicast:

1) When the IFF_ALLMULTI flag is set, we should write 0xffff to the NIC
hash table registers to make it process multicast traffic.

2) When the number of multicast address to handle is smaller than
MCAST_MAX, we should use the NIC multicast registers MID1_{L,M,H}.

3) The hashing of the address was not correct, due to an invalid
substraction (15 - (crc & 0x0f)) instead of (crc & 0x0f) and an
incorrect crc algorithm (ether_crc_le) instead of (ether_crc).

4) If necessary, we should set HASH_EN flag in MCR0 to enable multicast
hash table function.

Reported-by: Marc Leclerc <marc-leclerc@signaturealpha.com>
Tested-by: Marc Leclerc <marc-leclerc@signaturealpha.com>
Signed-off-by: Shawn Lin <shawn@dmp.com.tw>
Signed-off-by: Albert Chen <albert.chen@rdc.com.tw>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/r6040.c