X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=hw%2Fnet%2Frtl8139.c;h=90b4fc63ce64e07ab495bb477f5dc83371fc4ce3;hb=552fda48e095c16a14c9d275b4fdc5c392c386cf;hp=ab93d78ab3c2492c99bed55ff4a0efd2329cc86f;hpb=0db949f1810f4d497762d57d8db6f219c0607529;p=mirror_qemu.git diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index ab93d78ab3..90b4fc63ce 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -62,6 +62,7 @@ #include "net/net.h" #include "net/eth.h" #include "sysemu/sysemu.h" +#include "qom/object.h" /* debug RTL8139 card */ //#define DEBUG_RTL8139 1 @@ -93,8 +94,7 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...) #define TYPE_RTL8139 "rtl8139" -#define RTL8139(obj) \ - OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139) +OBJECT_DECLARE_SIMPLE_TYPE(RTL8139State, RTL8139) /* Symbolic offsets to registers. */ enum RTL8139_registers { @@ -431,7 +431,7 @@ typedef struct RTL8139TallyCounters /* Clears all tally counters */ static void RTL8139TallyCounters_clear(RTL8139TallyCounters* counters); -typedef struct RTL8139State { +struct RTL8139State { /*< private >*/ PCIDevice parent_obj; /*< public >*/ @@ -513,7 +513,7 @@ typedef struct RTL8139State { /* Support migration to/from old versions */ int rtl8139_mmio_io_addr_dummy; -} RTL8139State; +}; /* Writes tally counters to memory via DMA */ static void RTL8139TallyCounters_dma_write(RTL8139State *s, dma_addr_t tc_addr); @@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, uint8_t *buf, int size, } DPRINTF("+++ transmit loopback mode\n"); - rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt); + qemu_receive_packet(qemu_get_queue(s->nic), buf, size); if (iov) { g_free(buf2); @@ -3338,7 +3338,6 @@ static void pci_rtl8139_uninit(PCIDevice *dev) g_free(s->cplus_txbuffer); s->cplus_txbuffer = NULL; - timer_del(s->timer); timer_free(s->timer); qemu_del_nic(s->nic); }