--- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -254,6 +254,7 @@ static const uint16_t eepro100_mdi_mask[ /* From FreeBSD */ /* XXX: optimize */ +/* static int compute_mcast_idx(const uint8_t * ep) { uint32_t crc; @@ -273,6 +274,7 @@ static int compute_mcast_idx(const uint8 } return (crc >> 26); } +*/ #if defined(DEBUG_EEPRO100) static const char *nic_dump(const uint8_t * buf, unsigned size) @@ -1492,11 +1494,12 @@ static ssize_t nic_receive(VLANClientSta /* Multicast frame. */ logout("%p received multicast, len=%d\n", s, size); /* TODO: check multicast all bit. */ + /* An quick whack - just pass 'em all to the guest - dbg. 07.01.2008 assert(!(s->configuration[21] & BIT(3))); int mcast_idx = compute_mcast_idx(buf); if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) { return size; - } + } */ rfd_status |= 0x0002; } else if (s->configuration[15] & 1) { /* Promiscuous: receive all. */ @@ -1522,7 +1525,13 @@ static ssize_t nic_receive(VLANClientSta offsetof(eepro100_rx_t, packet)); uint16_t rfd_command = le16_to_cpu(rx.command); uint16_t rfd_size = le16_to_cpu(rx.size); - assert(size <= rfd_size); + + // brb: cange from assert to if and log + // assert(size <= rfd_size); + if (size <= rfd_size) { + logout("size is smaller than rfd_size: %u <= %u : %s", size, rfd_size, nic_dump(buf, size)); + } + if (size < 64) { rfd_status |= 0x0080; } @@ -1542,10 +1551,10 @@ static ssize_t nic_receive(VLANClientSta s->statistics.rx_good_frames++; eepro100_fr_interrupt(s); s->ru_offset = le32_to_cpu(rx.link); + /* Comment out assert - brb 2008-01-15 if (rfd_command & 0x8000) { - /* EL bit is set, so this was the last frame. */ assert(0); - } + } */ if (rfd_command & 0x4000) { /* S bit is set. */ set_ru_state(s, ru_suspended);