From 66b2fa19157cbf207801bf0122cdcc6999847c4b Mon Sep 17 00:00:00 2001 From: Gleb Natapov <gleb@redhat.com> Date: Wed, 10 Jun 2009 15:12:45 +0300 Subject: [PATCH 2/3] Add reset to rtl8139 nic. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Message-Id: <1244635966-21609-3-git-send-email-gleb@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied(qemu/master) Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: john cooper <john.cooper@redhat.com> Acked-by: Avi Kivity <avi@redhat.com> Bugzilla: 504237 --- qemu/hw/rtl8139.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/qemu/hw/rtl8139.c b/qemu/hw/rtl8139.c index 2527d9b..d1d50ee 100644 --- a/qemu/hw/rtl8139.c +++ b/qemu/hw/rtl8139.c @@ -1170,8 +1170,9 @@ static void rtl8139_reset_rxring(RTL8139State *s, uint32_t bufferSize) s->RxBufAddr = 0; } -static void rtl8139_reset(RTL8139State *s) +static void rtl8139_reset(void *opaque) { + RTL8139State *s = opaque; int i; /* restore MAC address */ @@ -3454,6 +3455,7 @@ PCIDevice *pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn) s->pci_dev = (PCIDevice *)d; memcpy(s->macaddr, nd->macaddr, 6); + qemu_register_reset(rtl8139_reset, s); rtl8139_reset(s); s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, rtl8139_receive, rtl8139_can_receive, s); -- 1.6.3.rc4.29.g8146