]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
net: smc91c111: flush packets on RCR register changes
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>
Fri, 11 Sep 2015 04:24:12 +0000 (21:24 -0700)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 17 Sep 2015 11:36:03 +0000 (12:36 +0100)
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 <crosthwaite.peter@gmail.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Tested-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Message-id: b114d4c96f4afbdaa15f1361d9c07e3021755915.1441873621.git.crosthwaite.peter@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/smc91c111.c

index 8fc3debcaea1aabc70f55951a631e7678dd355b7..c19cdd14dfc62cd727e83fc28c38b2e9faae620f 100644 (file)
@@ -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 */