]> Git Repo - qemu.git/blobdiff - hw/xgmac.c
vga: rename isa_vga_init() to isa_std_vga_init()
[qemu.git] / hw / xgmac.c
index ef0ca247e5e816ead63288bbee980a4e8ca68a96..a91ef608f184dcc79833d472db681268f2bf77b4 100644 (file)
@@ -308,7 +308,7 @@ static const MemoryRegionOps enet_mem_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-static int eth_can_rx(VLANClientState *nc)
+static int eth_can_rx(NetClientState *nc)
 {
     struct XgmacState *s = DO_UPCAST(NICState, nc, nc)->opaque;
 
@@ -316,7 +316,7 @@ static int eth_can_rx(VLANClientState *nc)
     return s->regs[DMA_CONTROL] & DMA_CONTROL_SR;
 }
 
-static ssize_t eth_rx(VLANClientState *nc, const uint8_t *buf, size_t size)
+static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size)
 {
     struct XgmacState *s = DO_UPCAST(NICState, nc, nc)->opaque;
     static const unsigned char sa_bcast[6] = {0xff, 0xff, 0xff,
@@ -364,14 +364,14 @@ out:
     return ret;
 }
 
-static void eth_cleanup(VLANClientState *nc)
+static void eth_cleanup(NetClientState *nc)
 {
     struct XgmacState *s = DO_UPCAST(NICState, nc, nc)->opaque;
     s->nic = NULL;
 }
 
 static NetClientInfo net_xgmac_enet_info = {
-    .type = NET_CLIENT_TYPE_NIC,
+    .type = NET_CLIENT_OPTIONS_KIND_NIC,
     .size = sizeof(NICState),
     .can_receive = eth_can_rx,
     .receive = eth_rx,
@@ -403,19 +403,31 @@ static int xgmac_enet_init(SysBusDevice *dev)
     return 0;
 }
 
-static SysBusDeviceInfo xgmac_enet_info = {
-    .init = xgmac_enet_init,
-    .qdev.name  = "xgmac",
-    .qdev.size  = sizeof(struct XgmacState),
-    .qdev.vmsd = &vmstate_xgmac,
-    .qdev.props = (Property[]) {
-        DEFINE_NIC_PROPERTIES(struct XgmacState, conf),
-        DEFINE_PROP_END_OF_LIST(),
-    }
+static Property xgmac_properties[] = {
+    DEFINE_NIC_PROPERTIES(struct XgmacState, conf),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void xgmac_enet_class_init(ObjectClass *klass, void *data)
+{
+    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    sbc->init = xgmac_enet_init;
+    dc->vmsd = &vmstate_xgmac;
+    dc->props = xgmac_properties;
+}
+
+static TypeInfo xgmac_enet_info = {
+    .name          = "xgmac",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(struct XgmacState),
+    .class_init    = xgmac_enet_class_init,
 };
-static void xgmac_enet_register(void)
+
+static void xgmac_enet_register_types(void)
 {
-    sysbus_register_withprop(&xgmac_enet_info);
+    type_register_static(&xgmac_enet_info);
 }
 
-device_init(xgmac_enet_register)
+type_init(xgmac_enet_register_types)
This page took 0.02789 seconds and 4 git commands to generate.