aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-06-08 13:15:32 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-06-08 13:15:32 +0100
commit44effc1f99d0375fe5939f99bd65a5b6037f5f1c (patch)
tree0a8a163d22e38c213f78d4e6a76f2ad170d4643e /hw/net
parent8576b12df7abf29ddff0e69e1f9b6534e040cbcd (diff)
ftgmac100: fix multicast hash routine
Based on the multicast hash calculation of the FTGMAC100 Linux driver. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180530061711.23673-4-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/ftgmac100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index abf80655f2..8a7f274dc1 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -776,8 +776,8 @@ static int ftgmac100_filter(FTGMAC100State *s, const uint8_t *buf, size_t len)
return 0;
}
- /* TODO: this does not seem to work for ftgmac100 */
- mcast_idx = net_crc32(buf, ETH_ALEN) >> 26;
+ mcast_idx = net_crc32_le(buf, ETH_ALEN);
+ mcast_idx = (~(mcast_idx >> 2)) & 0x3f;
if (!(s->math[mcast_idx / 32] & (1 << (mcast_idx % 32)))) {
return 0;
}