diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2014-05-29 02:23:54 -0700 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2014-06-09 00:33:03 +0200 |
commit | 8c6d96728d54891b1d6f7a4183e1a657be68be36 (patch) | |
tree | 5af1a996b098d12c365599bd666ee110e94caf22 /hw | |
parent | 04bb4d86f116b07cede742bee534b002735829d6 (diff) |
net: xilinx_ethlite: Don't reset from init
This zeroing-out of the rxbuf variable (ping pong state) is a reset
side effect. Extract into a proper reset.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/xilinx_ethlite.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 3a2a6c21c9..6cbd95dde2 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -204,6 +204,13 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) return size; } +static void xilinx_ethlite_reset(DeviceState *dev) +{ + struct xlx_ethlite *s = XILINX_ETHLITE(dev); + + s->rxbuf = 0; +} + static void eth_cleanup(NetClientState *nc) { struct xlx_ethlite *s = qemu_get_nic_opaque(nc); @@ -225,7 +232,6 @@ static int xilinx_ethlite_init(SysBusDevice *sbd) struct xlx_ethlite *s = XILINX_ETHLITE(dev); sysbus_init_irq(sbd, &s->irq); - s->rxbuf = 0; memory_region_init_io(&s->mmio, OBJECT(s), ð_ops, s, "xlnx.xps-ethernetlite", R_MAX * 4); @@ -251,6 +257,7 @@ static void xilinx_ethlite_class_init(ObjectClass *klass, void *data) SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = xilinx_ethlite_init; + dc->reset = xilinx_ethlite_reset; dc->props = xilinx_ethlite_properties; } |