4dbc6a7738
networking througput since otherwise the emulated NICs didn't have a way of indicating the receive queue is full and would drop packets. o bump PKGNAME o inttypes.h made irrelevent a few chunks of patches, so use it instead
31 lines
965 B
Plaintext
31 lines
965 B
Plaintext
$OpenBSD: patch-hw_smc91c111_c,v 1.1 2006/02/08 13:44:17 todd Exp $
|
|
--- hw/smc91c111.c.orig Mon Dec 19 17:51:53 2005
|
|
+++ hw/smc91c111.c Sat Jan 28 22:10:33 2006
|
|
@@ -593,6 +593,17 @@ static uint32_t smc91c111_readl(void *op
|
|
return val;
|
|
}
|
|
|
|
+static int smc91c111_can_receive(void *opaque)
|
|
+{
|
|
+ smc91c111_state *s = (smc91c111_state *)opaque;
|
|
+
|
|
+ if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST))
|
|
+ return 1;
|
|
+ if (s->allocated == (1 << NUM_PACKETS) - 1)
|
|
+ return 0;
|
|
+ return 1;
|
|
+}
|
|
+
|
|
static void smc91c111_receive(void *opaque, const uint8_t *buf, int size)
|
|
{
|
|
smc91c111_state *s = (smc91c111_state *)opaque;
|
|
@@ -697,6 +708,7 @@ void smc91c111_init(NICInfo *nd, uint32_
|
|
|
|
smc91c111_reset(s);
|
|
|
|
- s->vc = qemu_new_vlan_client(nd->vlan, smc91c111_receive, s);
|
|
+ s->vc = qemu_new_vlan_client(nd->vlan, smc91c111_receive,
|
|
+ smc91c111_can_receive, s);
|
|
/* ??? Save/restore. */
|
|
}
|