mirror of
https://github.com/xemu-project/xemu.git
synced 2025-04-02 11:11:48 -04:00
lan9118: use inline net_crc32() and bitshift instead of compute_mcast_idx()
This makes it much easier to compare the multicast CRC calculation endian and bitshift against the Linux driver implementation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
308913bb43
commit
eedeaee73a
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "qemu/osdep.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "net/net.h"
|
||||
#include "net/eth.h"
|
||||
#include "hw/devices.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "hw/ptimer.h"
|
||||
|
@ -504,7 +505,7 @@ static int lan9118_filter(lan9118_state *s, const uint8_t *addr)
|
|||
}
|
||||
} else {
|
||||
/* Hash matching */
|
||||
hash = compute_mcast_idx(addr);
|
||||
hash = net_crc32(addr, ETH_ALEN) >> 26;
|
||||
if (hash & 0x20) {
|
||||
return (s->mac_hashh >> (hash & 0x1f)) & 1;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue