4 * Copyright Linaro Limited, 2015
7 * Eric Auger <eric.auger@linaro.org>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
14 #include "qemu/osdep.h"
15 #include "hw/vfio/vfio-amd-xgbe.h"
16 #include "qemu/module.h"
18 static void amd_xgbe_realize(DeviceState
*dev
, Error
**errp
)
20 VFIOPlatformDevice
*vdev
= VFIO_PLATFORM_DEVICE(dev
);
21 VFIOAmdXgbeDeviceClass
*k
= VFIO_AMD_XGBE_DEVICE_GET_CLASS(dev
);
23 vdev
->compat
= g_strdup("amd,xgbe-seattle-v1a");
26 k
->parent_realize(dev
, errp
);
29 static const VMStateDescription vfio_platform_amd_xgbe_vmstate
= {
30 .name
= "vfio-amd-xgbe",
34 static void vfio_amd_xgbe_class_init(ObjectClass
*klass
, void *data
)
36 DeviceClass
*dc
= DEVICE_CLASS(klass
);
37 VFIOAmdXgbeDeviceClass
*vcxc
=
38 VFIO_AMD_XGBE_DEVICE_CLASS(klass
);
39 device_class_set_parent_realize(dc
, amd_xgbe_realize
,
40 &vcxc
->parent_realize
);
41 dc
->desc
= "VFIO AMD XGBE";
42 dc
->vmsd
= &vfio_platform_amd_xgbe_vmstate
;
43 /* Supported by TYPE_VIRT_MACHINE */
44 dc
->user_creatable
= true;
47 static const TypeInfo vfio_amd_xgbe_dev_info
= {
48 .name
= TYPE_VFIO_AMD_XGBE
,
49 .parent
= TYPE_VFIO_PLATFORM
,
50 .instance_size
= sizeof(VFIOAmdXgbeDevice
),
51 .class_init
= vfio_amd_xgbe_class_init
,
52 .class_size
= sizeof(VFIOAmdXgbeDeviceClass
),
55 static void register_amd_xgbe_dev_type(void)
57 type_register_static(&vfio_amd_xgbe_dev_info
);
60 type_init(register_amd_xgbe_dev_type
)