Skip to content

Commit

Permalink
ftgmac100: fix multicast hash routine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
legoater authored and pm215 committed Jun 8, 2018
1 parent 8576b12 commit 44effc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/net/ftgmac100.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 44effc1

Please sign in to comment.