From 271a234a2359975101396916f37f3c7d347c61b8 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 10 Sep 2015 21:24:12 -0700 Subject: net: smc91c111: flush packets on RCR register changes The SOFT_RST or RXEN in the control register can be used as a condition to unblock the net layer via can_receive(). So check for possible flushes on RCR changes. This will drop all pending packets on soft reset or disable which is the functional intent of the can_receive() logic. Signed-off-by: Peter Crosthwaite Reviewed-by: Fam Zheng Tested-by: Richard Purdie Message-id: b114d4c96f4afbdaa15f1361d9c07e3021755915.1441873621.git.crosthwaite.peter@gmail.com Signed-off-by: Stefan Hajnoczi --- hw/net/smc91c111.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/net') diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index 8fc3deb..c19cdd1 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -331,6 +331,7 @@ static void smc91c111_writeb(void *opaque, hwaddr offset, if (s->rcr & RCR_SOFT_RST) { smc91c111_reset(DEVICE(s)); } + smc91c111_flush_queued_packets(s); return; case 10: case 11: /* RPCR */ /* Ignored */ -- cgit v1.1