From b79f17a9bc20efa2bc572528b047f1a297bdac3c Mon Sep 17 00:00:00 2001 From: Shmulik Ladkani Date: Thu, 24 Dec 2015 09:17:38 +0200 Subject: vmxnet3: coding: Introduce VMXNET3Class Introduce a class type for vmxnet3, and the usual DEVICE_CLASS/DEVICE_GET_CLASS macros. No semantic change. Signed-off-by: Shmulik Ladkani Signed-off-by: Jason Wang --- hw/net/vmxnet3.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'hw/net') diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index f398dea..3044711 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -119,9 +119,18 @@ #define VMXNET_FLAG_IS_SET(field, flag) (((field) & (flag)) == (flag)) +typedef struct VMXNET3Class { + PCIDeviceClass parent_class; +} VMXNET3Class; + #define TYPE_VMXNET3 "vmxnet3" #define VMXNET3(obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3) +#define VMXNET3_DEVICE_CLASS(klass) \ + OBJECT_CLASS_CHECK(VMXNET3Class, (klass), TYPE_VMXNET3) +#define VMXNET3_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(VMXNET3Class, (obj), TYPE_VMXNET3) + /* Cyclic ring abstraction */ typedef struct { hwaddr pa; @@ -2621,6 +2630,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data) static const TypeInfo vmxnet3_info = { .name = TYPE_VMXNET3, .parent = TYPE_PCI_DEVICE, + .class_size = sizeof(VMXNET3Class), .instance_size = sizeof(VMXNET3State), .class_init = vmxnet3_class_init, .instance_init = vmxnet3_instance_init, -- cgit v1.1